| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_THREAD_H_ | 5 #ifndef VM_THREAD_H_ |
| 6 #define VM_THREAD_H_ | 6 #define VM_THREAD_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 V(GrowableObjectArray) \ | 63 V(GrowableObjectArray) \ |
| 64 V(Instance) \ | 64 V(Instance) \ |
| 65 V(Library) \ | 65 V(Library) \ |
| 66 V(Object) \ | 66 V(Object) \ |
| 67 V(PcDescriptors) \ | 67 V(PcDescriptors) \ |
| 68 V(String) \ | 68 V(String) \ |
| 69 V(TypeArguments) \ | 69 V(TypeArguments) \ |
| 70 V(TypeParameter) \ | 70 V(TypeParameter) \ |
| 71 | 71 |
| 72 | 72 |
| 73 // List of VM-global objects/addresses cached in each Thread object. | 73 #if defined(TARGET_ARCH_DBC) |
| 74 #define CACHED_VM_OBJECTS_LIST(V) \ | 74 #define CACHED_VM_STUBS_LIST(V) |
| 75 V(RawObject*, object_null_, Object::null(), NULL) \ | 75 #else |
| 76 V(RawBool*, bool_true_, Object::bool_true().raw(), NULL) \ | 76 #define CACHED_VM_STUBS_LIST(V) \ |
| 77 V(RawBool*, bool_false_, Object::bool_false().raw(), NULL) \ | |
| 78 V(RawCode*, update_store_buffer_code_, \ | 77 V(RawCode*, update_store_buffer_code_, \ |
| 79 StubCode::UpdateStoreBuffer_entry()->code(), NULL) \ | 78 StubCode::UpdateStoreBuffer_entry()->code(), NULL) \ |
| 80 V(RawCode*, fix_callers_target_code_, \ | 79 V(RawCode*, fix_callers_target_code_, \ |
| 81 StubCode::FixCallersTarget_entry()->code(), NULL) \ | 80 StubCode::FixCallersTarget_entry()->code(), NULL) \ |
| 82 V(RawCode*, fix_allocation_stub_code_, \ | 81 V(RawCode*, fix_allocation_stub_code_, \ |
| 83 StubCode::FixAllocationStubTarget_entry()->code(), NULL) \ | 82 StubCode::FixAllocationStubTarget_entry()->code(), NULL) \ |
| 84 V(RawCode*, invoke_dart_code_stub_, \ | 83 V(RawCode*, invoke_dart_code_stub_, \ |
| 85 StubCode::InvokeDartCode_entry()->code(), NULL) \ | 84 StubCode::InvokeDartCode_entry()->code(), NULL) \ |
| 86 V(RawCode*, call_to_runtime_stub_, \ | 85 V(RawCode*, call_to_runtime_stub_, \ |
| 87 StubCode::CallToRuntime_entry()->code(), NULL) \ | 86 StubCode::CallToRuntime_entry()->code(), NULL) \ |
| 88 | 87 |
| 89 #define CACHED_ADDRESSES_LIST(V) \ | 88 #endif |
| 89 |
| 90 // List of VM-global objects/addresses cached in each Thread object. |
| 91 #define CACHED_VM_OBJECTS_LIST(V) \ |
| 92 V(RawObject*, object_null_, Object::null(), NULL) \ |
| 93 V(RawBool*, bool_true_, Object::bool_true().raw(), NULL) \ |
| 94 V(RawBool*, bool_false_, Object::bool_false().raw(), NULL) \ |
| 95 CACHED_VM_STUBS_LIST(V) \ |
| 96 |
| 97 #if defined(TARGET_ARCH_DBC) |
| 98 #define CACHED_VM_STUBS_ADDRESSES_LIST(V) |
| 99 #else |
| 100 #define CACHED_VM_STUBS_ADDRESSES_LIST(V) \ |
| 90 V(uword, update_store_buffer_entry_point_, \ | 101 V(uword, update_store_buffer_entry_point_, \ |
| 91 StubCode::UpdateStoreBuffer_entry()->EntryPoint(), 0) \ | 102 StubCode::UpdateStoreBuffer_entry()->EntryPoint(), 0) \ |
| 92 V(uword, call_to_runtime_entry_point_, \ | 103 V(uword, call_to_runtime_entry_point_, \ |
| 93 StubCode::CallToRuntime_entry()->EntryPoint(), 0) \ | 104 StubCode::CallToRuntime_entry()->EntryPoint(), 0) \ |
| 105 |
| 106 #endif |
| 107 |
| 108 #define CACHED_ADDRESSES_LIST(V) \ |
| 109 CACHED_VM_STUBS_ADDRESSES_LIST(V) \ |
| 94 V(uword, native_call_wrapper_entry_point_, \ | 110 V(uword, native_call_wrapper_entry_point_, \ |
| 95 NativeEntry::NativeCallWrapperEntry(), 0) \ | 111 NativeEntry::NativeCallWrapperEntry(), 0) \ |
| 96 V(RawString**, predefined_symbols_address_, \ | 112 V(RawString**, predefined_symbols_address_, \ |
| 97 Symbols::PredefinedAddress(), NULL) \ | 113 Symbols::PredefinedAddress(), NULL) \ |
| 98 V(uword, double_negate_address_, \ | 114 V(uword, double_negate_address_, \ |
| 99 reinterpret_cast<uword>(&double_negate_constant), 0) \ | 115 reinterpret_cast<uword>(&double_negate_constant), 0) \ |
| 100 V(uword, double_abs_address_, \ | 116 V(uword, double_abs_address_, \ |
| 101 reinterpret_cast<uword>(&double_abs_constant), 0) \ | 117 reinterpret_cast<uword>(&double_abs_constant), 0) \ |
| 102 V(uword, float_not_address_, \ | 118 V(uword, float_not_address_, \ |
| 103 reinterpret_cast<uword>(&float_not_constant), 0) \ | 119 reinterpret_cast<uword>(&float_not_constant), 0) \ |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 uword stack_limit_address() const { | 184 uword stack_limit_address() const { |
| 169 return reinterpret_cast<uword>(&stack_limit_); | 185 return reinterpret_cast<uword>(&stack_limit_); |
| 170 } | 186 } |
| 171 static intptr_t stack_limit_offset() { | 187 static intptr_t stack_limit_offset() { |
| 172 return OFFSET_OF(Thread, stack_limit_); | 188 return OFFSET_OF(Thread, stack_limit_); |
| 173 } | 189 } |
| 174 | 190 |
| 175 // The true stack limit for this isolate. | 191 // The true stack limit for this isolate. |
| 176 uword saved_stack_limit() const { return saved_stack_limit_; } | 192 uword saved_stack_limit() const { return saved_stack_limit_; } |
| 177 | 193 |
| 194 #if defined(TARGET_ARCH_DBC) |
| 195 // Access to the current stack limit for DBC interpreter. |
| 196 uword stack_limit() const { |
| 197 return stack_limit_; |
| 198 } |
| 199 #endif |
| 200 |
| 178 // Stack overflow flags | 201 // Stack overflow flags |
| 179 enum { | 202 enum { |
| 180 kOsrRequest = 0x1, // Current stack overflow caused by OSR request. | 203 kOsrRequest = 0x1, // Current stack overflow caused by OSR request. |
| 181 }; | 204 }; |
| 182 | 205 |
| 183 uword stack_overflow_flags_address() const { | 206 uword stack_overflow_flags_address() const { |
| 184 return reinterpret_cast<uword>(&stack_overflow_flags_); | 207 return reinterpret_cast<uword>(&stack_overflow_flags_); |
| 185 } | 208 } |
| 186 static intptr_t stack_overflow_flags_offset() { | 209 static intptr_t stack_overflow_flags_offset() { |
| 187 return OFFSET_OF(Thread, stack_overflow_flags_); | 210 return OFFSET_OF(Thread, stack_overflow_flags_); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 // Disable thread interrupts. | 755 // Disable thread interrupts. |
| 733 class DisableThreadInterruptsScope : public StackResource { | 756 class DisableThreadInterruptsScope : public StackResource { |
| 734 public: | 757 public: |
| 735 explicit DisableThreadInterruptsScope(Thread* thread); | 758 explicit DisableThreadInterruptsScope(Thread* thread); |
| 736 ~DisableThreadInterruptsScope(); | 759 ~DisableThreadInterruptsScope(); |
| 737 }; | 760 }; |
| 738 | 761 |
| 739 } // namespace dart | 762 } // namespace dart |
| 740 | 763 |
| 741 #endif // VM_THREAD_H_ | 764 #endif // VM_THREAD_H_ |
| OLD | NEW |