diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-30 11:13:37 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-30 11:13:37 -0700 |
commit | 268bcbde7c62e7bc781c79c8b07ea067bd4b9b59 (patch) | |
tree | 968b595dd7df5e0ea7390b780c4883cbcb8ee8f3 /deps/v8/src/handles.cc | |
parent | ccdd979a690f5d0172f22b821f31672063629a31 (diff) | |
download | node-new-268bcbde7c62e7bc781c79c8b07ea067bd4b9b59.tar.gz |
Upgrade V8 to 2.5.2
Diffstat (limited to 'deps/v8/src/handles.cc')
-rw-r--r-- | deps/v8/src/handles.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/deps/v8/src/handles.cc b/deps/v8/src/handles.cc index 8fe29bb7a0..7a46bc3ea2 100644 --- a/deps/v8/src/handles.cc +++ b/deps/v8/src/handles.cc @@ -44,7 +44,7 @@ namespace internal { v8::ImplementationUtilities::HandleScopeData HandleScope::current_ = - { -1, NULL, NULL }; + { NULL, NULL, 0 }; int HandleScope::NumberOfHandles() { @@ -61,7 +61,7 @@ Object** HandleScope::Extend() { ASSERT(result == current_.limit); // Make sure there's at least one scope on the stack and that the // top of the scope stack isn't a barrier. - if (current_.extensions < 0) { + if (current_.level == 0) { Utils::ReportApiFailure("v8::HandleScope::CreateHandle()", "Cannot create a handle without a HandleScope"); return NULL; @@ -73,6 +73,7 @@ Object** HandleScope::Extend() { Object** limit = &impl->blocks()->last()[kHandleBlockSize]; if (current_.limit != limit) { current_.limit = limit; + ASSERT(limit - current_.next < kHandleBlockSize); } } @@ -84,7 +85,6 @@ Object** HandleScope::Extend() { // Add the extension to the global list of blocks, but count the // extension as part of the current scope. impl->blocks()->Add(result); - current_.extensions++; current_.limit = &result[kHandleBlockSize]; } @@ -93,21 +93,20 @@ Object** HandleScope::Extend() { void HandleScope::DeleteExtensions() { - ASSERT(current_.extensions != 0); - HandleScopeImplementer::instance()->DeleteExtensions(current_.extensions); + HandleScopeImplementer::instance()->DeleteExtensions(current_.limit); } void HandleScope::ZapRange(Object** start, Object** end) { - if (start == NULL) return; - for (Object** p = start; p < end; p++) { + ASSERT(end - start <= kHandleBlockSize); + for (Object** p = start; p != end; p++) { *reinterpret_cast<Address*>(p) = v8::internal::kHandleZapValue; } } -Address HandleScope::current_extensions_address() { - return reinterpret_cast<Address>(¤t_.extensions); +Address HandleScope::current_level_address() { + return reinterpret_cast<Address>(¤t_.level); } @@ -210,6 +209,14 @@ void TransformToFastProperties(Handle<JSObject> object, } +void NumberDictionarySet(Handle<NumberDictionary> dictionary, + uint32_t index, + Handle<Object> value, + PropertyDetails details) { + CALL_HEAP_FUNCTION_VOID(dictionary->Set(index, *value, details)); +} + + void FlattenString(Handle<String> string) { CALL_HEAP_FUNCTION_VOID(string->TryFlatten()); } |