| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "vm/globals.h" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3217 ASSERT(Utils::IsInt(8, offset)); | 3217 ASSERT(Utils::IsInt(8, offset)); |
| 3218 buffer_.Store<int8_t>(position, offset); | 3218 buffer_.Store<int8_t>(position, offset); |
| 3219 } | 3219 } |
| 3220 label->BindTo(bound); | 3220 label->BindTo(bound); |
| 3221 } | 3221 } |
| 3222 | 3222 |
| 3223 | 3223 |
| 3224 void Assembler::EnterFrame(intptr_t frame_size) { | 3224 void Assembler::EnterFrame(intptr_t frame_size) { |
| 3225 if (prologue_offset_ == -1) { | 3225 if (prologue_offset_ == -1) { |
| 3226 prologue_offset_ = CodeSize(); | 3226 prologue_offset_ = CodeSize(); |
| 3227 Comment("PrologueOffset = %" Pd "", CodeSize()); |
| 3227 } | 3228 } |
| 3229 #ifdef DEBUG |
| 3230 intptr_t check_offset = CodeSize(); |
| 3231 #endif |
| 3228 pushq(RBP); | 3232 pushq(RBP); |
| 3229 movq(RBP, RSP); | 3233 movq(RBP, RSP); |
| 3234 #ifdef DEBUG |
| 3235 ProloguePattern pp(CodeAddress(check_offset)); |
| 3236 ASSERT(pp.IsValid()); |
| 3237 #endif |
| 3230 if (frame_size != 0) { | 3238 if (frame_size != 0) { |
| 3231 Immediate frame_space(frame_size); | 3239 Immediate frame_space(frame_size); |
| 3232 subq(RSP, frame_space); | 3240 subq(RSP, frame_space); |
| 3233 } | 3241 } |
| 3234 } | 3242 } |
| 3235 | 3243 |
| 3236 | 3244 |
| 3237 void Assembler::LeaveFrame() { | 3245 void Assembler::LeaveFrame() { |
| 3238 movq(RSP, RBP); | 3246 movq(RSP, RBP); |
| 3239 popq(RBP); | 3247 popq(RBP); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3399 | 3407 |
| 3400 | 3408 |
| 3401 // On entry to a function compiled for OSR, the caller's frame pointer, the | 3409 // On entry to a function compiled for OSR, the caller's frame pointer, the |
| 3402 // stack locals, and any copied parameters are already in place. The frame | 3410 // stack locals, and any copied parameters are already in place. The frame |
| 3403 // pointer is already set up. The PC marker is not correct for the | 3411 // pointer is already set up. The PC marker is not correct for the |
| 3404 // optimized function and there may be extra space for spill slots to | 3412 // optimized function and there may be extra space for spill slots to |
| 3405 // allocate. | 3413 // allocate. |
| 3406 void Assembler::EnterOsrFrame(intptr_t extra_size, | 3414 void Assembler::EnterOsrFrame(intptr_t extra_size, |
| 3407 Register new_pp, | 3415 Register new_pp, |
| 3408 Register pc_marker_override) { | 3416 Register pc_marker_override) { |
| 3417 if (prologue_offset_ == -1) { |
| 3418 Comment("PrologueOffset = %" Pd "", CodeSize()); |
| 3419 prologue_offset_ = CodeSize(); |
| 3420 } |
| 3409 movq(Address(RBP, kPcMarkerSlotFromFp * kWordSize), pc_marker_override); | 3421 movq(Address(RBP, kPcMarkerSlotFromFp * kWordSize), pc_marker_override); |
| 3410 movq(PP, new_pp); | 3422 movq(PP, new_pp); |
| 3411 if (extra_size != 0) { | 3423 if (extra_size != 0) { |
| 3412 subq(RSP, Immediate(extra_size)); | 3424 subq(RSP, Immediate(extra_size)); |
| 3413 } | 3425 } |
| 3414 } | 3426 } |
| 3415 | 3427 |
| 3416 | 3428 |
| 3417 void Assembler::EnterStubFrame(bool load_pp) { | 3429 void Assembler::EnterStubFrame(bool load_pp) { |
| 3418 EnterFrame(0); | 3430 EnterFrame(0); |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3896 | 3908 |
| 3897 | 3909 |
| 3898 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3910 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3899 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3911 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 3900 return xmm_reg_names[reg]; | 3912 return xmm_reg_names[reg]; |
| 3901 } | 3913 } |
| 3902 | 3914 |
| 3903 } // namespace dart | 3915 } // namespace dart |
| 3904 | 3916 |
| 3905 #endif // defined TARGET_ARCH_X64 | 3917 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |