Chromium Code Reviews| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 name##_entry_ = new StubEntry(code); | 51 name##_entry_ = new StubEntry(code); |
| 52 | 52 |
| 53 | 53 |
| 54 void StubCode::InitOnce() { | 54 void StubCode::InitOnce() { |
| 55 // Generate all the stubs. | 55 // Generate all the stubs. |
| 56 Code& code = Code::Handle(); | 56 Code& code = Code::Handle(); |
| 57 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); | 57 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); |
| 58 } | 58 } |
| 59 | 59 |
| 60 | 60 |
| 61 void StubCode::GenerateFor(Isolate* init) { | 61 void StubCode::GenerateBootstrapStubsFor(Isolate* init) { |
| 62 // Generate all the stubs. | 62 // Generate initial stubs. |
| 63 Code& code = Code::Handle(); | 63 Code& code = Code::Handle(); |
| 64 STUB_CODE_LIST(STUB_CODE_GENERATE); | 64 BOOTSTRAP_STUB_CODE_LIST(STUB_CODE_GENERATE); |
| 65 } | |
| 66 | |
| 67 | |
| 68 void StubCode::GenerateOtherStubsFor(Isolate* init) { | |
|
Vyacheslav Egorov (Google)
2014/10/22 15:45:45
I find the name "other-stubs" confusing.
| |
| 69 // Generate all the other stubs. | |
| 70 Code& code = Code::Handle(); | |
| 71 OTHER_STUB_CODE_LIST(STUB_CODE_GENERATE); | |
| 65 } | 72 } |
| 66 | 73 |
| 67 #undef STUB_CODE_GENERATE | 74 #undef STUB_CODE_GENERATE |
| 68 | 75 |
| 69 | 76 |
| 70 void StubCode::Init(Isolate* isolate) { | 77 void StubCode::InitBootstrapStubs(Isolate* isolate) { |
| 71 StubCode* stubs = new StubCode(isolate); | 78 StubCode* stubs = new StubCode(isolate); |
| 72 isolate->set_stub_code(stubs); | 79 isolate->set_stub_code(stubs); |
| 73 stubs->GenerateFor(isolate); | 80 stubs->GenerateBootstrapStubsFor(isolate); |
| 81 } | |
| 82 | |
| 83 | |
| 84 void StubCode::Init(Isolate* isolate) { | |
| 85 StubCode* stubs = isolate->stub_code(); | |
| 86 stubs->GenerateOtherStubsFor(isolate); | |
| 74 } | 87 } |
| 75 | 88 |
| 76 | 89 |
| 77 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 90 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 78 // The current isolate is needed as part of the macro. | 91 // The current isolate is needed as part of the macro. |
| 79 Isolate* isolate = Isolate::Current(); | 92 Isolate* isolate = Isolate::Current(); |
| 80 StubCode* stubs = isolate->stub_code(); | 93 StubCode* stubs = isolate->stub_code(); |
| 81 if (stubs == NULL) return; | 94 if (stubs == NULL) return; |
| 82 StubEntry* entry; | 95 StubEntry* entry; |
| 83 #define STUB_CODE_VISIT_OBJECT_POINTER(name) \ | 96 #define STUB_CODE_VISIT_OBJECT_POINTER(name) \ |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 Isolate* isolate = Isolate::Current(); | 209 Isolate* isolate = Isolate::Current(); |
| 197 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 210 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
| 198 STUB_CODE_LIST(STUB_CODE_TESTER); | 211 STUB_CODE_LIST(STUB_CODE_TESTER); |
| 199 } | 212 } |
| 200 #undef VM_STUB_CODE_TESTER | 213 #undef VM_STUB_CODE_TESTER |
| 201 #undef STUB_CODE_TESTER | 214 #undef STUB_CODE_TESTER |
| 202 return NULL; | 215 return NULL; |
| 203 } | 216 } |
| 204 | 217 |
| 205 } // namespace dart | 218 } // namespace dart |
| OLD | NEW |