| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 #define RETURN_IF_EMPTY_HANDLE_VALUE(isolate, call, value) \ | 113 #define RETURN_IF_EMPTY_HANDLE_VALUE(isolate, call, value) \ |
| 114 if (call.is_null()) { \ | 114 if (call.is_null()) { \ |
| 115 ASSERT(isolate->has_pending_exception()); \ | 115 ASSERT(isolate->has_pending_exception()); \ |
| 116 return value; \ | 116 return value; \ |
| 117 } | 117 } |
| 118 | 118 |
| 119 #define RETURN_IF_EMPTY_HANDLE(isolate, call) \ | 119 #define RETURN_IF_EMPTY_HANDLE(isolate, call) \ |
| 120 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, call, Failure::Exception()) | 120 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, call, Failure::Exception()) |
| 121 | 121 |
| 122 #define ISOLATE_ADDRESS_LIST(C) \ | 122 #define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ |
| 123 C(handler_address) \ | 123 C(Handler, handler) \ |
| 124 C(c_entry_fp_address) \ | 124 C(CEntryFP, c_entry_fp) \ |
| 125 C(context_address) \ | 125 C(Context, context) \ |
| 126 C(pending_exception_address) \ | 126 C(PendingException, pending_exception) \ |
| 127 C(external_caught_exception_address) \ | 127 C(ExternalCaughtException, external_caught_exception) \ |
| 128 C(js_entry_sp_address) | 128 C(JSEntrySP, js_entry_sp) |
| 129 | 129 |
| 130 | 130 |
| 131 // Platform-independent, reliable thread identifier. | 131 // Platform-independent, reliable thread identifier. |
| 132 class ThreadId { | 132 class ThreadId { |
| 133 public: | 133 public: |
| 134 // Creates an invalid ThreadId. | 134 // Creates an invalid ThreadId. |
| 135 ThreadId() : id_(kInvalidId) {} | 135 ThreadId() : id_(kInvalidId) {} |
| 136 | 136 |
| 137 // Returns ThreadId for current thread. | 137 // Returns ThreadId for current thread. |
| 138 static ThreadId Current() { return ThreadId(GetCurrentThreadId()); } | 138 static ThreadId Current() { return ThreadId(GetCurrentThreadId()); } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 | 416 |
| 417 friend class Isolate; | 417 friend class Isolate; |
| 418 friend class ThreadDataTable; | 418 friend class ThreadDataTable; |
| 419 friend class EntryStackItem; | 419 friend class EntryStackItem; |
| 420 | 420 |
| 421 DISALLOW_COPY_AND_ASSIGN(PerIsolateThreadData); | 421 DISALLOW_COPY_AND_ASSIGN(PerIsolateThreadData); |
| 422 }; | 422 }; |
| 423 | 423 |
| 424 | 424 |
| 425 enum AddressId { | 425 enum AddressId { |
| 426 #define C(name) k_##name, | 426 #define DECLARE_ENUM(CamelName, hacker_name) k##CamelName##Address, |
| 427 ISOLATE_ADDRESS_LIST(C) | 427 FOR_EACH_ISOLATE_ADDRESS_NAME(DECLARE_ENUM) |
| 428 #undef C | 428 #undef C |
| 429 k_isolate_address_count | 429 kIsolateAddressCount |
| 430 }; | 430 }; |
| 431 | 431 |
| 432 // Returns the PerIsolateThreadData for the current thread (or NULL if one is | 432 // Returns the PerIsolateThreadData for the current thread (or NULL if one is |
| 433 // not currently set). | 433 // not currently set). |
| 434 static PerIsolateThreadData* CurrentPerIsolateThreadData() { | 434 static PerIsolateThreadData* CurrentPerIsolateThreadData() { |
| 435 return reinterpret_cast<PerIsolateThreadData*>( | 435 return reinterpret_cast<PerIsolateThreadData*>( |
| 436 Thread::GetThreadLocal(per_isolate_thread_data_key_)); | 436 Thread::GetThreadLocal(per_isolate_thread_data_key_)); |
| 437 } | 437 } |
| 438 | 438 |
| 439 // Returns the isolate inside which the current thread is running. | 439 // Returns the isolate inside which the current thread is running. |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 void FillCache(); | 1090 void FillCache(); |
| 1091 | 1091 |
| 1092 void PropagatePendingExceptionToExternalTryCatch(); | 1092 void PropagatePendingExceptionToExternalTryCatch(); |
| 1093 | 1093 |
| 1094 void InitializeDebugger(); | 1094 void InitializeDebugger(); |
| 1095 | 1095 |
| 1096 int stack_trace_nesting_level_; | 1096 int stack_trace_nesting_level_; |
| 1097 StringStream* incomplete_message_; | 1097 StringStream* incomplete_message_; |
| 1098 // The preallocated memory thread singleton. | 1098 // The preallocated memory thread singleton. |
| 1099 PreallocatedMemoryThread* preallocated_memory_thread_; | 1099 PreallocatedMemoryThread* preallocated_memory_thread_; |
| 1100 Address isolate_addresses_[k_isolate_address_count + 1]; // NOLINT | 1100 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT |
| 1101 NoAllocationStringAllocator* preallocated_message_space_; | 1101 NoAllocationStringAllocator* preallocated_message_space_; |
| 1102 | 1102 |
| 1103 Bootstrapper* bootstrapper_; | 1103 Bootstrapper* bootstrapper_; |
| 1104 RuntimeProfiler* runtime_profiler_; | 1104 RuntimeProfiler* runtime_profiler_; |
| 1105 CompilationCache* compilation_cache_; | 1105 CompilationCache* compilation_cache_; |
| 1106 Counters* counters_; | 1106 Counters* counters_; |
| 1107 CodeRange* code_range_; | 1107 CodeRange* code_range_; |
| 1108 Mutex* break_access_; | 1108 Mutex* break_access_; |
| 1109 Atomic32 debugger_initialized_; | 1109 Atomic32 debugger_initialized_; |
| 1110 Mutex* debugger_access_; | 1110 Mutex* debugger_access_; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 | 1353 |
| 1354 // Mark the global context with out of memory. | 1354 // Mark the global context with out of memory. |
| 1355 inline void Context::mark_out_of_memory() { | 1355 inline void Context::mark_out_of_memory() { |
| 1356 global_context()->set_out_of_memory(HEAP->true_value()); | 1356 global_context()->set_out_of_memory(HEAP->true_value()); |
| 1357 } | 1357 } |
| 1358 | 1358 |
| 1359 | 1359 |
| 1360 } } // namespace v8::internal | 1360 } } // namespace v8::internal |
| 1361 | 1361 |
| 1362 #endif // V8_ISOLATE_H_ | 1362 #endif // V8_ISOLATE_H_ |
| OLD | NEW |