| 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 3303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3314 void Assembler::EnterStubFrame() { | 3314 void Assembler::EnterStubFrame() { |
| 3315 EnterDartFrame(0, kNoRegister); | 3315 EnterDartFrame(0, kNoRegister); |
| 3316 } | 3316 } |
| 3317 | 3317 |
| 3318 | 3318 |
| 3319 void Assembler::LeaveStubFrame() { | 3319 void Assembler::LeaveStubFrame() { |
| 3320 LeaveDartFrame(); | 3320 LeaveDartFrame(); |
| 3321 } | 3321 } |
| 3322 | 3322 |
| 3323 | 3323 |
| 3324 #ifndef PRODUCT |
| 3324 void Assembler::MaybeTraceAllocation(intptr_t cid, | 3325 void Assembler::MaybeTraceAllocation(intptr_t cid, |
| 3325 Label* trace, | 3326 Label* trace, |
| 3326 bool near_jump) { | 3327 bool near_jump) { |
| 3327 ASSERT(cid > 0); | 3328 ASSERT(cid > 0); |
| 3328 intptr_t state_offset = ClassTable::StateOffsetFor(cid); | 3329 intptr_t state_offset = ClassTable::StateOffsetFor(cid); |
| 3329 Register temp_reg = TMP; | 3330 Register temp_reg = TMP; |
| 3330 LoadIsolate(temp_reg); | 3331 LoadIsolate(temp_reg); |
| 3331 intptr_t table_offset = | 3332 intptr_t table_offset = |
| 3332 Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid); | 3333 Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid); |
| 3333 movq(temp_reg, Address(temp_reg, table_offset)); | 3334 movq(temp_reg, Address(temp_reg, table_offset)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3368 void Assembler::UpdateAllocationStatsWithSize(intptr_t cid, | 3369 void Assembler::UpdateAllocationStatsWithSize(intptr_t cid, |
| 3369 intptr_t size_in_bytes, | 3370 intptr_t size_in_bytes, |
| 3370 Heap::Space space) { | 3371 Heap::Space space) { |
| 3371 ASSERT(cid > 0); | 3372 ASSERT(cid > 0); |
| 3372 ASSERT(cid < kNumPredefinedCids); | 3373 ASSERT(cid < kNumPredefinedCids); |
| 3373 UpdateAllocationStats(cid, space); | 3374 UpdateAllocationStats(cid, space); |
| 3374 Register temp_reg = TMP; | 3375 Register temp_reg = TMP; |
| 3375 intptr_t size_offset = ClassTable::SizeOffsetFor(cid, space == Heap::kNew); | 3376 intptr_t size_offset = ClassTable::SizeOffsetFor(cid, space == Heap::kNew); |
| 3376 addq(Address(temp_reg, size_offset), Immediate(size_in_bytes)); | 3377 addq(Address(temp_reg, size_offset), Immediate(size_in_bytes)); |
| 3377 } | 3378 } |
| 3379 #endif // !PRODUCT |
| 3378 | 3380 |
| 3379 | 3381 |
| 3380 void Assembler::TryAllocate(const Class& cls, | 3382 void Assembler::TryAllocate(const Class& cls, |
| 3381 Label* failure, | 3383 Label* failure, |
| 3382 bool near_jump, | 3384 bool near_jump, |
| 3383 Register instance_reg, | 3385 Register instance_reg, |
| 3384 Register temp) { | 3386 Register temp) { |
| 3385 ASSERT(failure != NULL); | 3387 ASSERT(failure != NULL); |
| 3386 if (FLAG_inline_alloc) { | 3388 if (FLAG_inline_alloc) { |
| 3387 // If this allocation is traced, program will jump to failure path | 3389 // If this allocation is traced, program will jump to failure path |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3742 | 3744 |
| 3743 | 3745 |
| 3744 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3746 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3745 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3747 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 3746 return xmm_reg_names[reg]; | 3748 return xmm_reg_names[reg]; |
| 3747 } | 3749 } |
| 3748 | 3750 |
| 3749 } // namespace dart | 3751 } // namespace dart |
| 3750 | 3752 |
| 3751 #endif // defined TARGET_ARCH_X64 | 3753 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |