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::GenerateBootstrapStubsFor(Isolate* init) { | |
62 // Generate initial stubs. | |
63 Code& code = Code::Handle(); | |
64 BOOTSTRAP_STUB_CODE_LIST(STUB_CODE_GENERATE); | |
65 } | |
66 | |
67 | |
68 void StubCode::GenerateStubsFor(Isolate* init) { | 61 void StubCode::GenerateStubsFor(Isolate* init) { |
69 // Generate all the other stubs. | 62 // Generate all the other stubs. |
70 Code& code = Code::Handle(); | 63 Code& code = Code::Handle(); |
71 REST_STUB_CODE_LIST(STUB_CODE_GENERATE); | 64 STUB_CODE_LIST(STUB_CODE_GENERATE); |
72 } | 65 } |
73 | 66 |
74 #undef STUB_CODE_GENERATE | 67 #undef STUB_CODE_GENERATE |
75 | 68 |
76 | 69 |
77 void StubCode::InitBootstrapStubs(Isolate* isolate) { | 70 void StubCode::Init(Isolate* isolate) { |
78 StubCode* stubs = new StubCode(isolate); | 71 StubCode* stubs = new StubCode(isolate); |
79 isolate->set_stub_code(stubs); | 72 isolate->set_stub_code(stubs); |
80 stubs->GenerateBootstrapStubsFor(isolate); | |
81 } | |
82 | |
83 | |
84 void StubCode::Init(Isolate* isolate) { | |
85 isolate->stub_code()->GenerateStubsFor(isolate); | 73 isolate->stub_code()->GenerateStubsFor(isolate); |
86 } | 74 } |
87 | 75 |
88 | 76 |
89 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 77 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
90 // The current isolate is needed as part of the macro. | 78 // The current isolate is needed as part of the macro. |
91 Isolate* isolate = Isolate::Current(); | 79 Isolate* isolate = Isolate::Current(); |
92 StubCode* stubs = isolate->stub_code(); | 80 StubCode* stubs = isolate->stub_code(); |
93 if (stubs == NULL) return; | 81 if (stubs == NULL) return; |
94 StubEntry* entry; | 82 StubEntry* entry; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 Isolate* isolate = Isolate::Current(); | 204 Isolate* isolate = Isolate::Current(); |
217 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 205 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
218 STUB_CODE_LIST(STUB_CODE_TESTER); | 206 STUB_CODE_LIST(STUB_CODE_TESTER); |
219 } | 207 } |
220 #undef VM_STUB_CODE_TESTER | 208 #undef VM_STUB_CODE_TESTER |
221 #undef STUB_CODE_TESTER | 209 #undef STUB_CODE_TESTER |
222 return NULL; | 210 return NULL; |
223 } | 211 } |
224 | 212 |
225 } // namespace dart | 213 } // namespace dart |
OLD | NEW |