| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/debugger.h" | 8 #include "vm/debugger.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // At a minimum we have the closure object on the stack. | 29 // At a minimum we have the closure object on the stack. |
| 30 ASSERT(num_actual_args > 0); | 30 ASSERT(num_actual_args > 0); |
| 31 // Stack pointer points to last argument that was pushed on the stack. | 31 // Stack pointer points to last argument that was pushed on the stack. |
| 32 uword closure_addr = sp() + ((num_actual_args - 1) * kWordSize); | 32 uword closure_addr = sp() + ((num_actual_args - 1) * kWordSize); |
| 33 return reinterpret_cast<RawObject*>( | 33 return reinterpret_cast<RawObject*>( |
| 34 *reinterpret_cast<uword*>(closure_addr)); | 34 *reinterpret_cast<uword*>(closure_addr)); |
| 35 } | 35 } |
| 36 | 36 |
| 37 | 37 |
| 38 uword CodeBreakpoint::OrigStubAddress() const { | 38 uword CodeBreakpoint::OrigStubAddress() const { |
| 39 const Code& code = | 39 const Code& code = Code::Handle(code_); |
| 40 Code::Handle(Function::Handle(function_).unoptimized_code()); | |
| 41 const Array& object_pool = Array::Handle(code.ObjectPool()); | 40 const Array& object_pool = Array::Handle(code.ObjectPool()); |
| 42 uword offset = saved_value_ + kHeapObjectTag; | 41 uword offset = saved_value_ + kHeapObjectTag; |
| 43 ASSERT((offset % kWordSize) == 0); | 42 ASSERT((offset % kWordSize) == 0); |
| 44 const intptr_t index = (offset - Array::data_offset()) / kWordSize; | 43 const intptr_t index = (offset - Array::data_offset()) / kWordSize; |
| 45 const uword stub_address = reinterpret_cast<uword>(object_pool.At(index)); | 44 const uword stub_address = reinterpret_cast<uword>(object_pool.At(index)); |
| 46 ASSERT(stub_address % kWordSize == 0); | 45 ASSERT(stub_address % kWordSize == 0); |
| 47 return stub_address; | 46 return stub_address; |
| 48 } | 47 } |
| 49 | 48 |
| 50 | 49 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 default: | 85 default: |
| 87 UNREACHABLE(); | 86 UNREACHABLE(); |
| 88 } | 87 } |
| 89 is_enabled_ = false; | 88 is_enabled_ = false; |
| 90 } | 89 } |
| 91 | 90 |
| 92 | 91 |
| 93 } // namespace dart | 92 } // namespace dart |
| 94 | 93 |
| 95 #endif // defined TARGET_ARCH_X64 | 94 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |