| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/stub_code.h" | 5 #include "vm/stub_code.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/disassembler.h" | 10 #include "vm/disassembler.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 #undef STUB_CODE_VISIT_OBJECT_POINTER | 89 #undef STUB_CODE_VISIT_OBJECT_POINTER |
| 90 } | 90 } |
| 91 | 91 |
| 92 | 92 |
| 93 bool StubCode::InInvocationStub(uword pc) { | 93 bool StubCode::InInvocationStub(uword pc) { |
| 94 return InInvocationStubForIsolate(Isolate::Current(), pc); | 94 return InInvocationStubForIsolate(Isolate::Current(), pc); |
| 95 } | 95 } |
| 96 | 96 |
| 97 | 97 |
| 98 bool StubCode::InInvocationStubForIsolate(Isolate* isolate, uword pc) { | 98 bool StubCode::InInvocationStubForIsolate(Isolate* isolate, uword pc) { |
| 99 uword entry = isolate->stub_code()->InvokeDartCodeEntryPoint(); | 99 StubEntry* invoke_dart_entry = isolate->stub_code()->InvokeDartCode_entry_; |
| 100 uword size = isolate->stub_code()->InvokeDartCodeSize(); | 100 uword entry = invoke_dart_entry->EntryPoint(); |
| 101 uword size = invoke_dart_entry->Size(); |
| 101 return (pc >= entry) && (pc < (entry + size)); | 102 return (pc >= entry) && (pc < (entry + size)); |
| 102 } | 103 } |
| 103 | 104 |
| 104 | 105 |
| 105 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { | 106 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { |
| 106 Isolate* isolate = Isolate::Current(); | 107 Isolate* isolate = Isolate::Current(); |
| 107 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); | 108 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); |
| 108 ASSERT(error.IsNull()); | 109 ASSERT(error.IsNull()); |
| 109 Code& stub = Code::Handle(isolate, cls.allocation_stub()); | 110 Code& stub = Code::Handle(isolate, cls.allocation_stub()); |
| 110 if (stub.IsNull()) { | 111 if (stub.IsNull()) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 VM_STUB_CODE_LIST(STUB_CODE_TESTER); | 150 VM_STUB_CODE_LIST(STUB_CODE_TESTER); |
| 150 Isolate* isolate = Isolate::Current(); | 151 Isolate* isolate = Isolate::Current(); |
| 151 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 152 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
| 152 STUB_CODE_LIST(STUB_CODE_TESTER); | 153 STUB_CODE_LIST(STUB_CODE_TESTER); |
| 153 } | 154 } |
| 154 #undef STUB_CODE_TESTER | 155 #undef STUB_CODE_TESTER |
| 155 return NULL; | 156 return NULL; |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace dart | 159 } // namespace dart |
| OLD | NEW |