| 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 "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/disassembler.h" | 9 #include "vm/disassembler.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #undef STUB_CODE_VISIT_OBJECT_POINTER | 94 #undef STUB_CODE_VISIT_OBJECT_POINTER |
| 95 } | 95 } |
| 96 | 96 |
| 97 | 97 |
| 98 bool StubCode::InInvocationStub(uword pc) { | 98 bool StubCode::InInvocationStub(uword pc) { |
| 99 return ((pc >= InvokeDartCodeEntryPoint()) && | 99 return ((pc >= InvokeDartCodeEntryPoint()) && |
| 100 (pc < (InvokeDartCodeEntryPoint() + InvokeDartCodeSize()))); | 100 (pc < (InvokeDartCodeEntryPoint() + InvokeDartCodeSize()))); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 bool StubCode::InStubCallToRuntimeStubCode(uword pc) { | |
| 105 if ((pc >= StubCallToRuntimeEntryPoint()) && | |
| 106 (pc < (StubCallToRuntimeEntryPoint() + StubCallToRuntimeSize()))) { | |
| 107 return true; | |
| 108 } | |
| 109 return false; | |
| 110 } | |
| 111 | |
| 112 | |
| 113 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { | 104 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { |
| 114 Code& stub = Code::Handle(cls.allocation_stub()); | 105 Code& stub = Code::Handle(cls.allocation_stub()); |
| 115 if (stub.IsNull()) { | 106 if (stub.IsNull()) { |
| 116 Assembler assembler; | 107 Assembler assembler; |
| 117 const char* name = cls.ToCString(); | 108 const char* name = cls.ToCString(); |
| 118 StubCode::GenerateAllocationStubForClass(&assembler, cls); | 109 StubCode::GenerateAllocationStubForClass(&assembler, cls); |
| 119 stub ^= Code::FinalizeCode(name, &assembler); | 110 stub ^= Code::FinalizeCode(name, &assembler); |
| 120 cls.set_allocation_stub(stub); | 111 cls.set_allocation_stub(stub); |
| 121 if (FLAG_disassemble_stubs) { | 112 if (FLAG_disassemble_stubs) { |
| 122 OS::Print("Code for allocation stub '%s': {\n", name); | 113 OS::Print("Code for allocation stub '%s': {\n", name); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 VM_STUB_CODE_LIST(STUB_CODE_TESTER); | 163 VM_STUB_CODE_LIST(STUB_CODE_TESTER); |
| 173 Isolate* isolate = Isolate::Current(); | 164 Isolate* isolate = Isolate::Current(); |
| 174 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 165 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
| 175 STUB_CODE_LIST(STUB_CODE_TESTER); | 166 STUB_CODE_LIST(STUB_CODE_TESTER); |
| 176 } | 167 } |
| 177 #undef STUB_CODE_TESTER | 168 #undef STUB_CODE_TESTER |
| 178 return NULL; | 169 return NULL; |
| 179 } | 170 } |
| 180 | 171 |
| 181 } // namespace dart | 172 } // namespace dart |
| OLD | NEW |