Commit 71295754 authored by jochen@chromium.org's avatar jochen@chromium.org

Unify LookupIterator::GetRoot and Objects::GetRootMap

BUG=none
R=verwaest@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/388193002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22369 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cc9a9f41
......@@ -22,21 +22,10 @@ void LookupIterator::Next() {
Handle<JSReceiver> LookupIterator::GetRoot() const {
Handle<Object> receiver = GetReceiver();
if (receiver->IsJSReceiver()) return Handle<JSReceiver>::cast(receiver);
Context* native_context = isolate_->context()->native_context();
JSFunction* function;
if (receiver->IsNumber()) {
function = native_context->number_function();
} else if (receiver->IsString()) {
function = native_context->string_function();
} else if (receiver->IsSymbol()) {
function = native_context->symbol_function();
} else if (receiver->IsBoolean()) {
function = native_context->boolean_function();
} else {
UNREACHABLE();
function = NULL;
}
return handle(JSReceiver::cast(function->instance_prototype()));
Handle<Object> root =
handle(receiver->GetRootMap(isolate_)->prototype(), isolate_);
CHECK(!root->IsNull());
return Handle<JSReceiver>::cast(root);
}
......
......@@ -1570,6 +1570,7 @@ class Object {
#endif
private:
friend class LookupIterator;
friend class PrototypeIterator;
// Return the map of the root of object's prototype chain.
......
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