| 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 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 49 // Generate all the stubs. | 49 // Generate all the stubs. |
| 50 Code& code = Code::Handle(); | 50 Code& code = Code::Handle(); |
| 51 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); | 51 VM_STUB_CODE_LIST(STUB_CODE_GENERATE); |
| 52 #else | 52 #else |
| 53 UNREACHABLE(); | 53 UNREACHABLE(); |
| 54 #endif // DART_PRECOMPILED | 54 #endif // DART_PRECOMPILED_RUNTIME |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 #undef STUB_CODE_GENERATE | 58 #undef STUB_CODE_GENERATE |
| 59 | 59 |
| 60 | 60 |
| 61 void StubCode::ReadFrom(SnapshotReader* reader) { | 61 void StubCode::ReadFrom(SnapshotReader* reader) { |
| 62 #define READ_STUB(name) \ | 62 #define READ_STUB(name) \ |
| 63 *(reader->CodeHandle()) ^= reader->ReadObject(); \ | 63 *(reader->CodeHandle()) ^= reader->ReadObject(); \ |
| 64 name##_entry_ = new StubEntry(*(reader->CodeHandle())); | 64 name##_entry_ = new StubEntry(*(reader->CodeHandle())); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 if ((name##_entry() != NULL) && \ | 177 if ((name##_entry() != NULL) && \ |
| 178 (entry_point == name##_entry()->EntryPoint())) { \ | 178 (entry_point == name##_entry()->EntryPoint())) { \ |
| 179 return ""#name; \ | 179 return ""#name; \ |
| 180 } | 180 } |
| 181 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER); | 181 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER); |
| 182 #undef VM_STUB_CODE_TESTER | 182 #undef VM_STUB_CODE_TESTER |
| 183 return NULL; | 183 return NULL; |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace dart | 186 } // namespace dart |
| OLD | NEW |