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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 Address get_address_from_id(AddressId id); | 540 Address get_address_from_id(AddressId id); |
541 | 541 |
542 // Access to top context (where the current function object was created). | 542 // Access to top context (where the current function object was created). |
543 Context* context() { return thread_local_top_.context_; } | 543 Context* context() { return thread_local_top_.context_; } |
544 void set_context(Context* context) { | 544 void set_context(Context* context) { |
545 ASSERT(context == NULL || context->IsContext()); | 545 ASSERT(context == NULL || context->IsContext()); |
546 thread_local_top_.context_ = context; | 546 thread_local_top_.context_ = context; |
547 } | 547 } |
548 Context** context_address() { return &thread_local_top_.context_; } | 548 Context** context_address() { return &thread_local_top_.context_; } |
549 | 549 |
550 SaveContext* save_context() { return thread_local_top_.save_context_; } | 550 SaveContext* save_context() {return thread_local_top_.save_context_; } |
551 void set_save_context(SaveContext* save) { | 551 void set_save_context(SaveContext* save) { |
552 thread_local_top_.save_context_ = save; | 552 thread_local_top_.save_context_ = save; |
553 } | 553 } |
554 | 554 |
555 // Access to current thread id. | 555 // Access to current thread id. |
556 ThreadId thread_id() { return thread_local_top_.thread_id_; } | 556 ThreadId thread_id() { return thread_local_top_.thread_id_; } |
557 void set_thread_id(ThreadId id) { thread_local_top_.thread_id_ = id; } | 557 void set_thread_id(ThreadId id) { thread_local_top_.thread_id_ = id; } |
558 | 558 |
559 // Interface to pending exception. | 559 // Interface to pending exception. |
560 MaybeObject* pending_exception() { | 560 MaybeObject* pending_exception() { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 thread_local_top_.top_lookup_result_ = top; | 1043 thread_local_top_.top_lookup_result_ = top; |
1044 } | 1044 } |
1045 | 1045 |
1046 bool context_exit_happened() { | 1046 bool context_exit_happened() { |
1047 return context_exit_happened_; | 1047 return context_exit_happened_; |
1048 } | 1048 } |
1049 void set_context_exit_happened(bool context_exit_happened) { | 1049 void set_context_exit_happened(bool context_exit_happened) { |
1050 context_exit_happened_ = context_exit_happened; | 1050 context_exit_happened_ = context_exit_happened; |
1051 } | 1051 } |
1052 | 1052 |
1053 bool initialized_from_snapshot() { return initialized_from_snapshot_; } | |
1054 | |
1055 double time_millis_since_init() { | 1053 double time_millis_since_init() { |
1056 return OS::TimeCurrentMillis() - time_millis_at_init_; | 1054 return OS::TimeCurrentMillis() - time_millis_at_init_; |
1057 } | 1055 } |
1058 | 1056 |
1059 DateCache* date_cache() { | 1057 DateCache* date_cache() { |
1060 return date_cache_; | 1058 return date_cache_; |
1061 } | 1059 } |
1062 | 1060 |
1063 void set_date_cache(DateCache* date_cache) { | 1061 void set_date_cache(DateCache* date_cache) { |
1064 if (date_cache != date_cache_) { | 1062 if (date_cache != date_cache_) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 } | 1102 } |
1105 void set_callback_table(CallbackTable* callback_table) { | 1103 void set_callback_table(CallbackTable* callback_table) { |
1106 callback_table_ = callback_table; | 1104 callback_table_ = callback_table; |
1107 } | 1105 } |
1108 | 1106 |
1109 int id() const { return static_cast<int>(id_); } | 1107 int id() const { return static_cast<int>(id_); } |
1110 | 1108 |
1111 HStatistics* GetHStatistics(); | 1109 HStatistics* GetHStatistics(); |
1112 HTracer* GetHTracer(); | 1110 HTracer* GetHTracer(); |
1113 | 1111 |
1114 FunctionEntryHook function_entry_hook() { return function_entry_hook_; } | |
1115 void set_function_entry_hook(FunctionEntryHook function_entry_hook) { | |
1116 function_entry_hook_ = function_entry_hook; | |
1117 } | |
1118 | |
1119 private: | 1112 private: |
1120 Isolate(); | 1113 Isolate(); |
1121 | 1114 |
1122 friend struct GlobalState; | 1115 friend struct GlobalState; |
1123 friend struct InitializeGlobalState; | 1116 friend struct InitializeGlobalState; |
1124 | 1117 |
1125 enum State { | 1118 enum State { |
1126 UNINITIALIZED, // Some components may not have been allocated. | 1119 UNINITIALIZED, // Some components may not have been allocated. |
1127 INITIALIZED // All components are fully initialized. | 1120 INITIALIZED // All components are fully initialized. |
1128 }; | 1121 }; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 regexp_macro_assembler_canonicalize_; | 1281 regexp_macro_assembler_canonicalize_; |
1289 RegExpStack* regexp_stack_; | 1282 RegExpStack* regexp_stack_; |
1290 DateCache* date_cache_; | 1283 DateCache* date_cache_; |
1291 unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_; | 1284 unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize_mapping_; |
1292 CodeStubInterfaceDescriptor* code_stub_interface_descriptors_; | 1285 CodeStubInterfaceDescriptor* code_stub_interface_descriptors_; |
1293 | 1286 |
1294 // The garbage collector should be a little more aggressive when it knows | 1287 // The garbage collector should be a little more aggressive when it knows |
1295 // that a context was recently exited. | 1288 // that a context was recently exited. |
1296 bool context_exit_happened_; | 1289 bool context_exit_happened_; |
1297 | 1290 |
1298 // True if this isolate was initialized from a snapshot. | |
1299 bool initialized_from_snapshot_; | |
1300 | |
1301 // Time stamp at initialization. | 1291 // Time stamp at initialization. |
1302 double time_millis_at_init_; | 1292 double time_millis_at_init_; |
1303 | 1293 |
1304 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ | 1294 #if defined(V8_TARGET_ARCH_ARM) && !defined(__arm__) || \ |
1305 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) | 1295 defined(V8_TARGET_ARCH_MIPS) && !defined(__mips__) |
1306 bool simulator_initialized_; | 1296 bool simulator_initialized_; |
1307 HashMap* simulator_i_cache_; | 1297 HashMap* simulator_i_cache_; |
1308 Redirection* simulator_redirection_; | 1298 Redirection* simulator_redirection_; |
1309 #endif | 1299 #endif |
1310 | 1300 |
1311 #ifdef DEBUG | 1301 #ifdef DEBUG |
1312 // A static array of histogram info for each type. | 1302 // A static array of histogram info for each type. |
1313 HistogramInfo heap_histograms_[LAST_TYPE + 1]; | 1303 HistogramInfo heap_histograms_[LAST_TYPE + 1]; |
1314 JSObject::SpillInformation js_spill_information_; | 1304 JSObject::SpillInformation js_spill_information_; |
1315 int code_kind_statistics_[Code::NUMBER_OF_KINDS]; | 1305 int code_kind_statistics_[Code::NUMBER_OF_KINDS]; |
1316 #endif | 1306 #endif |
1317 | 1307 |
1318 #ifdef ENABLE_DEBUGGER_SUPPORT | 1308 #ifdef ENABLE_DEBUGGER_SUPPORT |
1319 Debugger* debugger_; | 1309 Debugger* debugger_; |
1320 Debug* debug_; | 1310 Debug* debug_; |
1321 #endif | 1311 #endif |
1322 CpuProfiler* cpu_profiler_; | 1312 CpuProfiler* cpu_profiler_; |
1323 HeapProfiler* heap_profiler_; | 1313 HeapProfiler* heap_profiler_; |
1324 FunctionEntryHook function_entry_hook_; | |
1325 | 1314 |
1326 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \ | 1315 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \ |
1327 type name##_; | 1316 type name##_; |
1328 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) | 1317 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) |
1329 #undef GLOBAL_BACKING_STORE | 1318 #undef GLOBAL_BACKING_STORE |
1330 | 1319 |
1331 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \ | 1320 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \ |
1332 type name##_[length]; | 1321 type name##_[length]; |
1333 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE) | 1322 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE) |
1334 #undef GLOBAL_ARRAY_BACKING_STORE | 1323 #undef GLOBAL_ARRAY_BACKING_STORE |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 | 1487 |
1499 // Mark the native context with out of memory. | 1488 // Mark the native context with out of memory. |
1500 inline void Context::mark_out_of_memory() { | 1489 inline void Context::mark_out_of_memory() { |
1501 native_context()->set_out_of_memory(HEAP->true_value()); | 1490 native_context()->set_out_of_memory(HEAP->true_value()); |
1502 } | 1491 } |
1503 | 1492 |
1504 | 1493 |
1505 } } // namespace v8::internal | 1494 } } // namespace v8::internal |
1506 | 1495 |
1507 #endif // V8_ISOLATE_H_ | 1496 #endif // V8_ISOLATE_H_ |
OLD | NEW |