| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_CONSTANTS_DBC_H_ | 5 #ifndef VM_CONSTANTS_DBC_H_ |
| 6 #define VM_CONSTANTS_DBC_H_ | 6 #define VM_CONSTANTS_DBC_H_ |
| 7 | 7 |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // instruction (which implements a slow path fallback). | 165 // instruction (which implements a slow path fallback). |
| 166 // | 166 // |
| 167 // - Add, Sub, Mul, Div, Mod, Shl, Shr rA, rB, rC | 167 // - Add, Sub, Mul, Div, Mod, Shl, Shr rA, rB, rC |
| 168 // | 168 // |
| 169 // Arithmetic operations on Smis. FP[rA] <- FP[rB] op FP[rC]. | 169 // Arithmetic operations on Smis. FP[rA] <- FP[rB] op FP[rC]. |
| 170 // If these instructions can trigger a deoptimization, the following | 170 // If these instructions can trigger a deoptimization, the following |
| 171 // instruction should be Deopt. If no deoptimization should be triggered, | 171 // instruction should be Deopt. If no deoptimization should be triggered, |
| 172 // the immediately following instruction is skipped. These instructions | 172 // the immediately following instruction is skipped. These instructions |
| 173 // expect their operands to be Smis, but don't check that they are. | 173 // expect their operands to be Smis, but don't check that they are. |
| 174 // | 174 // |
| 175 // - Neg rA , rD |
| 176 // |
| 177 // FP[rA] <- -FP[rD]. Assumes FP[rD] is a Smi. If there is no overflow the |
| 178 // immediately following instruction is skipped. |
| 179 // |
| 175 // - BitOr, BitAnd, BitXor rA, rB, rC | 180 // - BitOr, BitAnd, BitXor rA, rB, rC |
| 176 // | 181 // |
| 177 // FP[rA] <- FP[rB] op FP[rC]. These instructions expect their operands to be | 182 // FP[rA] <- FP[rB] op FP[rC]. These instructions expect their operands to be |
| 178 // Smis, but don't check that they are. | 183 // Smis, but don't check that they are. |
| 179 // | 184 // |
| 180 // - StoreStaticTOS D | 185 // - BitNot rA, rD |
| 186 // |
| 187 // FP[rA] <- ~FP[rD]. As above, assumes FP[rD] is a Smi. |
| 188 // |
| 189 // - StoreStaticT`OS D |
| 181 // | 190 // |
| 182 // Stores TOS into the static field PP[D]. | 191 // Stores TOS into the static field PP[D]. |
| 183 // | 192 // |
| 184 // - PushStatic | 193 // - PushStatic |
| 185 // | 194 // |
| 186 // Pushes value of the static field PP[D] on to the stack. | 195 // Pushes value of the static field PP[D] on to the stack. |
| 187 // | 196 // |
| 188 // - InitStaticTOS | 197 // - InitStaticTOS |
| 189 // | 198 // |
| 190 // Takes static field from TOS and ensures that it is initialized. | 199 // Takes static field from TOS and ensures that it is initialized. |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // SP[-1] with type arguments SP[-2] using SubtypeTestCache PP[D]. | 346 // SP[-1] with type arguments SP[-2] using SubtypeTestCache PP[D]. |
| 338 // | 347 // |
| 339 // - AssertBoolean A | 348 // - AssertBoolean A |
| 340 // | 349 // |
| 341 // Assert that TOS is a boolean (A = 1) or that TOS is not null (A = 0). | 350 // Assert that TOS is a boolean (A = 1) or that TOS is not null (A = 0). |
| 342 // | 351 // |
| 343 // - CheckSmi rA | 352 // - CheckSmi rA |
| 344 // | 353 // |
| 345 // If FP[rA] is a Smi, then skip the next instruction. | 354 // If FP[rA] is a Smi, then skip the next instruction. |
| 346 // | 355 // |
| 356 // - CheckClassId rA, D |
| 357 // |
| 358 // If the object at FP[rA]'s class id matches hthe class id in PP[D], then |
| 359 // skip the following instruction. |
| 360 // |
| 347 // - CheckStack | 361 // - CheckStack |
| 348 // | 362 // |
| 349 // Compare SP against isolate stack limit and call StackOverflow handler if | 363 // Compare SP against isolate stack limit and call StackOverflow handler if |
| 350 // necessary. | 364 // necessary. |
| 351 // | 365 // |
| 352 // - DebugStep, DebugBreak A | 366 // - DebugStep, DebugBreak A |
| 353 // | 367 // |
| 354 // Debugger support. DebugBreak is bytecode that can be patched into the | 368 // Debugger support. DebugBreak is bytecode that can be patched into the |
| 355 // instruction stream to trigger in place breakpoint. | 369 // instruction stream to trigger in place breakpoint. |
| 356 // | 370 // |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 V(BitOrTOS, 0, ___, ___, ___) \ | 452 V(BitOrTOS, 0, ___, ___, ___) \ |
| 439 V(BitAndTOS, 0, ___, ___, ___) \ | 453 V(BitAndTOS, 0, ___, ___, ___) \ |
| 440 V(EqualTOS, 0, ___, ___, ___) \ | 454 V(EqualTOS, 0, ___, ___, ___) \ |
| 441 V(LessThanTOS, 0, ___, ___, ___) \ | 455 V(LessThanTOS, 0, ___, ___, ___) \ |
| 442 V(GreaterThanTOS, 0, ___, ___, ___) \ | 456 V(GreaterThanTOS, 0, ___, ___, ___) \ |
| 443 V(Add, A_B_C, reg, reg, reg) \ | 457 V(Add, A_B_C, reg, reg, reg) \ |
| 444 V(Sub, A_B_C, reg, reg, reg) \ | 458 V(Sub, A_B_C, reg, reg, reg) \ |
| 445 V(Mul, A_B_C, reg, reg, reg) \ | 459 V(Mul, A_B_C, reg, reg, reg) \ |
| 446 V(Div, A_B_C, reg, reg, reg) \ | 460 V(Div, A_B_C, reg, reg, reg) \ |
| 447 V(Mod, A_B_C, reg, reg, reg) \ | 461 V(Mod, A_B_C, reg, reg, reg) \ |
| 462 V(Shl, A_B_C, reg, reg, reg) \ |
| 463 V(Shr, A_B_C, reg, reg, reg) \ |
| 464 V(Neg, A_D, reg, reg, ___) \ |
| 448 V(BitOr, A_B_C, reg, reg, reg) \ | 465 V(BitOr, A_B_C, reg, reg, reg) \ |
| 449 V(BitAnd, A_B_C, reg, reg, reg) \ | 466 V(BitAnd, A_B_C, reg, reg, reg) \ |
| 450 V(BitXor, A_B_C, reg, reg, reg) \ | 467 V(BitXor, A_B_C, reg, reg, reg) \ |
| 451 V(Shl, A_B_C, reg, reg, reg) \ | 468 V(BitNot, A_D, reg, reg, ___) \ |
| 452 V(Shr, A_B_C, reg, reg, reg) \ | |
| 453 V(StoreStaticTOS, D, lit, ___, ___) \ | 469 V(StoreStaticTOS, D, lit, ___, ___) \ |
| 454 V(PushStatic, D, lit, ___, ___) \ | 470 V(PushStatic, D, lit, ___, ___) \ |
| 455 V(InitStaticTOS, 0, ___, ___, ___) \ | 471 V(InitStaticTOS, 0, ___, ___, ___) \ |
| 456 V(IfNeStrictTOS, 0, ___, ___, ___) \ | 472 V(IfNeStrictTOS, 0, ___, ___, ___) \ |
| 457 V(IfEqStrictTOS, 0, ___, ___, ___) \ | 473 V(IfEqStrictTOS, 0, ___, ___, ___) \ |
| 458 V(IfNeStrictNumTOS, 0, ___, ___, ___) \ | 474 V(IfNeStrictNumTOS, 0, ___, ___, ___) \ |
| 459 V(IfEqStrictNumTOS, 0, ___, ___, ___) \ | 475 V(IfEqStrictNumTOS, 0, ___, ___, ___) \ |
| 460 V(IfNeStrict, A_D, reg, reg, ___) \ | 476 V(IfNeStrict, A_D, reg, reg, ___) \ |
| 461 V(IfEqStrict, A_D, reg, reg, ___) \ | 477 V(IfEqStrict, A_D, reg, reg, ___) \ |
| 462 V(IfNeStrictNum, A_D, reg, reg, ___) \ | 478 V(IfNeStrictNum, A_D, reg, reg, ___) \ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 479 V(Frame, D, num, ___, ___) \ | 495 V(Frame, D, num, ___, ___) \ |
| 480 V(SetFrame, A, num, ___, num) \ | 496 V(SetFrame, A, num, ___, num) \ |
| 481 V(AllocateContext, D, num, ___, ___) \ | 497 V(AllocateContext, D, num, ___, ___) \ |
| 482 V(CloneContext, 0, ___, ___, ___) \ | 498 V(CloneContext, 0, ___, ___, ___) \ |
| 483 V(MoveSpecial, A_D, reg, num, ___) \ | 499 V(MoveSpecial, A_D, reg, num, ___) \ |
| 484 V(InstantiateType, D, lit, ___, ___) \ | 500 V(InstantiateType, D, lit, ___, ___) \ |
| 485 V(InstantiateTypeArgumentsTOS, A_D, num, lit, ___) \ | 501 V(InstantiateTypeArgumentsTOS, A_D, num, lit, ___) \ |
| 486 V(AssertAssignable, D, num, lit, ___) \ | 502 V(AssertAssignable, D, num, lit, ___) \ |
| 487 V(AssertBoolean, A, num, ___, ___) \ | 503 V(AssertBoolean, A, num, ___, ___) \ |
| 488 V(CheckSmi, A, reg, ___, ___) \ | 504 V(CheckSmi, A, reg, ___, ___) \ |
| 505 V(CheckClassId, A_D, reg, lit, ___) \ |
| 489 V(CheckStack, 0, ___, ___, ___) \ | 506 V(CheckStack, 0, ___, ___, ___) \ |
| 490 V(DebugStep, 0, ___, ___, ___) \ | 507 V(DebugStep, 0, ___, ___, ___) \ |
| 491 V(DebugBreak, A, num, ___, ___) \ | 508 V(DebugBreak, A, num, ___, ___) \ |
| 492 V(Deopt, A_D, num, num, ___) \ | 509 V(Deopt, A_D, num, num, ___) \ |
| 493 | 510 |
| 494 typedef uint32_t Instr; | 511 typedef uint32_t Instr; |
| 495 | 512 |
| 496 class Bytecode { | 513 class Bytecode { |
| 497 public: | 514 public: |
| 498 enum Opcode { | 515 enum Opcode { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 kNumberOfDummyFpuRegisters, | 618 kNumberOfDummyFpuRegisters, |
| 602 }; | 619 }; |
| 603 const FpuRegister FpuTMP = kFakeFpuRegister; | 620 const FpuRegister FpuTMP = kFakeFpuRegister; |
| 604 const intptr_t kNumberOfFpuRegisters = 1; | 621 const intptr_t kNumberOfFpuRegisters = 1; |
| 605 | 622 |
| 606 enum Condition { EQ, NE }; | 623 enum Condition { EQ, NE }; |
| 607 | 624 |
| 608 } // namespace dart | 625 } // namespace dart |
| 609 | 626 |
| 610 #endif // VM_CONSTANTS_DBC_H_ | 627 #endif // VM_CONSTANTS_DBC_H_ |
| OLD | NEW |