Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * vim: set ts=8 sts=4 et sw=4 tw=99: |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef jit_mips_LIR_mips_h |
michael@0 | 8 | #define jit_mips_LIR_mips_h |
michael@0 | 9 | |
michael@0 | 10 | namespace js { |
michael@0 | 11 | namespace jit { |
michael@0 | 12 | |
michael@0 | 13 | class LBox : public LInstructionHelper<2, 1, 0> |
michael@0 | 14 | { |
michael@0 | 15 | MIRType type_; |
michael@0 | 16 | |
michael@0 | 17 | public: |
michael@0 | 18 | LIR_HEADER(Box); |
michael@0 | 19 | |
michael@0 | 20 | LBox(const LAllocation &in_payload, MIRType type) |
michael@0 | 21 | : type_(type) |
michael@0 | 22 | { |
michael@0 | 23 | setOperand(0, in_payload); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | MIRType type() const { |
michael@0 | 27 | return type_; |
michael@0 | 28 | } |
michael@0 | 29 | const char *extraName() const { |
michael@0 | 30 | return StringFromMIRType(type_); |
michael@0 | 31 | } |
michael@0 | 32 | }; |
michael@0 | 33 | |
michael@0 | 34 | class LBoxFloatingPoint : public LInstructionHelper<2, 1, 1> |
michael@0 | 35 | { |
michael@0 | 36 | MIRType type_; |
michael@0 | 37 | |
michael@0 | 38 | public: |
michael@0 | 39 | LIR_HEADER(BoxFloatingPoint); |
michael@0 | 40 | |
michael@0 | 41 | LBoxFloatingPoint(const LAllocation &in, const LDefinition &temp, MIRType type) |
michael@0 | 42 | : type_(type) |
michael@0 | 43 | { |
michael@0 | 44 | setOperand(0, in); |
michael@0 | 45 | setTemp(0, temp); |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | MIRType type() const { |
michael@0 | 49 | return type_; |
michael@0 | 50 | } |
michael@0 | 51 | const char *extraName() const { |
michael@0 | 52 | return StringFromMIRType(type_); |
michael@0 | 53 | } |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | class LUnbox : public LInstructionHelper<1, 2, 0> |
michael@0 | 57 | { |
michael@0 | 58 | public: |
michael@0 | 59 | LIR_HEADER(Unbox); |
michael@0 | 60 | |
michael@0 | 61 | MUnbox *mir() const { |
michael@0 | 62 | return mir_->toUnbox(); |
michael@0 | 63 | } |
michael@0 | 64 | const LAllocation *payload() { |
michael@0 | 65 | return getOperand(0); |
michael@0 | 66 | } |
michael@0 | 67 | const LAllocation *type() { |
michael@0 | 68 | return getOperand(1); |
michael@0 | 69 | } |
michael@0 | 70 | const char *extraName() const { |
michael@0 | 71 | return StringFromMIRType(mir()->type()); |
michael@0 | 72 | } |
michael@0 | 73 | }; |
michael@0 | 74 | |
michael@0 | 75 | class LUnboxFloatingPoint : public LInstructionHelper<1, 2, 0> |
michael@0 | 76 | { |
michael@0 | 77 | MIRType type_; |
michael@0 | 78 | |
michael@0 | 79 | public: |
michael@0 | 80 | LIR_HEADER(UnboxFloatingPoint); |
michael@0 | 81 | |
michael@0 | 82 | static const size_t Input = 0; |
michael@0 | 83 | |
michael@0 | 84 | LUnboxFloatingPoint(MIRType type) |
michael@0 | 85 | : type_(type) |
michael@0 | 86 | { } |
michael@0 | 87 | |
michael@0 | 88 | MUnbox *mir() const { |
michael@0 | 89 | return mir_->toUnbox(); |
michael@0 | 90 | } |
michael@0 | 91 | |
michael@0 | 92 | MIRType type() const { |
michael@0 | 93 | return type_; |
michael@0 | 94 | } |
michael@0 | 95 | const char *extraName() const { |
michael@0 | 96 | return StringFromMIRType(type_); |
michael@0 | 97 | } |
michael@0 | 98 | }; |
michael@0 | 99 | |
michael@0 | 100 | // Convert a 32-bit unsigned integer to a double. |
michael@0 | 101 | class LAsmJSUInt32ToDouble : public LInstructionHelper<1, 1, 0> |
michael@0 | 102 | { |
michael@0 | 103 | public: |
michael@0 | 104 | LIR_HEADER(AsmJSUInt32ToDouble) |
michael@0 | 105 | |
michael@0 | 106 | LAsmJSUInt32ToDouble(const LAllocation &input) { |
michael@0 | 107 | setOperand(0, input); |
michael@0 | 108 | } |
michael@0 | 109 | }; |
michael@0 | 110 | |
michael@0 | 111 | // Convert a 32-bit unsigned integer to a float32. |
michael@0 | 112 | class LAsmJSUInt32ToFloat32 : public LInstructionHelper<1, 1, 0> |
michael@0 | 113 | { |
michael@0 | 114 | public: |
michael@0 | 115 | LIR_HEADER(AsmJSUInt32ToFloat32) |
michael@0 | 116 | |
michael@0 | 117 | LAsmJSUInt32ToFloat32(const LAllocation &input) { |
michael@0 | 118 | setOperand(0, input); |
michael@0 | 119 | } |
michael@0 | 120 | }; |
michael@0 | 121 | |
michael@0 | 122 | |
michael@0 | 123 | class LDivI : public LBinaryMath<1> |
michael@0 | 124 | { |
michael@0 | 125 | public: |
michael@0 | 126 | LIR_HEADER(DivI); |
michael@0 | 127 | |
michael@0 | 128 | LDivI(const LAllocation &lhs, const LAllocation &rhs, |
michael@0 | 129 | const LDefinition &temp) { |
michael@0 | 130 | setOperand(0, lhs); |
michael@0 | 131 | setOperand(1, rhs); |
michael@0 | 132 | setTemp(0, temp); |
michael@0 | 133 | } |
michael@0 | 134 | |
michael@0 | 135 | MDiv *mir() const { |
michael@0 | 136 | return mir_->toDiv(); |
michael@0 | 137 | } |
michael@0 | 138 | }; |
michael@0 | 139 | |
michael@0 | 140 | class LDivPowTwoI : public LInstructionHelper<1, 1, 1> |
michael@0 | 141 | { |
michael@0 | 142 | const int32_t shift_; |
michael@0 | 143 | |
michael@0 | 144 | public: |
michael@0 | 145 | LIR_HEADER(DivPowTwoI) |
michael@0 | 146 | |
michael@0 | 147 | LDivPowTwoI(const LAllocation &lhs, int32_t shift, const LDefinition &temp) |
michael@0 | 148 | : shift_(shift) |
michael@0 | 149 | { |
michael@0 | 150 | setOperand(0, lhs); |
michael@0 | 151 | setTemp(0, temp); |
michael@0 | 152 | } |
michael@0 | 153 | |
michael@0 | 154 | const LAllocation *numerator() { |
michael@0 | 155 | return getOperand(0); |
michael@0 | 156 | } |
michael@0 | 157 | |
michael@0 | 158 | int32_t shift() { |
michael@0 | 159 | return shift_; |
michael@0 | 160 | } |
michael@0 | 161 | |
michael@0 | 162 | MDiv *mir() const { |
michael@0 | 163 | return mir_->toDiv(); |
michael@0 | 164 | } |
michael@0 | 165 | }; |
michael@0 | 166 | |
michael@0 | 167 | class LModI : public LBinaryMath<1> |
michael@0 | 168 | { |
michael@0 | 169 | public: |
michael@0 | 170 | LIR_HEADER(ModI); |
michael@0 | 171 | |
michael@0 | 172 | LModI(const LAllocation &lhs, const LAllocation &rhs, |
michael@0 | 173 | const LDefinition &callTemp) |
michael@0 | 174 | { |
michael@0 | 175 | setOperand(0, lhs); |
michael@0 | 176 | setOperand(1, rhs); |
michael@0 | 177 | setTemp(0, callTemp); |
michael@0 | 178 | } |
michael@0 | 179 | |
michael@0 | 180 | const LDefinition *callTemp() { |
michael@0 | 181 | return getTemp(0); |
michael@0 | 182 | } |
michael@0 | 183 | |
michael@0 | 184 | MMod *mir() const { |
michael@0 | 185 | return mir_->toMod(); |
michael@0 | 186 | } |
michael@0 | 187 | }; |
michael@0 | 188 | |
michael@0 | 189 | class LModPowTwoI : public LInstructionHelper<1, 1, 0> |
michael@0 | 190 | { |
michael@0 | 191 | const int32_t shift_; |
michael@0 | 192 | |
michael@0 | 193 | public: |
michael@0 | 194 | LIR_HEADER(ModPowTwoI); |
michael@0 | 195 | int32_t shift() |
michael@0 | 196 | { |
michael@0 | 197 | return shift_; |
michael@0 | 198 | } |
michael@0 | 199 | |
michael@0 | 200 | LModPowTwoI(const LAllocation &lhs, int32_t shift) |
michael@0 | 201 | : shift_(shift) |
michael@0 | 202 | { |
michael@0 | 203 | setOperand(0, lhs); |
michael@0 | 204 | } |
michael@0 | 205 | |
michael@0 | 206 | MMod *mir() const { |
michael@0 | 207 | return mir_->toMod(); |
michael@0 | 208 | } |
michael@0 | 209 | }; |
michael@0 | 210 | |
michael@0 | 211 | class LModMaskI : public LInstructionHelper<1, 1, 1> |
michael@0 | 212 | { |
michael@0 | 213 | const int32_t shift_; |
michael@0 | 214 | |
michael@0 | 215 | public: |
michael@0 | 216 | LIR_HEADER(ModMaskI); |
michael@0 | 217 | |
michael@0 | 218 | LModMaskI(const LAllocation &lhs, const LDefinition &temp1, int32_t shift) |
michael@0 | 219 | : shift_(shift) |
michael@0 | 220 | { |
michael@0 | 221 | setOperand(0, lhs); |
michael@0 | 222 | setTemp(0, temp1); |
michael@0 | 223 | } |
michael@0 | 224 | |
michael@0 | 225 | int32_t shift() const { |
michael@0 | 226 | return shift_; |
michael@0 | 227 | } |
michael@0 | 228 | |
michael@0 | 229 | MMod *mir() const { |
michael@0 | 230 | return mir_->toMod(); |
michael@0 | 231 | } |
michael@0 | 232 | }; |
michael@0 | 233 | |
michael@0 | 234 | class LPowHalfD : public LInstructionHelper<1, 1, 0> |
michael@0 | 235 | { |
michael@0 | 236 | public: |
michael@0 | 237 | LIR_HEADER(PowHalfD); |
michael@0 | 238 | LPowHalfD(const LAllocation &input) { |
michael@0 | 239 | setOperand(0, input); |
michael@0 | 240 | } |
michael@0 | 241 | |
michael@0 | 242 | const LAllocation *input() { |
michael@0 | 243 | return getOperand(0); |
michael@0 | 244 | } |
michael@0 | 245 | const LDefinition *output() { |
michael@0 | 246 | return getDef(0); |
michael@0 | 247 | } |
michael@0 | 248 | }; |
michael@0 | 249 | |
michael@0 | 250 | // Takes a tableswitch with an integer to decide |
michael@0 | 251 | class LTableSwitch : public LInstructionHelper<0, 1, 2> |
michael@0 | 252 | { |
michael@0 | 253 | public: |
michael@0 | 254 | LIR_HEADER(TableSwitch); |
michael@0 | 255 | |
michael@0 | 256 | LTableSwitch(const LAllocation &in, const LDefinition &inputCopy, |
michael@0 | 257 | const LDefinition &jumpTablePointer, MTableSwitch *ins) { |
michael@0 | 258 | setOperand(0, in); |
michael@0 | 259 | setTemp(0, inputCopy); |
michael@0 | 260 | setTemp(1, jumpTablePointer); |
michael@0 | 261 | setMir(ins); |
michael@0 | 262 | } |
michael@0 | 263 | |
michael@0 | 264 | MTableSwitch *mir() const { |
michael@0 | 265 | return mir_->toTableSwitch(); |
michael@0 | 266 | } |
michael@0 | 267 | |
michael@0 | 268 | const LAllocation *index() { |
michael@0 | 269 | return getOperand(0); |
michael@0 | 270 | } |
michael@0 | 271 | const LDefinition *tempInt() { |
michael@0 | 272 | return getTemp(0); |
michael@0 | 273 | } |
michael@0 | 274 | // This is added to share the same CodeGenerator prefixes. |
michael@0 | 275 | const LDefinition *tempPointer() { |
michael@0 | 276 | return getTemp(1); |
michael@0 | 277 | } |
michael@0 | 278 | }; |
michael@0 | 279 | |
michael@0 | 280 | // Takes a tableswitch with an integer to decide |
michael@0 | 281 | class LTableSwitchV : public LInstructionHelper<0, BOX_PIECES, 3> |
michael@0 | 282 | { |
michael@0 | 283 | public: |
michael@0 | 284 | LIR_HEADER(TableSwitchV); |
michael@0 | 285 | |
michael@0 | 286 | LTableSwitchV(const LDefinition &inputCopy, const LDefinition &floatCopy, |
michael@0 | 287 | const LDefinition &jumpTablePointer, MTableSwitch *ins) |
michael@0 | 288 | { |
michael@0 | 289 | setTemp(0, inputCopy); |
michael@0 | 290 | setTemp(1, floatCopy); |
michael@0 | 291 | setTemp(2, jumpTablePointer); |
michael@0 | 292 | setMir(ins); |
michael@0 | 293 | } |
michael@0 | 294 | |
michael@0 | 295 | MTableSwitch *mir() const { |
michael@0 | 296 | return mir_->toTableSwitch(); |
michael@0 | 297 | } |
michael@0 | 298 | |
michael@0 | 299 | static const size_t InputValue = 0; |
michael@0 | 300 | |
michael@0 | 301 | const LDefinition *tempInt() { |
michael@0 | 302 | return getTemp(0); |
michael@0 | 303 | } |
michael@0 | 304 | const LDefinition *tempFloat() { |
michael@0 | 305 | return getTemp(1); |
michael@0 | 306 | } |
michael@0 | 307 | const LDefinition *tempPointer() { |
michael@0 | 308 | return getTemp(2); |
michael@0 | 309 | } |
michael@0 | 310 | }; |
michael@0 | 311 | |
michael@0 | 312 | class LGuardShape : public LInstructionHelper<0, 1, 1> |
michael@0 | 313 | { |
michael@0 | 314 | public: |
michael@0 | 315 | LIR_HEADER(GuardShape); |
michael@0 | 316 | |
michael@0 | 317 | LGuardShape(const LAllocation &in, const LDefinition &temp) { |
michael@0 | 318 | setOperand(0, in); |
michael@0 | 319 | setTemp(0, temp); |
michael@0 | 320 | } |
michael@0 | 321 | const MGuardShape *mir() const { |
michael@0 | 322 | return mir_->toGuardShape(); |
michael@0 | 323 | } |
michael@0 | 324 | const LDefinition *tempInt() { |
michael@0 | 325 | return getTemp(0); |
michael@0 | 326 | } |
michael@0 | 327 | }; |
michael@0 | 328 | |
michael@0 | 329 | class LGuardObjectType : public LInstructionHelper<0, 1, 1> |
michael@0 | 330 | { |
michael@0 | 331 | public: |
michael@0 | 332 | LIR_HEADER(GuardObjectType); |
michael@0 | 333 | |
michael@0 | 334 | LGuardObjectType(const LAllocation &in, const LDefinition &temp) { |
michael@0 | 335 | setOperand(0, in); |
michael@0 | 336 | setTemp(0, temp); |
michael@0 | 337 | } |
michael@0 | 338 | const MGuardObjectType *mir() const { |
michael@0 | 339 | return mir_->toGuardObjectType(); |
michael@0 | 340 | } |
michael@0 | 341 | const LDefinition *tempInt() { |
michael@0 | 342 | return getTemp(0); |
michael@0 | 343 | } |
michael@0 | 344 | }; |
michael@0 | 345 | |
michael@0 | 346 | class LInterruptCheck : public LInstructionHelper<0, 0, 0> |
michael@0 | 347 | { |
michael@0 | 348 | public: |
michael@0 | 349 | LIR_HEADER(InterruptCheck); |
michael@0 | 350 | }; |
michael@0 | 351 | |
michael@0 | 352 | class LMulI : public LBinaryMath<0> |
michael@0 | 353 | { |
michael@0 | 354 | public: |
michael@0 | 355 | LIR_HEADER(MulI); |
michael@0 | 356 | |
michael@0 | 357 | MMul *mir() { |
michael@0 | 358 | return mir_->toMul(); |
michael@0 | 359 | } |
michael@0 | 360 | }; |
michael@0 | 361 | |
michael@0 | 362 | class LUDiv : public LBinaryMath<0> |
michael@0 | 363 | { |
michael@0 | 364 | public: |
michael@0 | 365 | LIR_HEADER(UDiv); |
michael@0 | 366 | |
michael@0 | 367 | MDiv *mir() { |
michael@0 | 368 | return mir_->toDiv(); |
michael@0 | 369 | } |
michael@0 | 370 | }; |
michael@0 | 371 | |
michael@0 | 372 | class LUMod : public LBinaryMath<0> |
michael@0 | 373 | { |
michael@0 | 374 | public: |
michael@0 | 375 | LIR_HEADER(UMod); |
michael@0 | 376 | |
michael@0 | 377 | MMod *mir() { |
michael@0 | 378 | return mir_->toMod(); |
michael@0 | 379 | } |
michael@0 | 380 | }; |
michael@0 | 381 | |
michael@0 | 382 | class LAsmJSLoadFuncPtr : public LInstructionHelper<1, 1, 1> |
michael@0 | 383 | { |
michael@0 | 384 | public: |
michael@0 | 385 | LIR_HEADER(AsmJSLoadFuncPtr); |
michael@0 | 386 | LAsmJSLoadFuncPtr(const LAllocation &index, const LDefinition &temp) { |
michael@0 | 387 | setOperand(0, index); |
michael@0 | 388 | setTemp(0, temp); |
michael@0 | 389 | } |
michael@0 | 390 | const MAsmJSLoadFuncPtr *mir() const { |
michael@0 | 391 | return mir_->toAsmJSLoadFuncPtr(); |
michael@0 | 392 | } |
michael@0 | 393 | const LAllocation *index() { |
michael@0 | 394 | return getOperand(0); |
michael@0 | 395 | } |
michael@0 | 396 | const LDefinition *temp() { |
michael@0 | 397 | return getTemp(0); |
michael@0 | 398 | } |
michael@0 | 399 | }; |
michael@0 | 400 | |
michael@0 | 401 | } // namespace jit |
michael@0 | 402 | } // namespace js |
michael@0 | 403 | |
michael@0 | 404 | #endif /* jit_mips_LIR_mips_h */ |