Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: runtime/vm/stub_code.cc

Issue 1229283002: VM: Share some stub code between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698