| 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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 // Forward declarations. | 13 // Forward declarations. |
| 14 class Code; | 14 class Code; |
| 15 class Isolate; | 15 class Isolate; |
| 16 class ObjectPointerVisitor; | 16 class ObjectPointerVisitor; |
| 17 class RawCode; | 17 class RawCode; |
| 18 | 18 |
| 19 | 19 |
| 20 // List of stubs created in the VM isolate, these stubs are shared by different | 20 // List of stubs created in the VM isolate, these stubs are shared by different |
| 21 // isolates running in this dart process. | 21 // isolates running in this dart process. |
| 22 #define VM_STUB_CODE_LIST(V) \ | 22 #define VM_STUB_CODE_LIST(V) \ |
| 23 V(PrintStopMessage) \ | 23 V(PrintStopMessage) \ |
| 24 V(CallToRuntime) \ | 24 V(CallToRuntime) \ |
| 25 V(LazyCompile) \ |
| 25 V(CallBootstrapCFunction) \ | 26 V(CallBootstrapCFunction) \ |
| 26 V(CallNativeCFunction) \ | 27 V(CallNativeCFunction) \ |
| 27 V(AllocateArray) \ | 28 V(AllocateArray) \ |
| 28 V(CallNoSuchMethodFunction) \ | 29 V(CallNoSuchMethodFunction) \ |
| 29 V(InstanceFunctionLookup) \ | 30 V(InstanceFunctionLookup) \ |
| 30 V(CallStaticFunction) \ | 31 V(CallStaticFunction) \ |
| 31 V(CallClosureFunction) \ | 32 V(CallClosureFunction) \ |
| 32 V(FixCallersTarget) \ | 33 V(FixCallersTarget) \ |
| 33 V(Deoptimize) \ | 34 V(Deoptimize) \ |
| 34 V(DeoptimizeLazy) \ | 35 V(DeoptimizeLazy) \ |
| 35 V(BreakpointRuntime) \ | 36 V(BreakpointRuntime) \ |
| 36 V(DebugStepCheck) \ | 37 V(DebugStepCheck) \ |
| 37 V(Subtype1TestCache) \ | 38 V(Subtype1TestCache) \ |
| 38 V(Subtype2TestCache) \ | 39 V(Subtype2TestCache) \ |
| 39 V(Subtype3TestCache) \ | 40 V(Subtype3TestCache) \ |
| 40 V(GetStackPointer) \ | 41 V(GetStackPointer) \ |
| 41 V(JumpToExceptionHandler) \ | 42 V(JumpToExceptionHandler) \ |
| 42 V(UnoptimizedIdenticalWithNumberCheck) \ | 43 V(UnoptimizedIdenticalWithNumberCheck) \ |
| 43 V(OptimizedIdenticalWithNumberCheck) \ | 44 V(OptimizedIdenticalWithNumberCheck) \ |
| 44 V(CompileFunctionRuntimeCall) \ | |
| 45 | 45 |
| 46 // Is it permitted for the stubs above to refer to Object::null(), which is | 46 // Is it permitted for the stubs above to refer to Object::null(), which is |
| 47 // allocated in the VM isolate and shared across all isolates. | 47 // allocated in the VM isolate and shared across all isolates. |
| 48 // However, in cases where a simple GC-safe placeholder is needed on the stack, | 48 // However, in cases where a simple GC-safe placeholder is needed on the stack, |
| 49 // using Smi 0 instead of Object::null() is slightly more efficient, since a Smi | 49 // using Smi 0 instead of Object::null() is slightly more efficient, since a Smi |
| 50 // does not require relocation. | 50 // does not require relocation. |
| 51 | 51 |
| 52 // List of stubs created per isolate, these stubs could potentially contain | 52 // List of stubs created per isolate, these stubs could potentially contain |
| 53 // embedded objects and hence cannot be shared across isolates. | 53 // embedded objects and hence cannot be shared across isolates. |
| 54 #define STUB_CODE_LIST(V) \ | 54 #define STUB_CODE_LIST(V) \ |
| (...skipping 14 matching lines...) Expand all Loading... |
| 69 | 69 |
| 70 // class StubEntry is used to describe stub methods generated in dart to | 70 // class StubEntry is used to describe stub methods generated in dart to |
| 71 // abstract out common code executed from generated dart code. | 71 // abstract out common code executed from generated dart code. |
| 72 class StubEntry { | 72 class StubEntry { |
| 73 public: | 73 public: |
| 74 StubEntry(const char* name, const Code& code); | 74 StubEntry(const char* name, const Code& code); |
| 75 ~StubEntry() {} | 75 ~StubEntry() {} |
| 76 | 76 |
| 77 const ExternalLabel& label() const { return label_; } | 77 const ExternalLabel& label() const { return label_; } |
| 78 uword EntryPoint() const { return entry_point_; } | 78 uword EntryPoint() const { return entry_point_; } |
| 79 RawCode* code() const { return code_; } |
| 79 intptr_t Size() const { return size_; } | 80 intptr_t Size() const { return size_; } |
| 80 | 81 |
| 81 // Visit all object pointers. | 82 // Visit all object pointers. |
| 82 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 83 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 83 | 84 |
| 84 private: | 85 private: |
| 85 RawCode* code_; | 86 RawCode* code_; |
| 86 uword entry_point_; | 87 uword entry_point_; |
| 87 intptr_t size_; | 88 intptr_t size_; |
| 88 ExternalLabel label_; | 89 ExternalLabel label_; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 Assembler* assembler, | 204 Assembler* assembler, |
| 204 const Register left, | 205 const Register left, |
| 205 const Register right, | 206 const Register right, |
| 206 const Register temp1 = kNoRegister, | 207 const Register temp1 = kNoRegister, |
| 207 const Register temp2 = kNoRegister); | 208 const Register temp2 = kNoRegister); |
| 208 }; | 209 }; |
| 209 | 210 |
| 210 } // namespace dart | 211 } // namespace dart |
| 211 | 212 |
| 212 #endif // VM_STUB_CODE_H_ | 213 #endif // VM_STUB_CODE_H_ |
| OLD | NEW |