| 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_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/heap.h" | 10 #include "vm/heap.h" |
| 11 #include "vm/locations.h" |
| 11 #include "vm/memory_region.h" | 12 #include "vm/memory_region.h" |
| 12 #include "vm/runtime_entry.h" | 13 #include "vm/runtime_entry.h" |
| 13 #include "vm/stack_frame.h" | 14 #include "vm/stack_frame.h" |
| 14 #include "vm/stub_code.h" | 15 #include "vm/stub_code.h" |
| 15 | 16 |
| 16 namespace dart { | 17 namespace dart { |
| 17 | 18 |
| 18 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); | 19 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); |
| 19 DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available"); | 20 DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available"); |
| 20 DECLARE_FLAG(bool, inline_alloc); | 21 DECLARE_FLAG(bool, inline_alloc); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 public: | 77 public: |
| 77 void Process(const MemoryRegion& region, int position) { | 78 void Process(const MemoryRegion& region, int position) { |
| 78 // Direct calls are relative to the following instruction on x86. | 79 // Direct calls are relative to the following instruction on x86. |
| 79 int32_t pointer = region.Load<int32_t>(position); | 80 int32_t pointer = region.Load<int32_t>(position); |
| 80 int32_t delta = region.start() + position + sizeof(int32_t); | 81 int32_t delta = region.start() + position + sizeof(int32_t); |
| 81 region.Store<int32_t>(position, pointer - delta); | 82 region.Store<int32_t>(position, pointer - delta); |
| 82 } | 83 } |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 | 86 |
| 87 Address Address::StackSlotAddress(const Location& stack_slot) { |
| 88 ASSERT(stack_slot.IsStackSlot() || stack_slot.IsDoubleStackSlot() || |
| 89 stack_slot.IsQuadStackSlot()); |
| 90 return Address(EBP, stack_slot.ToStackSlotOffset()); |
| 91 } |
| 92 |
| 93 |
| 86 void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) { | 94 void Assembler::InitializeMemoryWithBreakpoints(uword data, int length) { |
| 87 memset(reinterpret_cast<void*>(data), Instr::kBreakPointInstruction, length); | 95 memset(reinterpret_cast<void*>(data), Instr::kBreakPointInstruction, length); |
| 88 } | 96 } |
| 89 | 97 |
| 90 | 98 |
| 91 void Assembler::call(Register reg) { | 99 void Assembler::call(Register reg) { |
| 92 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 100 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 93 EmitUint8(0xFF); | 101 EmitUint8(0xFF); |
| 94 EmitRegisterOperand(2, reg); | 102 EmitRegisterOperand(2, reg); |
| 95 } | 103 } |
| (...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2403 | 2411 |
| 2404 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 2412 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 2405 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2413 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 2406 return xmm_reg_names[reg]; | 2414 return xmm_reg_names[reg]; |
| 2407 } | 2415 } |
| 2408 | 2416 |
| 2409 | 2417 |
| 2410 } // namespace dart | 2418 } // namespace dart |
| 2411 | 2419 |
| 2412 #endif // defined TARGET_ARCH_IA32 | 2420 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |