Minor LookupIterator cleanups
BUG= R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/480283003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
e6995a01f4
commit
79b539877e
@ -971,7 +971,7 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
|
||||
cache_holder);
|
||||
// Perform a lookup behind the interceptor. Copy the LookupIterator since
|
||||
// the original iterator will be used to fetch the value.
|
||||
LookupIterator it(lookup);
|
||||
LookupIterator it = *lookup;
|
||||
it.Next();
|
||||
LookupForRead(&it);
|
||||
return compiler.CompileLoadInterceptor(&it);
|
||||
|
@ -35,8 +35,8 @@ void LookupIterator::Next() {
|
||||
// Either was found in the receiver, or the receiver has no prototype.
|
||||
if (holder == NULL) return;
|
||||
|
||||
maybe_holder_ = handle(holder);
|
||||
holder_map_ = handle(map);
|
||||
maybe_holder_ = handle(holder, isolate_);
|
||||
holder_map_ = handle(map, isolate_);
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ Handle<JSReceiver> LookupIterator::GetRoot() const {
|
||||
Handle<Map> LookupIterator::GetReceiverMap() const {
|
||||
Handle<Object> receiver = GetReceiver();
|
||||
if (receiver->IsNumber()) return isolate_->factory()->heap_number_map();
|
||||
return handle(Handle<HeapObject>::cast(receiver)->map());
|
||||
return handle(Handle<HeapObject>::cast(receiver)->map(), isolate_);
|
||||
}
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ void LookupIterator::PrepareTransitionToDataProperty(
|
||||
}
|
||||
|
||||
transition_map_ = Map::TransitionToDataProperty(
|
||||
handle(receiver->map()), name_, value, attributes, store_mode);
|
||||
handle(receiver->map(), isolate_), name_, value, attributes, store_mode);
|
||||
state_ = TRANSITION;
|
||||
}
|
||||
|
||||
@ -209,8 +209,9 @@ void LookupIterator::TransitionToAccessorProperty(
|
||||
// observable.
|
||||
Handle<JSObject> receiver = GetStoreTarget();
|
||||
maybe_holder_ = receiver;
|
||||
holder_map_ = Map::TransitionToAccessorProperty(
|
||||
handle(receiver->map()), name_, component, accessor, attributes);
|
||||
holder_map_ =
|
||||
Map::TransitionToAccessorProperty(handle(receiver->map(), isolate_),
|
||||
name_, component, accessor, attributes);
|
||||
JSObject::MigrateToMap(receiver, holder_map_);
|
||||
|
||||
ReloadPropertyInformation();
|
||||
@ -243,7 +244,7 @@ void LookupIterator::TransitionToAccessorProperty(
|
||||
JSObject::SetNormalizedProperty(receiver, name_, pair, details);
|
||||
|
||||
JSObject::ReoptimizeIfPrototype(receiver);
|
||||
holder_map_ = handle(receiver->map());
|
||||
holder_map_ = handle(receiver->map(), isolate_);
|
||||
ReloadPropertyInformation();
|
||||
}
|
||||
|
||||
|
16
src/lookup.h
16
src/lookup.h
@ -53,18 +53,6 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
|
||||
DESCRIPTOR
|
||||
};
|
||||
|
||||
explicit LookupIterator(const LookupIterator* other)
|
||||
: configuration_(other->configuration_),
|
||||
state_(other->state_),
|
||||
property_kind_(other->property_kind_),
|
||||
property_encoding_(other->property_encoding_),
|
||||
property_details_(other->property_details_),
|
||||
isolate_(other->isolate_),
|
||||
name_(other->name_),
|
||||
holder_map_(other->holder_map_),
|
||||
maybe_receiver_(other->maybe_receiver_),
|
||||
maybe_holder_(other->maybe_holder_) {}
|
||||
|
||||
LookupIterator(Handle<Object> receiver, Handle<Name> name,
|
||||
Configuration configuration = CHECK_DERIVED)
|
||||
: configuration_(ComputeConfiguration(configuration, name)),
|
||||
@ -77,7 +65,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
|
||||
maybe_receiver_(receiver),
|
||||
number_(DescriptorArray::kNotFound) {
|
||||
Handle<JSReceiver> root = GetRoot();
|
||||
holder_map_ = handle(root->map());
|
||||
holder_map_ = handle(root->map(), isolate_);
|
||||
maybe_holder_ = root;
|
||||
Next();
|
||||
}
|
||||
@ -92,7 +80,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
|
||||
property_details_(NONE, NORMAL, Representation::None()),
|
||||
isolate_(name->GetIsolate()),
|
||||
name_(name),
|
||||
holder_map_(holder->map()),
|
||||
holder_map_(holder->map(), isolate_),
|
||||
maybe_receiver_(receiver),
|
||||
maybe_holder_(holder),
|
||||
number_(DescriptorArray::kNotFound) {
|
||||
|
@ -12844,12 +12844,12 @@ void JSArray::JSArrayUpdateLengthFromIndex(Handle<JSArray> array,
|
||||
|
||||
|
||||
bool JSArray::IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) {
|
||||
Isolate* isolate = jsarray_map->GetIsolate();
|
||||
DCHECK(!jsarray_map->is_dictionary_map());
|
||||
LookupResult lookup(isolate);
|
||||
Handle<Name> length_string = isolate->factory()->length_string();
|
||||
jsarray_map->LookupDescriptor(NULL, *length_string, &lookup);
|
||||
return lookup.IsReadOnly();
|
||||
Isolate* isolate = jsarray_map->GetIsolate();
|
||||
DCHECK(!jsarray_map->is_dictionary_map());
|
||||
LookupResult lookup(isolate);
|
||||
Handle<Name> length_string = isolate->factory()->length_string();
|
||||
jsarray_map->LookupDescriptor(NULL, *length_string, &lookup);
|
||||
return lookup.IsReadOnly();
|
||||
}
|
||||
|
||||
|
||||
@ -14615,13 +14615,6 @@ Handle<Object> ExternalFloat64Array::SetValue(
|
||||
}
|
||||
|
||||
|
||||
PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) {
|
||||
DCHECK(!HasFastProperties());
|
||||
Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
|
||||
return PropertyCell::cast(value);
|
||||
}
|
||||
|
||||
|
||||
Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell(
|
||||
Handle<JSGlobalObject> global,
|
||||
Handle<Name> name) {
|
||||
|
@ -7797,9 +7797,6 @@ class GlobalObject: public JSObject {
|
||||
// [global proxy]: the global proxy object of the context
|
||||
DECL_ACCESSORS(global_proxy, JSObject)
|
||||
|
||||
// Retrieve the property cell used to store a property.
|
||||
PropertyCell* GetPropertyCell(LookupResult* result);
|
||||
|
||||
DECLARE_CAST(GlobalObject)
|
||||
|
||||
// Layout description.
|
||||
|
@ -10899,8 +10899,8 @@ RUNTIME_FUNCTION(Runtime_Break) {
|
||||
}
|
||||
|
||||
|
||||
static Handle<Object> DebugLookupResultValue(LookupIterator* it,
|
||||
bool* has_caught = NULL) {
|
||||
static Handle<Object> DebugGetProperty(LookupIterator* it,
|
||||
bool* has_caught = NULL) {
|
||||
for (; it->IsFound(); it->Next()) {
|
||||
switch (it->state()) {
|
||||
case LookupIterator::NOT_FOUND:
|
||||
@ -10986,7 +10986,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetPropertyDetails) {
|
||||
|
||||
LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN);
|
||||
bool has_caught = false;
|
||||
Handle<Object> value = DebugLookupResultValue(&it, &has_caught);
|
||||
Handle<Object> value = DebugGetProperty(&it, &has_caught);
|
||||
if (!it.IsFound()) return isolate->heap()->undefined_value();
|
||||
|
||||
Handle<Object> maybe_pair;
|
||||
@ -11026,7 +11026,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetProperty) {
|
||||
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
|
||||
|
||||
LookupIterator it(obj, name, LookupIterator::CHECK_DERIVED);
|
||||
return *DebugLookupResultValue(&it);
|
||||
return *DebugGetProperty(&it);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user