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

Side by Side Diff: src/objects.cc

Issue 1310953002: Use DescriptorArray when checking if an object has a property (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 4 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 | « no previous file | 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 "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 12717 matching lines...) Expand 10 before | Expand all | Expand 10 after
12728 if (result.IsEmpty()) return MaybeHandle<JSObject>(); 12728 if (result.IsEmpty()) return MaybeHandle<JSObject>();
12729 DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() || 12729 DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
12730 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements()); 12730 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
12731 // Rebox before returning. 12731 // Rebox before returning.
12732 return handle(*v8::Utils::OpenHandle(*result), isolate); 12732 return handle(*v8::Utils::OpenHandle(*result), isolate);
12733 } 12733 }
12734 12734
12735 12735
12736 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object, 12736 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object,
12737 Handle<Name> name) { 12737 Handle<Name> name) {
12738 DescriptorArray* desc = object->map()->instance_descriptors();
12739 if (!desc->IsEmpty()) {
12740 int there = desc->SearchWithCache(*name, object->map());
12741 return Just(there != desc->kNotFound);
12742 }
12743
12738 LookupIterator it = LookupIterator::PropertyOrElement( 12744 LookupIterator it = LookupIterator::PropertyOrElement(
12739 name->GetIsolate(), object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); 12745 name->GetIsolate(), object, name, LookupIterator::OWN_SKIP_INTERCEPTOR);
12740 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); 12746 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it);
12741 if (!maybe_result.IsJust()) return Nothing<bool>(); 12747 if (!maybe_result.IsJust()) return Nothing<bool>();
12742 return Just(it.IsFound()); 12748 return Just(it.IsFound());
12743 } 12749 }
12744 12750
12745 12751
12746 Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object, 12752 Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object,
12747 uint32_t index) { 12753 uint32_t index) {
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
15700 if (cell->value() != *new_value) { 15706 if (cell->value() != *new_value) {
15701 cell->set_value(*new_value); 15707 cell->set_value(*new_value);
15702 Isolate* isolate = cell->GetIsolate(); 15708 Isolate* isolate = cell->GetIsolate();
15703 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15709 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15704 isolate, DependentCode::kPropertyCellChangedGroup); 15710 isolate, DependentCode::kPropertyCellChangedGroup);
15705 } 15711 }
15706 } 15712 }
15707 15713
15708 } // namespace internal 15714 } // namespace internal
15709 } // namespace v8 15715 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698