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::GenerateStubsFor(Isolate* init) { |
| 69 // Generate all the other stubs. |
| 70 Code& code = Code::Handle(); |
| 71 REST_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 isolate->stub_code()->GenerateStubsFor(isolate); |
74 } | 86 } |
75 | 87 |
76 | 88 |
77 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 89 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
78 // The current isolate is needed as part of the macro. | 90 // The current isolate is needed as part of the macro. |
79 Isolate* isolate = Isolate::Current(); | 91 Isolate* isolate = Isolate::Current(); |
80 StubCode* stubs = isolate->stub_code(); | 92 StubCode* stubs = isolate->stub_code(); |
81 if (stubs == NULL) return; | 93 if (stubs == NULL) return; |
82 StubEntry* entry; | 94 StubEntry* entry; |
83 #define STUB_CODE_VISIT_OBJECT_POINTER(name) \ | 95 #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(); | 208 Isolate* isolate = Isolate::Current(); |
197 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 209 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
198 STUB_CODE_LIST(STUB_CODE_TESTER); | 210 STUB_CODE_LIST(STUB_CODE_TESTER); |
199 } | 211 } |
200 #undef VM_STUB_CODE_TESTER | 212 #undef VM_STUB_CODE_TESTER |
201 #undef STUB_CODE_TESTER | 213 #undef STUB_CODE_TESTER |
202 return NULL; | 214 return NULL; |
203 } | 215 } |
204 | 216 |
205 } // namespace dart | 217 } // namespace dart |
OLD | NEW |