| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 | 97 |
| 98 bool StubCode::InInvocationStubForIsolate(Isolate* isolate, uword pc) { | 98 bool StubCode::InInvocationStubForIsolate(Isolate* isolate, uword pc) { |
| 99 StubCode* stub_code = isolate->stub_code(); | 99 StubCode* stub_code = isolate->stub_code(); |
| 100 uword entry = stub_code->InvokeDartCodeEntryPoint(); | 100 uword entry = stub_code->InvokeDartCodeEntryPoint(); |
| 101 uword size = stub_code->InvokeDartCodeSize(); | 101 uword size = stub_code->InvokeDartCodeSize(); |
| 102 return (pc >= entry) && (pc < (entry + size)); | 102 return (pc >= entry) && (pc < (entry + size)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 | 105 |
| 106 bool StubCode::InJumpToExceptionHandlerStub(uword pc) { |
| 107 uword entry = StubCode::JumpToExceptionHandlerEntryPoint(); |
| 108 uword size = StubCode::JumpToExceptionHandlerSize(); |
| 109 return (pc >= entry) && (pc < (entry + size)); |
| 110 } |
| 111 |
| 112 |
| 106 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { | 113 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { |
| 107 Isolate* isolate = Isolate::Current(); | 114 Isolate* isolate = Isolate::Current(); |
| 108 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); | 115 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); |
| 109 ASSERT(error.IsNull()); | 116 ASSERT(error.IsNull()); |
| 110 Code& stub = Code::Handle(isolate, cls.allocation_stub()); | 117 Code& stub = Code::Handle(isolate, cls.allocation_stub()); |
| 111 if (stub.IsNull()) { | 118 if (stub.IsNull()) { |
| 112 Assembler assembler; | 119 Assembler assembler; |
| 113 const char* name = cls.ToCString(); | 120 const char* name = cls.ToCString(); |
| 114 StubCode::GenerateAllocationStubForClass(&assembler, cls); | 121 StubCode::GenerateAllocationStubForClass(&assembler, cls); |
| 115 stub ^= Code::FinalizeCode(name, &assembler); | 122 stub ^= Code::FinalizeCode(name, &assembler); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 Isolate* isolate = Isolate::Current(); | 163 Isolate* isolate = Isolate::Current(); |
| 157 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 164 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
| 158 STUB_CODE_LIST(STUB_CODE_TESTER); | 165 STUB_CODE_LIST(STUB_CODE_TESTER); |
| 159 } | 166 } |
| 160 #undef VM_STUB_CODE_TESTER | 167 #undef VM_STUB_CODE_TESTER |
| 161 #undef STUB_CODE_TESTER | 168 #undef STUB_CODE_TESTER |
| 162 return NULL; | 169 return NULL; |
| 163 } | 170 } |
| 164 | 171 |
| 165 } // namespace dart | 172 } // namespace dart |
| OLD | NEW |