| 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" | 5 #include "vm/globals.h" |
| 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 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3128 } | 3128 } |
| 3129 | 3129 |
| 3130 | 3130 |
| 3131 void Assembler::LeaveStubFrame() { | 3131 void Assembler::LeaveStubFrame() { |
| 3132 // Restore caller's PP register that was pushed in EnterStubFrame. | 3132 // Restore caller's PP register that was pushed in EnterStubFrame. |
| 3133 movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize))); | 3133 movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize))); |
| 3134 LeaveFrame(); | 3134 LeaveFrame(); |
| 3135 } | 3135 } |
| 3136 | 3136 |
| 3137 | 3137 |
| 3138 void Assembler::SetupPP(Register new_pp, Register temp_pc) { |
| 3139 Label next; |
| 3140 nop(4); // Need a fixed size sequence on frame entry. |
| 3141 call(&next); |
| 3142 Bind(&next); |
| 3143 |
| 3144 const intptr_t object_pool_pc_dist = |
| 3145 Instructions::HeaderSize() - Instructions::object_pool_offset() + |
| 3146 CodeSize(); |
| 3147 const intptr_t offset = |
| 3148 Assembler::EntryPointToPcMarkerOffset() - CodeSize(); |
| 3149 popq(temp_pc); |
| 3150 if (offset != 0) { |
| 3151 addq(temp_pc, Immediate(offset)); |
| 3152 } |
| 3153 |
| 3154 // Load callee's pool pointer. |
| 3155 movq(new_pp, Address(temp_pc, -object_pool_pc_dist - offset)); |
| 3156 } |
| 3157 |
| 3158 |
| 3138 void Assembler::ComputeCounterAddressesForCid(intptr_t cid, | 3159 void Assembler::ComputeCounterAddressesForCid(intptr_t cid, |
| 3139 Heap::Space space, | 3160 Heap::Space space, |
| 3140 Address* count_address, | 3161 Address* count_address, |
| 3141 Address* size_address) { | 3162 Address* size_address) { |
| 3142 ASSERT(cid < kNumPredefinedCids); | 3163 ASSERT(cid < kNumPredefinedCids); |
| 3143 Register temp_reg = TMP; | 3164 Register temp_reg = TMP; |
| 3144 Isolate* isolate = Isolate::Current(); | 3165 Isolate* isolate = Isolate::Current(); |
| 3145 ClassTable* class_table = isolate->class_table(); | 3166 ClassTable* class_table = isolate->class_table(); |
| 3146 const uword class_heap_stats_table_address = | 3167 const uword class_heap_stats_table_address = |
| 3147 class_table->PredefinedClassHeapStatsTableAddress(); | 3168 class_table->PredefinedClassHeapStatsTableAddress(); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3558 | 3579 |
| 3559 | 3580 |
| 3560 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3581 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3561 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3582 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 3562 return xmm_reg_names[reg]; | 3583 return xmm_reg_names[reg]; |
| 3563 } | 3584 } |
| 3564 | 3585 |
| 3565 } // namespace dart | 3586 } // namespace dart |
| 3566 | 3587 |
| 3567 #endif // defined TARGET_ARCH_X64 | 3588 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |