OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 } | 1043 } |
1044 | 1044 |
1045 StateTag current_vm_state() { | 1045 StateTag current_vm_state() { |
1046 return thread_local_top_.current_vm_state_; | 1046 return thread_local_top_.current_vm_state_; |
1047 } | 1047 } |
1048 | 1048 |
1049 void set_current_vm_state(StateTag state) { | 1049 void set_current_vm_state(StateTag state) { |
1050 thread_local_top_.current_vm_state_ = state; | 1050 thread_local_top_.current_vm_state_ = state; |
1051 } | 1051 } |
1052 | 1052 |
1053 void SetData(uint32_t slot, void* data) { | 1053 void SetData(void* data) { embedder_data_ = data; } |
1054 ASSERT(slot < Internals::kNumIsolateDataSlots); | 1054 void* GetData() { return embedder_data_; } |
1055 embedder_data_[slot] = data; | |
1056 } | |
1057 void* GetData(uint32_t slot) { | |
1058 ASSERT(slot < Internals::kNumIsolateDataSlots); | |
1059 return embedder_data_[slot]; | |
1060 } | |
1061 | 1055 |
1062 LookupResult* top_lookup_result() { | 1056 LookupResult* top_lookup_result() { |
1063 return thread_local_top_.top_lookup_result_; | 1057 return thread_local_top_.top_lookup_result_; |
1064 } | 1058 } |
1065 void SetTopLookupResult(LookupResult* top) { | 1059 void SetTopLookupResult(LookupResult* top) { |
1066 thread_local_top_.top_lookup_result_ = top; | 1060 thread_local_top_.top_lookup_result_ = top; |
1067 } | 1061 } |
1068 | 1062 |
1069 bool IsDead() { return has_fatal_error_; } | 1063 bool IsDead() { return has_fatal_error_; } |
1070 void SignalFatalError() { has_fatal_error_ = true; } | 1064 void SignalFatalError() { has_fatal_error_ = true; } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 | 1158 |
1165 enum State { | 1159 enum State { |
1166 UNINITIALIZED, // Some components may not have been allocated. | 1160 UNINITIALIZED, // Some components may not have been allocated. |
1167 INITIALIZED // All components are fully initialized. | 1161 INITIALIZED // All components are fully initialized. |
1168 }; | 1162 }; |
1169 | 1163 |
1170 // These fields are accessed through the API, offsets must be kept in sync | 1164 // These fields are accessed through the API, offsets must be kept in sync |
1171 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1165 // with v8::internal::Internals (in include/v8.h) constants. This is also |
1172 // verified in Isolate::Init() using runtime checks. | 1166 // verified in Isolate::Init() using runtime checks. |
1173 State state_; // Will be padded to kApiPointerSize. | 1167 State state_; // Will be padded to kApiPointerSize. |
1174 void* embedder_data_[Internals::kNumIsolateDataSlots]; | 1168 void* embedder_data_; |
1175 Heap heap_; | 1169 Heap heap_; |
1176 | 1170 |
1177 // The per-process lock should be acquired before the ThreadDataTable is | 1171 // The per-process lock should be acquired before the ThreadDataTable is |
1178 // modified. | 1172 // modified. |
1179 class ThreadDataTable { | 1173 class ThreadDataTable { |
1180 public: | 1174 public: |
1181 ThreadDataTable(); | 1175 ThreadDataTable(); |
1182 ~ThreadDataTable(); | 1176 ~ThreadDataTable(); |
1183 | 1177 |
1184 PerIsolateThreadData* Lookup(Isolate* isolate, ThreadId thread_id); | 1178 PerIsolateThreadData* Lookup(Isolate* isolate, ThreadId thread_id); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 } | 1587 } |
1594 | 1588 |
1595 EmbeddedVector<char, 128> filename_; | 1589 EmbeddedVector<char, 128> filename_; |
1596 FILE* file_; | 1590 FILE* file_; |
1597 int scope_depth_; | 1591 int scope_depth_; |
1598 }; | 1592 }; |
1599 | 1593 |
1600 } } // namespace v8::internal | 1594 } } // namespace v8::internal |
1601 | 1595 |
1602 #endif // V8_ISOLATE_H_ | 1596 #endif // V8_ISOLATE_H_ |
OLD | NEW |