diff options
Diffstat (limited to 'src/3rdparty/v8/src/isolate.h')
-rw-r--r-- | src/3rdparty/v8/src/isolate.h | 91 |
1 files changed, 65 insertions, 26 deletions
diff --git a/src/3rdparty/v8/src/isolate.h b/src/3rdparty/v8/src/isolate.h index a865d99..889a3e1 100644 --- a/src/3rdparty/v8/src/isolate.h +++ b/src/3rdparty/v8/src/isolate.h @@ -41,6 +41,7 @@ #include "handles.h" #include "hashmap.h" #include "heap.h" +#include "optimizing-compiler-thread.h" #include "regexp-stack.h" #include "runtime-profiler.h" #include "runtime.h" @@ -310,19 +311,20 @@ class ThreadLocalTop BASE_EMBEDDED { #define ISOLATE_INIT_ARRAY_LIST(V) \ /* SerializerDeserializer state. */ \ - V(Object*, serialize_partial_snapshot_cache, kPartialSnapshotCacheCapacity) \ - V(int, jsregexp_static_offsets_vector, kJSRegexpStaticOffsetsVectorSize) \ + V(int32_t, jsregexp_static_offsets_vector, kJSRegexpStaticOffsetsVectorSize) \ V(int, bad_char_shift_table, kUC16AlphabetSize) \ V(int, good_suffix_shift_table, (kBMMaxShift + 1)) \ V(int, suffix_table, (kBMMaxShift + 1)) \ V(uint32_t, private_random_seed, 2) \ ISOLATE_INIT_DEBUG_ARRAY_LIST(V) -typedef List<HeapObject*, PreallocatedStorage> DebugObjectCache; +typedef List<HeapObject*, PreallocatedStorageAllocationPolicy> DebugObjectCache; #define ISOLATE_INIT_LIST(V) \ /* SerializerDeserializer state. */ \ V(int, serialize_partial_snapshot_cache_length, 0) \ + V(int, serialize_partial_snapshot_cache_capacity, 0) \ + V(Object**, serialize_partial_snapshot_cache, NULL) \ /* Assembler state. */ \ /* A previously allocated buffer of kMinimalBufferSize bytes, or NULL. */ \ V(byte*, assembler_spare_buffer, NULL) \ @@ -330,7 +332,7 @@ typedef List<HeapObject*, PreallocatedStorage> DebugObjectCache; V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, NULL) \ V(v8::Debug::MessageHandler, message_handler, NULL) \ /* To distinguish the function templates, so that we can find them in the */ \ - /* function cache of the global context. */ \ + /* function cache of the native context. */ \ V(int, next_serial_number, 0) \ V(ExternalReferenceRedirectorPointer*, external_reference_redirector, NULL) \ V(bool, always_allow_natives_syntax, false) \ @@ -355,6 +357,7 @@ typedef List<HeapObject*, PreallocatedStorage> DebugObjectCache; V(uint64_t, enabled_cpu_features, 0) \ V(CpuProfiler*, cpu_profiler, NULL) \ V(HeapProfiler*, heap_profiler, NULL) \ + V(bool, observer_delivery_pending, false) \ ISOLATE_DEBUGGER_INIT_LIST(V) class Isolate { @@ -530,6 +533,11 @@ class Isolate { thread_local_top_.save_context_ = save; } + // Access to the map of "new Object()". + Map* empty_object_map() { + return context()->native_context()->object_function()->map(); + } + // Access to current thread id. ThreadId thread_id() { return thread_local_top_.thread_id_; } void set_thread_id(ThreadId id) { thread_local_top_.thread_id_ = id; } @@ -581,6 +589,20 @@ class Isolate { MaybeObject** scheduled_exception_address() { return &thread_local_top_.scheduled_exception_; } + + Address pending_message_obj_address() { + return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_); + } + + Address has_pending_message_address() { + return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_); + } + + Address pending_message_script_address() { + return reinterpret_cast<Address>( + &thread_local_top_.pending_message_script_); + } + MaybeObject* scheduled_exception() { ASSERT(has_scheduled_exception()); return thread_local_top_.scheduled_exception_; @@ -599,6 +621,9 @@ class Isolate { (exception != heap()->termination_exception()); } + // Serializer. + void PushToPartialSnapshotCache(Object* obj); + // JS execution stack (see frames.h). static Address c_entry_fp(ThreadLocalTop* thread) { return thread->c_entry_fp_; @@ -623,8 +648,8 @@ class Isolate { // Returns the global object of the current context. It could be // a builtin object, or a JS global object. - Handle<GlobalObject> global() { - return Handle<GlobalObject>(context()->global()); + Handle<GlobalObject> global_object() { + return Handle<GlobalObject>(context()->global_object()); } // Returns the global proxy object of the current context. @@ -686,6 +711,10 @@ class Isolate { void PrintStack(StringStream* accumulator); void PrintStack(); Handle<String> StackTraceString(); + NO_INLINE(void PushStackTraceAndDie(unsigned int magic, + Object* object, + Map* map, + unsigned int magic2)); Handle<JSArray> CaptureCurrentStackTrace( int frame_limit, StackTrace::StackTraceOptions options); @@ -716,7 +745,7 @@ class Isolate { // Re-throw an exception. This involves no error reporting since // error reporting was handled when the exception was thrown // originally. - Failure* ReThrow(MaybeObject* exception, MessageLocation* location = NULL); + Failure* ReThrow(MaybeObject* exception); void ScheduleThrow(Object* exception); void ReportPendingMessages(); Failure* ThrowIllegalOperation(); @@ -748,12 +777,13 @@ class Isolate { void IterateThread(ThreadVisitor* v, char* t); - // Returns the current global context. + // Returns the current native and global context. + Handle<Context> native_context(); Handle<Context> global_context(); - // Returns the global context of the calling JavaScript code. That - // is, the global context of the top-most JavaScript frame. - Handle<Context> GetCallingGlobalContext(); + // Returns the native context of the calling JavaScript code. That + // is, the native context of the top-most JavaScript frame. + Handle<Context> GetCallingNativeContext(); void RegisterTryCatchHandler(v8::TryCatch* that); void UnregisterTryCatchHandler(v8::TryCatch* that); @@ -787,12 +817,12 @@ class Isolate { ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) #undef GLOBAL_ARRAY_ACCESSOR -#define GLOBAL_CONTEXT_FIELD_ACCESSOR(index, type, name) \ +#define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ Handle<type> name() { \ - return Handle<type>(context()->global_context()->name()); \ + return Handle<type>(context()->native_context()->name()); \ } - GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSOR) -#undef GLOBAL_CONTEXT_FIELD_ACCESSOR + NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) +#undef NATIVE_CONTEXT_FIELD_ACCESSOR Bootstrapper* bootstrapper() { return bootstrapper_; } Counters* counters() { @@ -844,7 +874,7 @@ class Isolate { ASSERT(handle_scope_implementer_); return handle_scope_implementer_; } - Zone* zone() { return &zone_; } + Zone* runtime_zone() { return &runtime_zone_; } UnicodeCache* unicode_cache() { return unicode_cache_; @@ -970,10 +1000,7 @@ class Isolate { Factory* factory() { return reinterpret_cast<Factory*>(this); } - // SerializerDeserializer state. - static const int kPartialSnapshotCacheCapacity = 1400; - - static const int kJSRegexpStaticOffsetsVectorSize = 50; + static const int kJSRegexpStaticOffsetsVectorSize = 128; Address external_callback() { return thread_local_top_.external_callback_; @@ -1040,6 +1067,14 @@ class Isolate { date_cache_ = date_cache; } + void IterateDeferredHandles(ObjectVisitor* visitor); + void LinkDeferredHandles(DeferredHandles* deferred_handles); + void UnlinkDeferredHandles(DeferredHandles* deferred_handles); + + OptimizingCompilerThread* optimizing_compiler_thread() { + return &optimizing_compiler_thread_; + } + private: Isolate(); @@ -1190,7 +1225,7 @@ class Isolate { v8::ImplementationUtilities::HandleScopeData handle_scope_data_; HandleScopeImplementer* handle_scope_implementer_; UnicodeCache* unicode_cache_; - Zone zone_; + Zone runtime_zone_; PreallocatedStorage in_use_list_; PreallocatedStorage free_list_; bool preallocated_storage_preallocated_; @@ -1263,8 +1298,13 @@ class Isolate { #undef ISOLATE_FIELD_OFFSET #endif + DeferredHandles* deferred_handles_head_; + OptimizingCompilerThread optimizing_compiler_thread_; + friend class ExecutionAccess; + friend class HandleScopeImplementer; friend class IsolateInitializer; + friend class OptimizingCompilerThread; friend class ThreadManager; friend class Simulator; friend class StackGuard; @@ -1402,19 +1442,18 @@ class PostponeInterruptsScope BASE_EMBEDDED { #define HEAP (v8::internal::Isolate::Current()->heap()) #define FACTORY (v8::internal::Isolate::Current()->factory()) #define ISOLATE (v8::internal::Isolate::Current()) -#define ZONE (v8::internal::Isolate::Current()->zone()) #define LOGGER (v8::internal::Isolate::Current()->logger()) -// Tells whether the global context is marked with out of memory. +// Tells whether the native context is marked with out of memory. inline bool Context::has_out_of_memory() { - return global_context()->out_of_memory()->IsTrue(); + return native_context()->out_of_memory()->IsTrue(); } -// Mark the global context with out of memory. +// Mark the native context with out of memory. inline void Context::mark_out_of_memory() { - global_context()->set_out_of_memory(HEAP->true_value()); + native_context()->set_out_of_memory(HEAP->true_value()); } |