Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/objects.cc

Issue 841083002: Remove "extra checks" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 13521 matching lines...) Expand 10 before | Expand all | Expand 10 after
13532 args(isolate, interceptor->data(), *receiver, *object); 13532 args(isolate, interceptor->data(), *receiver, *object);
13533 v8::Handle<v8::Object> result; 13533 v8::Handle<v8::Object> result;
13534 if (!interceptor->enumerator()->IsUndefined()) { 13534 if (!interceptor->enumerator()->IsUndefined()) {
13535 v8::GenericNamedPropertyEnumeratorCallback enum_fun = 13535 v8::GenericNamedPropertyEnumeratorCallback enum_fun =
13536 v8::ToCData<v8::GenericNamedPropertyEnumeratorCallback>( 13536 v8::ToCData<v8::GenericNamedPropertyEnumeratorCallback>(
13537 interceptor->enumerator()); 13537 interceptor->enumerator());
13538 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); 13538 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object));
13539 result = args.Call(enum_fun); 13539 result = args.Call(enum_fun);
13540 } 13540 }
13541 if (result.IsEmpty()) return MaybeHandle<JSObject>(); 13541 if (result.IsEmpty()) return MaybeHandle<JSObject>();
13542 #if ENABLE_EXTRA_CHECKS 13542 DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
13543 CHECK(v8::Utils::OpenHandle(*result)->IsJSArray() || 13543 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
13544 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
13545 #endif
13546 // Rebox before returning. 13544 // Rebox before returning.
13547 return handle(*v8::Utils::OpenHandle(*result), isolate); 13545 return handle(*v8::Utils::OpenHandle(*result), isolate);
13548 } 13546 }
13549 13547
13550 13548
13551 // Compute the element keys from the interceptor. 13549 // Compute the element keys from the interceptor.
13552 MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor( 13550 MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor(
13553 Handle<JSObject> object, Handle<JSReceiver> receiver) { 13551 Handle<JSObject> object, Handle<JSReceiver> receiver) {
13554 Isolate* isolate = receiver->GetIsolate(); 13552 Isolate* isolate = receiver->GetIsolate();
13555 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); 13553 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
13556 PropertyCallbackArguments 13554 PropertyCallbackArguments
13557 args(isolate, interceptor->data(), *receiver, *object); 13555 args(isolate, interceptor->data(), *receiver, *object);
13558 v8::Handle<v8::Object> result; 13556 v8::Handle<v8::Object> result;
13559 if (!interceptor->enumerator()->IsUndefined()) { 13557 if (!interceptor->enumerator()->IsUndefined()) {
13560 v8::IndexedPropertyEnumeratorCallback enum_fun = 13558 v8::IndexedPropertyEnumeratorCallback enum_fun =
13561 v8::ToCData<v8::IndexedPropertyEnumeratorCallback>( 13559 v8::ToCData<v8::IndexedPropertyEnumeratorCallback>(
13562 interceptor->enumerator()); 13560 interceptor->enumerator());
13563 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); 13561 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object));
13564 result = args.Call(enum_fun); 13562 result = args.Call(enum_fun);
13565 } 13563 }
13566 if (result.IsEmpty()) return MaybeHandle<JSObject>(); 13564 if (result.IsEmpty()) return MaybeHandle<JSObject>();
13567 #if ENABLE_EXTRA_CHECKS 13565 DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
13568 CHECK(v8::Utils::OpenHandle(*result)->IsJSArray() || 13566 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
13569 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
13570 #endif
13571 // Rebox before returning. 13567 // Rebox before returning.
13572 return handle(*v8::Utils::OpenHandle(*result), isolate); 13568 return handle(*v8::Utils::OpenHandle(*result), isolate);
13573 } 13569 }
13574 13570
13575 13571
13576 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object, 13572 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object,
13577 Handle<Name> key) { 13573 Handle<Name> key) {
13578 LookupIterator it(object, key, LookupIterator::OWN_SKIP_INTERCEPTOR); 13574 LookupIterator it(object, key, LookupIterator::OWN_SKIP_INTERCEPTOR);
13579 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); 13575 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
13580 if (!maybe_result.has_value) return Maybe<bool>(); 13576 if (!maybe_result.has_value) return Maybe<bool>();
(...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after
16831 Handle<DependentCode> codes = 16827 Handle<DependentCode> codes =
16832 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16828 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16833 DependentCode::kPropertyCellChangedGroup, 16829 DependentCode::kPropertyCellChangedGroup,
16834 info->object_wrapper()); 16830 info->object_wrapper());
16835 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16831 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16836 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16832 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16837 cell, info->zone()); 16833 cell, info->zone());
16838 } 16834 }
16839 16835
16840 } } // namespace v8::internal 16836 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698