OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_STUB_CODE_H_ | 5 #ifndef VM_STUB_CODE_H_ |
6 #define VM_STUB_CODE_H_ | 6 #define VM_STUB_CODE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 // However, in cases where a simple GC-safe placeholder is needed on the stack, | 38 // However, in cases where a simple GC-safe placeholder is needed on the stack, |
39 // using Smi 0 instead of Object::null() is slightly more efficient, since a Smi | 39 // using Smi 0 instead of Object::null() is slightly more efficient, since a Smi |
40 // does not require relocation. | 40 // does not require relocation. |
41 | 41 |
42 // List of stubs created per isolate, these stubs could potentially contain | 42 // List of stubs created per isolate, these stubs could potentially contain |
43 // embedded objects and hence cannot be shared across isolates. | 43 // embedded objects and hence cannot be shared across isolates. |
44 #define STUB_CODE_LIST(V) \ | 44 #define STUB_CODE_LIST(V) \ |
45 V(InvokeDartCode) \ | 45 V(InvokeDartCode) \ |
46 V(AllocateContext) \ | 46 V(AllocateContext) \ |
47 V(InlineCache) \ | 47 V(InlineCache) \ |
48 V(BreakpointStatic) \ | |
siva
2011/11/30 00:00:47
Does breakpoint static stub need to be generated o
hausner
2011/11/30 01:17:05
Done.
| |
49 V(BreakpointDynamic) \ | |
48 | 50 |
49 | 51 |
50 // class StubEntry is used to describe stub methods generated in dart to | 52 // class StubEntry is used to describe stub methods generated in dart to |
51 // abstract out common code executed from generated dart code. | 53 // abstract out common code executed from generated dart code. |
52 class StubEntry { | 54 class StubEntry { |
53 public: | 55 public: |
54 StubEntry(const char* name, const Code& code); | 56 StubEntry(const char* name, const Code& code); |
55 ~StubEntry() {} | 57 ~StubEntry() {} |
56 | 58 |
57 const ExternalLabel& label() const { return label_; } | 59 const ExternalLabel& label() const { return label_; } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 return name##_entry()->Size(); \ | 120 return name##_entry()->Size(); \ |
119 } | 121 } |
120 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); | 122 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); |
121 #undef STUB_CODE_ACCESSOR | 123 #undef STUB_CODE_ACCESSOR |
122 | 124 |
123 // Define the per-isolate stub code accessors. | 125 // Define the per-isolate stub code accessors. |
124 #define STUB_CODE_ACCESSOR(name) \ | 126 #define STUB_CODE_ACCESSOR(name) \ |
125 static StubEntry* name##_entry() { \ | 127 static StubEntry* name##_entry() { \ |
126 return Isolate::Current()->stub_code()->name##_entry_; \ | 128 return Isolate::Current()->stub_code()->name##_entry_; \ |
127 } \ | 129 } \ |
130 static const ExternalLabel& name##Label() { \ | |
131 return name##_entry()->label(); \ | |
132 } \ | |
128 static uword name##EntryPoint() { \ | 133 static uword name##EntryPoint() { \ |
129 return name##_entry()->EntryPoint(); \ | 134 return name##_entry()->EntryPoint(); \ |
130 } \ | 135 } \ |
131 static intptr_t name##Size() { \ | 136 static intptr_t name##Size() { \ |
132 return name##_entry()->Size(); \ | 137 return name##_entry()->Size(); \ |
133 } | 138 } |
134 STUB_CODE_LIST(STUB_CODE_ACCESSOR); | 139 STUB_CODE_LIST(STUB_CODE_ACCESSOR); |
135 #undef STUB_CODE_ACCESSOR | 140 #undef STUB_CODE_ACCESSOR |
136 | 141 |
137 static RawCode* GetAllocationStubForClass(const Class& cls); | 142 static RawCode* GetAllocationStubForClass(const Class& cls); |
(...skipping 27 matching lines...) Expand all Loading... | |
165 | 170 |
166 static void GenerateAllocationStubForClass(Assembler* assembler, | 171 static void GenerateAllocationStubForClass(Assembler* assembler, |
167 const Class& cls); | 172 const Class& cls); |
168 static void GenerateAllocationStubForClosure(Assembler* assembler, | 173 static void GenerateAllocationStubForClosure(Assembler* assembler, |
169 const Function& func); | 174 const Function& func); |
170 }; | 175 }; |
171 | 176 |
172 } // namespace dart | 177 } // namespace dart |
173 | 178 |
174 #endif // VM_STUB_CODE_H_ | 179 #endif // VM_STUB_CODE_H_ |
OLD | NEW |