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 "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/disassembler.h" | 9 #include "vm/disassembler.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #undef STUB_CODE_DELETER | 43 #undef STUB_CODE_DELETER |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 #define STUB_CODE_GENERATE(name) \ | 47 #define STUB_CODE_GENERATE(name) \ |
48 code ^= Generate("_stub_"#name, StubCode::Generate##name##Stub); \ | 48 code ^= Generate("_stub_"#name, StubCode::Generate##name##Stub); \ |
49 name##_entry_ = new StubEntry("_stub_"#name, code); | 49 name##_entry_ = new StubEntry("_stub_"#name, code); |
50 | 50 |
51 | 51 |
52 void StubCode::InitOnce() { | 52 void StubCode::InitOnce() { |
53 // TODO(regis): Re-enable this after we are able to generate mips code. | |
54 #if defined(TARGET_ARCH_IA32) || \ | |
55 defined(TARGET_ARCH_X64) || \ | |
56 defined(TARGET_ARCH_ARM) | |
57 // Generate all the stubs. | 53 // Generate all the stubs. |
58 Code& code = Code::Handle(); | 54 Code& code = Code::Handle(); |
59 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); | 55 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); |
60 #endif | |
61 } | 56 } |
62 | 57 |
63 | 58 |
64 void StubCode::GenerateFor(Isolate* init) { | 59 void StubCode::GenerateFor(Isolate* init) { |
65 // TODO(regis): Re-enable this after we are able to generate mips code. | |
66 #if defined(TARGET_ARCH_IA32) || \ | |
67 defined(TARGET_ARCH_X64) || \ | |
68 defined(TARGET_ARCH_ARM) | |
69 // Generate all the stubs. | 60 // Generate all the stubs. |
70 Code& code = Code::Handle(); | 61 Code& code = Code::Handle(); |
71 STUB_CODE_LIST(STUB_CODE_GENERATE); | 62 STUB_CODE_LIST(STUB_CODE_GENERATE); |
72 #endif | |
73 } | 63 } |
74 | 64 |
75 #undef STUB_CODE_GENERATE | 65 #undef STUB_CODE_GENERATE |
76 | 66 |
77 | 67 |
78 void StubCode::Init(Isolate* isolate) { | 68 void StubCode::Init(Isolate* isolate) { |
79 StubCode* stubs = new StubCode(); | 69 StubCode* stubs = new StubCode(); |
80 isolate->set_stub_code(stubs); | 70 isolate->set_stub_code(stubs); |
81 stubs->GenerateFor(isolate); | 71 stubs->GenerateFor(isolate); |
82 } | 72 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 VM_STUB_CODE_LIST(STUB_CODE_TESTER); | 157 VM_STUB_CODE_LIST(STUB_CODE_TESTER); |
168 Isolate* isolate = Isolate::Current(); | 158 Isolate* isolate = Isolate::Current(); |
169 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { | 159 if ((isolate != NULL) && (isolate->stub_code() != NULL)) { |
170 STUB_CODE_LIST(STUB_CODE_TESTER); | 160 STUB_CODE_LIST(STUB_CODE_TESTER); |
171 } | 161 } |
172 #undef STUB_CODE_TESTER | 162 #undef STUB_CODE_TESTER |
173 return NULL; | 163 return NULL; |
174 } | 164 } |
175 | 165 |
176 } // namespace dart | 166 } // namespace dart |
OLD | NEW |