| 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| 11 #include "vm/instructions.h" | 11 #include "vm/instructions.h" |
| 12 #include "vm/stub_code.h" | 12 #include "vm/stub_code.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 RawInstance* ActivationFrame::GetInstanceCallReceiver( | |
| 17 intptr_t num_actual_args) { | |
| 18 ASSERT(num_actual_args > 0); // At minimum we have a receiver on the stack. | |
| 19 // Stack pointer points to last argument that was pushed on the stack. | |
| 20 uword receiver_addr = sp() + ((num_actual_args - 1) * kWordSize); | |
| 21 return reinterpret_cast<RawInstance*>( | |
| 22 *reinterpret_cast<uword*>(receiver_addr)); | |
| 23 } | |
| 24 | |
| 25 | |
| 26 RawObject* ActivationFrame::GetClosureObject(intptr_t num_actual_args) { | |
| 27 // At a minimum we have the closure object on the stack. | |
| 28 ASSERT(num_actual_args > 0); | |
| 29 // Stack pointer points to last argument that was pushed on the stack. | |
| 30 uword closure_addr = sp() + ((num_actual_args - 1) * kWordSize); | |
| 31 return reinterpret_cast<RawObject*>( | |
| 32 *reinterpret_cast<uword*>(closure_addr)); | |
| 33 } | |
| 34 | |
| 35 | |
| 36 uword CodeBreakpoint::OrigStubAddress() const { | 16 uword CodeBreakpoint::OrigStubAddress() const { |
| 37 return saved_value_; | 17 return saved_value_; |
| 38 } | 18 } |
| 39 | 19 |
| 40 | 20 |
| 41 void CodeBreakpoint::PatchCode() { | 21 void CodeBreakpoint::PatchCode() { |
| 42 ASSERT(!is_enabled_); | 22 ASSERT(!is_enabled_); |
| 43 const Code& code = Code::Handle(code_); | 23 const Code& code = Code::Handle(code_); |
| 44 const Instructions& instrs = Instructions::Handle(code.instructions()); | 24 const Instructions& instrs = Instructions::Handle(code.instructions()); |
| 45 Isolate* isolate = Isolate::Current(); | 25 Isolate* isolate = Isolate::Current(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 default: | 70 default: |
| 91 UNREACHABLE(); | 71 UNREACHABLE(); |
| 92 } | 72 } |
| 93 } | 73 } |
| 94 is_enabled_ = false; | 74 is_enabled_ = false; |
| 95 } | 75 } |
| 96 | 76 |
| 97 } // namespace dart | 77 } // namespace dart |
| 98 | 78 |
| 99 #endif // defined TARGET_ARCH_ARM | 79 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |