From d8011d1683fe0d977de2bea1147f5213d4490c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 6 Oct 2015 08:42:38 +0200 Subject: deps: upgrade V8 to 4.6.85.23 PR-URL: https://github.com/nodejs/node/pull/3351 Reviewed-By: indutny - Fedor Indutny Reviewed-By: bnoordhuis - Ben Noordhuis --- deps/v8/src/handles-inl.h | 76 ++++------------------------------------------- 1 file changed, 6 insertions(+), 70 deletions(-) (limited to 'deps/v8/src/handles-inl.h') diff --git a/deps/v8/src/handles-inl.h b/deps/v8/src/handles-inl.h index 3022f288a3..b905c16a04 100644 --- a/deps/v8/src/handles-inl.h +++ b/deps/v8/src/handles-inl.h @@ -1,7 +1,6 @@ // Copyright 2006-2008 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// #ifndef V8_HANDLES_INL_H_ #define V8_HANDLES_INL_H_ @@ -14,72 +13,8 @@ namespace v8 { namespace internal { -template -Handle::Handle(T* obj) { - location_ = HandleScope::CreateHandle(obj->GetIsolate(), obj); -} - - -template -Handle::Handle(T* obj, Isolate* isolate) { - location_ = HandleScope::CreateHandle(isolate, obj); -} - - -template -inline bool Handle::is_identical_to(const Handle o) const { - // Dereferencing deferred handles to check object equality is safe. - SLOW_DCHECK( - (location_ == NULL || IsDereferenceAllowed(NO_DEFERRED_CHECK)) && - (o.location_ == NULL || o.IsDereferenceAllowed(NO_DEFERRED_CHECK))); - if (location_ == o.location_) return true; - if (location_ == NULL || o.location_ == NULL) return false; - return *location_ == *o.location_; -} - - -template -inline T* Handle::operator*() const { - SLOW_DCHECK(IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK)); - return *bit_cast(location_); -} - -template -inline T** Handle::location() const { - SLOW_DCHECK(location_ == NULL || - IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK)); - return location_; -} - -#ifdef DEBUG -template -bool Handle::IsDereferenceAllowed(DereferenceCheckMode mode) const { - DCHECK(location_ != NULL); - Object* object = *bit_cast(location_); - if (object->IsSmi()) return true; - HeapObject* heap_object = HeapObject::cast(object); - Heap* heap = heap_object->GetHeap(); - Object** handle = reinterpret_cast(location_); - Object** roots_array_start = heap->roots_array_start(); - if (roots_array_start <= handle && - handle < roots_array_start + Heap::kStrongRootListLength && - heap->RootCanBeTreatedAsConstant( - static_cast(handle - roots_array_start))) { - return true; - } - if (!AllowHandleDereference::IsAllowed()) return false; - if (mode == INCLUDE_DEFERRED_CHECK && - !AllowDeferredHandleDereference::IsAllowed()) { - // Accessing cells, maps and internalized strings is safe. - if (heap_object->IsCell()) return true; - if (heap_object->IsMap()) return true; - if (heap_object->IsInternalizedString()) return true; - return !heap->isolate()->IsDeferredHandle(handle); - } - return true; -} -#endif - +HandleBase::HandleBase(Object* object, Isolate* isolate) + : location_(HandleScope::CreateHandle(isolate, object)) {} HandleScope::HandleScope(Isolate* isolate) { @@ -136,7 +71,7 @@ Handle HandleScope::CloseAndEscape(Handle handle_value) { CloseScope(isolate_, prev_next_, prev_limit_); // Allocate one handle in the parent scope. DCHECK(current->level > 0); - Handle result(CreateHandle(isolate_, value)); + Handle result(value, isolate_); // Reinitialize the current scope (so that it's ready // to be used or closed again). prev_next_ = current->next; @@ -151,7 +86,7 @@ T** HandleScope::CreateHandle(Isolate* isolate, T* value) { DCHECK(AllowHandleAllocation::IsAllowed()); HandleScopeData* current = isolate->handle_scope_data(); - internal::Object** cur = current->next; + Object** cur = current->next; if (cur == current->limit) cur = Extend(isolate); // Update the current next field, set the value in the created // handle, and return the result. @@ -190,6 +125,7 @@ inline SealHandleScope::~SealHandleScope() { #endif -} } // namespace v8::internal +} // namespace internal +} // namespace v8 #endif // V8_HANDLES_INL_H_ -- cgit v1.2.1