Commit 79b53987 authored by verwaest@chromium.org's avatar verwaest@chromium.org

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
parent e6995a01
...@@ -971,7 +971,7 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup, ...@@ -971,7 +971,7 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
cache_holder); cache_holder);
// Perform a lookup behind the interceptor. Copy the LookupIterator since // Perform a lookup behind the interceptor. Copy the LookupIterator since
// the original iterator will be used to fetch the value. // the original iterator will be used to fetch the value.
LookupIterator it(lookup); LookupIterator it = *lookup;
it.Next(); it.Next();
LookupForRead(&it); LookupForRead(&it);
return compiler.CompileLoadInterceptor(&it); return compiler.CompileLoadInterceptor(&it);
......
...@@ -35,8 +35,8 @@ void LookupIterator::Next() { ...@@ -35,8 +35,8 @@ void LookupIterator::Next() {
// Either was found in the receiver, or the receiver has no prototype. // Either was found in the receiver, or the receiver has no prototype.
if (holder == NULL) return; if (holder == NULL) return;
maybe_holder_ = handle(holder); maybe_holder_ = handle(holder, isolate_);
holder_map_ = handle(map); holder_map_ = handle(map, isolate_);
} }
...@@ -53,7 +53,7 @@ Handle<JSReceiver> LookupIterator::GetRoot() const { ...@@ -53,7 +53,7 @@ Handle<JSReceiver> LookupIterator::GetRoot() const {
Handle<Map> LookupIterator::GetReceiverMap() const { Handle<Map> LookupIterator::GetReceiverMap() const {
Handle<Object> receiver = GetReceiver(); Handle<Object> receiver = GetReceiver();
if (receiver->IsNumber()) return isolate_->factory()->heap_number_map(); 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( ...@@ -184,7 +184,7 @@ void LookupIterator::PrepareTransitionToDataProperty(
} }
transition_map_ = Map::TransitionToDataProperty( transition_map_ = Map::TransitionToDataProperty(
handle(receiver->map()), name_, value, attributes, store_mode); handle(receiver->map(), isolate_), name_, value, attributes, store_mode);
state_ = TRANSITION; state_ = TRANSITION;
} }
...@@ -209,8 +209,9 @@ void LookupIterator::TransitionToAccessorProperty( ...@@ -209,8 +209,9 @@ void LookupIterator::TransitionToAccessorProperty(
// observable. // observable.
Handle<JSObject> receiver = GetStoreTarget(); Handle<JSObject> receiver = GetStoreTarget();
maybe_holder_ = receiver; maybe_holder_ = receiver;
holder_map_ = Map::TransitionToAccessorProperty( holder_map_ =
handle(receiver->map()), name_, component, accessor, attributes); Map::TransitionToAccessorProperty(handle(receiver->map(), isolate_),
name_, component, accessor, attributes);
JSObject::MigrateToMap(receiver, holder_map_); JSObject::MigrateToMap(receiver, holder_map_);
ReloadPropertyInformation(); ReloadPropertyInformation();
...@@ -243,7 +244,7 @@ void LookupIterator::TransitionToAccessorProperty( ...@@ -243,7 +244,7 @@ void LookupIterator::TransitionToAccessorProperty(
JSObject::SetNormalizedProperty(receiver, name_, pair, details); JSObject::SetNormalizedProperty(receiver, name_, pair, details);
JSObject::ReoptimizeIfPrototype(receiver); JSObject::ReoptimizeIfPrototype(receiver);
holder_map_ = handle(receiver->map()); holder_map_ = handle(receiver->map(), isolate_);
ReloadPropertyInformation(); ReloadPropertyInformation();
} }
......
...@@ -53,18 +53,6 @@ class LookupIterator V8_FINAL BASE_EMBEDDED { ...@@ -53,18 +53,6 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
DESCRIPTOR 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, LookupIterator(Handle<Object> receiver, Handle<Name> name,
Configuration configuration = CHECK_DERIVED) Configuration configuration = CHECK_DERIVED)
: configuration_(ComputeConfiguration(configuration, name)), : configuration_(ComputeConfiguration(configuration, name)),
...@@ -77,7 +65,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED { ...@@ -77,7 +65,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
maybe_receiver_(receiver), maybe_receiver_(receiver),
number_(DescriptorArray::kNotFound) { number_(DescriptorArray::kNotFound) {
Handle<JSReceiver> root = GetRoot(); Handle<JSReceiver> root = GetRoot();
holder_map_ = handle(root->map()); holder_map_ = handle(root->map(), isolate_);
maybe_holder_ = root; maybe_holder_ = root;
Next(); Next();
} }
...@@ -92,7 +80,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED { ...@@ -92,7 +80,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
property_details_(NONE, NORMAL, Representation::None()), property_details_(NONE, NORMAL, Representation::None()),
isolate_(name->GetIsolate()), isolate_(name->GetIsolate()),
name_(name), name_(name),
holder_map_(holder->map()), holder_map_(holder->map(), isolate_),
maybe_receiver_(receiver), maybe_receiver_(receiver),
maybe_holder_(holder), maybe_holder_(holder),
number_(DescriptorArray::kNotFound) { number_(DescriptorArray::kNotFound) {
......
...@@ -12844,12 +12844,12 @@ void JSArray::JSArrayUpdateLengthFromIndex(Handle<JSArray> array, ...@@ -12844,12 +12844,12 @@ void JSArray::JSArrayUpdateLengthFromIndex(Handle<JSArray> array,
bool JSArray::IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) { bool JSArray::IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) {
Isolate* isolate = jsarray_map->GetIsolate(); Isolate* isolate = jsarray_map->GetIsolate();
DCHECK(!jsarray_map->is_dictionary_map()); DCHECK(!jsarray_map->is_dictionary_map());
LookupResult lookup(isolate); LookupResult lookup(isolate);
Handle<Name> length_string = isolate->factory()->length_string(); Handle<Name> length_string = isolate->factory()->length_string();
jsarray_map->LookupDescriptor(NULL, *length_string, &lookup); jsarray_map->LookupDescriptor(NULL, *length_string, &lookup);
return lookup.IsReadOnly(); return lookup.IsReadOnly();
} }
...@@ -14615,13 +14615,6 @@ Handle<Object> ExternalFloat64Array::SetValue( ...@@ -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<PropertyCell> JSGlobalObject::EnsurePropertyCell(
Handle<JSGlobalObject> global, Handle<JSGlobalObject> global,
Handle<Name> name) { Handle<Name> name) {
......
...@@ -7797,9 +7797,6 @@ class GlobalObject: public JSObject { ...@@ -7797,9 +7797,6 @@ class GlobalObject: public JSObject {
// [global proxy]: the global proxy object of the context // [global proxy]: the global proxy object of the context
DECL_ACCESSORS(global_proxy, JSObject) DECL_ACCESSORS(global_proxy, JSObject)
// Retrieve the property cell used to store a property.
PropertyCell* GetPropertyCell(LookupResult* result);
DECLARE_CAST(GlobalObject) DECLARE_CAST(GlobalObject)
// Layout description. // Layout description.
......
...@@ -10899,8 +10899,8 @@ RUNTIME_FUNCTION(Runtime_Break) { ...@@ -10899,8 +10899,8 @@ RUNTIME_FUNCTION(Runtime_Break) {
} }
static Handle<Object> DebugLookupResultValue(LookupIterator* it, static Handle<Object> DebugGetProperty(LookupIterator* it,
bool* has_caught = NULL) { bool* has_caught = NULL) {
for (; it->IsFound(); it->Next()) { for (; it->IsFound(); it->Next()) {
switch (it->state()) { switch (it->state()) {
case LookupIterator::NOT_FOUND: case LookupIterator::NOT_FOUND:
...@@ -10986,7 +10986,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetPropertyDetails) { ...@@ -10986,7 +10986,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetPropertyDetails) {
LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN); LookupIterator it(obj, name, LookupIterator::CHECK_HIDDEN);
bool has_caught = false; 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(); if (!it.IsFound()) return isolate->heap()->undefined_value();
Handle<Object> maybe_pair; Handle<Object> maybe_pair;
...@@ -11026,7 +11026,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetProperty) { ...@@ -11026,7 +11026,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetProperty) {
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
LookupIterator it(obj, name, LookupIterator::CHECK_DERIVED); LookupIterator it(obj, name, LookupIterator::CHECK_DERIVED);
return *DebugLookupResultValue(&it); return *DebugGetProperty(&it);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment