diff options
author | John Reck <jreck@google.com> | 2010-11-02 12:39:01 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-11-02 12:40:32 -0700 |
commit | 5913587db4c6bab03d97bfe44b06289fd6d7270d (patch) | |
tree | 96ab490452936f90e6e51a0ef86baee781c7dc46 /src/handles.h | |
parent | f87a203d89e1bbb6708282e0b64dbd13d59b723d (diff) | |
download | android_external_v8-5913587db4c6bab03d97bfe44b06289fd6d7270d.tar.gz android_external_v8-5913587db4c6bab03d97bfe44b06289fd6d7270d.tar.bz2 android_external_v8-5913587db4c6bab03d97bfe44b06289fd6d7270d.zip |
Update V8 to r5716 as required by WebKit r70949
Change-Id: I0d5cd05bb0427af33e5c9f6efdc209366a32bde3
Diffstat (limited to 'src/handles.h')
-rw-r--r-- | src/handles.h | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/src/handles.h b/src/handles.h index 69170ff2..2e18ab34 100644 --- a/src/handles.h +++ b/src/handles.h @@ -107,12 +107,20 @@ class Handle { // for which the handle scope has been deleted is undefined. class HandleScope { public: - HandleScope() : previous_(current_) { - current_.extensions = 0; + HandleScope() : prev_next_(current_.next), prev_limit_(current_.limit) { + current_.level++; } ~HandleScope() { - Leave(&previous_); + current_.next = prev_next_; + current_.level--; + if (current_.limit != prev_limit_) { + current_.limit = prev_limit_; + DeleteExtensions(); + } +#ifdef DEBUG + ZapRange(prev_next_, prev_limit_); +#endif } // Counts the number of allocated handles. @@ -136,9 +144,9 @@ class HandleScope { // Deallocates any extensions used by the current scope. static void DeleteExtensions(); - static Address current_extensions_address(); static Address current_next_address(); static Address current_limit_address(); + static Address current_level_address(); private: // Prevent heap allocation or illegal handle scopes. @@ -148,27 +156,8 @@ class HandleScope { void operator delete(void* size_t); static v8::ImplementationUtilities::HandleScopeData current_; - const v8::ImplementationUtilities::HandleScopeData previous_; - - // Pushes a fresh handle scope to be used when allocating new handles. - static void Enter( - v8::ImplementationUtilities::HandleScopeData* previous) { - *previous = current_; - current_.extensions = 0; - } - - // Re-establishes the previous scope state. Should be called only - // once, and only for the current scope. - static void Leave( - const v8::ImplementationUtilities::HandleScopeData* previous) { - if (current_.extensions > 0) { - DeleteExtensions(); - } - current_ = *previous; -#ifdef DEBUG - ZapRange(current_.next, current_.limit); -#endif - } + Object** const prev_next_; + Object** const prev_limit_; // Extend the handle scope making room for more handles. static internal::Object** Extend(); @@ -193,6 +182,10 @@ void NormalizeProperties(Handle<JSObject> object, void NormalizeElements(Handle<JSObject> object); void TransformToFastProperties(Handle<JSObject> object, int unused_property_fields); +void NumberDictionarySet(Handle<NumberDictionary> dictionary, + uint32_t index, + Handle<Object> value, + PropertyDetails details); // Flattens a string. void FlattenString(Handle<String> str); @@ -358,7 +351,7 @@ class NoHandleAllocation BASE_EMBEDDED { inline NoHandleAllocation(); inline ~NoHandleAllocation(); private: - int extensions_; + int level_; #endif }; |