| 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 2551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2562 while (label->HasNear()) { | 2562 while (label->HasNear()) { |
| 2563 intptr_t position = label->NearPosition(); | 2563 intptr_t position = label->NearPosition(); |
| 2564 intptr_t offset = bound - (position + 1); | 2564 intptr_t offset = bound - (position + 1); |
| 2565 ASSERT(Utils::IsInt(8, offset)); | 2565 ASSERT(Utils::IsInt(8, offset)); |
| 2566 buffer_.Store<int8_t>(position, offset); | 2566 buffer_.Store<int8_t>(position, offset); |
| 2567 } | 2567 } |
| 2568 label->BindTo(bound); | 2568 label->BindTo(bound); |
| 2569 } | 2569 } |
| 2570 | 2570 |
| 2571 | 2571 |
| 2572 #ifndef PRODUCT |
| 2572 void Assembler::MaybeTraceAllocation(intptr_t cid, | 2573 void Assembler::MaybeTraceAllocation(intptr_t cid, |
| 2573 Register temp_reg, | 2574 Register temp_reg, |
| 2574 Label* trace, | 2575 Label* trace, |
| 2575 bool near_jump) { | 2576 bool near_jump) { |
| 2576 ASSERT(cid > 0); | 2577 ASSERT(cid > 0); |
| 2577 Address state_address(kNoRegister, 0); | 2578 Address state_address(kNoRegister, 0); |
| 2578 intptr_t state_offset = ClassTable::StateOffsetFor(cid); | 2579 intptr_t state_offset = ClassTable::StateOffsetFor(cid); |
| 2579 ASSERT(temp_reg != kNoRegister); | 2580 ASSERT(temp_reg != kNoRegister); |
| 2580 LoadIsolate(temp_reg); | 2581 LoadIsolate(temp_reg); |
| 2581 intptr_t table_offset = | 2582 intptr_t table_offset = |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 void Assembler::UpdateAllocationStatsWithSize(intptr_t cid, | 2620 void Assembler::UpdateAllocationStatsWithSize(intptr_t cid, |
| 2620 intptr_t size_in_bytes, | 2621 intptr_t size_in_bytes, |
| 2621 Register temp_reg, | 2622 Register temp_reg, |
| 2622 Heap::Space space) { | 2623 Heap::Space space) { |
| 2623 ASSERT(cid > 0); | 2624 ASSERT(cid > 0); |
| 2624 ASSERT(cid < kNumPredefinedCids); | 2625 ASSERT(cid < kNumPredefinedCids); |
| 2625 UpdateAllocationStats(cid, temp_reg, space); | 2626 UpdateAllocationStats(cid, temp_reg, space); |
| 2626 intptr_t size_offset = ClassTable::SizeOffsetFor(cid, space == Heap::kNew); | 2627 intptr_t size_offset = ClassTable::SizeOffsetFor(cid, space == Heap::kNew); |
| 2627 addl(Address(temp_reg, size_offset), Immediate(size_in_bytes)); | 2628 addl(Address(temp_reg, size_offset), Immediate(size_in_bytes)); |
| 2628 } | 2629 } |
| 2630 #endif // !PRODUCT |
| 2629 | 2631 |
| 2630 | 2632 |
| 2631 void Assembler::TryAllocate(const Class& cls, | 2633 void Assembler::TryAllocate(const Class& cls, |
| 2632 Label* failure, | 2634 Label* failure, |
| 2633 bool near_jump, | 2635 bool near_jump, |
| 2634 Register instance_reg, | 2636 Register instance_reg, |
| 2635 Register temp_reg) { | 2637 Register temp_reg) { |
| 2636 ASSERT(failure != NULL); | 2638 ASSERT(failure != NULL); |
| 2637 ASSERT(temp_reg != kNoRegister); | 2639 ASSERT(temp_reg != kNoRegister); |
| 2638 if (FLAG_inline_alloc) { | 2640 if (FLAG_inline_alloc) { |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3007 | 3009 |
| 3008 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3010 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3009 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3011 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 3010 return xmm_reg_names[reg]; | 3012 return xmm_reg_names[reg]; |
| 3011 } | 3013 } |
| 3012 | 3014 |
| 3013 | 3015 |
| 3014 } // namespace dart | 3016 } // namespace dart |
| 3015 | 3017 |
| 3016 #endif // defined TARGET_ARCH_IA32 | 3018 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |