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 27 matching lines...) Expand all Loading... | |
| 38 visitor->VisitPointer(reinterpret_cast<RawObject**>(&code_)); | 38 visitor->VisitPointer(reinterpret_cast<RawObject**>(&code_)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 | 41 |
| 42 #define STUB_CODE_GENERATE(name) \ | 42 #define STUB_CODE_GENERATE(name) \ |
| 43 code ^= Generate("_stub_"#name, StubCode::Generate##name##Stub); \ | 43 code ^= Generate("_stub_"#name, StubCode::Generate##name##Stub); \ |
| 44 name##_entry_ = new StubEntry(code); | 44 name##_entry_ = new StubEntry(code); |
| 45 | 45 |
| 46 | 46 |
| 47 void StubCode::InitOnce() { | 47 void StubCode::InitOnce() { |
| 48 #if !defined(DART_PRECOMPILED) | |
| 48 // Generate all the stubs. | 49 // Generate all the stubs. |
| 49 Code& code = Code::Handle(); | 50 Code& code = Code::Handle(); |
| 50 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); | 51 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); |
| 52 #endif // DART_PRECOMPILED | |
|
rmacnak
2016/01/05 18:47:03
else UNREACHABLE
Florian Schneider
2016/01/06 10:38:53
Done.
| |
| 51 } | 53 } |
| 52 | 54 |
| 53 | 55 |
| 54 #undef STUB_CODE_GENERATE | 56 #undef STUB_CODE_GENERATE |
| 55 | 57 |
| 56 | 58 |
| 57 void StubCode::ReadFrom(SnapshotReader* reader) { | 59 void StubCode::ReadFrom(SnapshotReader* reader) { |
| 58 #define READ_STUB(name) \ | 60 #define READ_STUB(name) \ |
| 59 *(reader->CodeHandle()) ^= reader->ReadObject(); \ | 61 *(reader->CodeHandle()) ^= reader->ReadObject(); \ |
| 60 name##_entry_ = new StubEntry(*(reader->CodeHandle())); | 62 name##_entry_ = new StubEntry(*(reader->CodeHandle())); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 if ((name##_entry() != NULL) && \ | 175 if ((name##_entry() != NULL) && \ |
| 174 (entry_point == name##_entry()->EntryPoint())) { \ | 176 (entry_point == name##_entry()->EntryPoint())) { \ |
| 175 return ""#name; \ | 177 return ""#name; \ |
| 176 } | 178 } |
| 177 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER); | 179 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER); |
| 178 #undef VM_STUB_CODE_TESTER | 180 #undef VM_STUB_CODE_TESTER |
| 179 return NULL; | 181 return NULL; |
| 180 } | 182 } |
| 181 | 183 |
| 182 } // namespace dart | 184 } // namespace dart |
| OLD | NEW |