Simplify Object::GetElementWithReceiver
Don't inline GetPrototype() to avoid code duplication BUG=none R=dcarney@chromium.org LOG=n Review URL: https://codereview.chromium.org/331313010 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
c0179a50da
commit
e369c9e75e
@ -809,26 +809,15 @@ MaybeHandle<Object> Object::GetElementWithReceiver(Isolate* isolate,
|
||||
!holder->IsNull();
|
||||
holder = Handle<Object>(holder->GetPrototype(isolate), isolate)) {
|
||||
if (!holder->IsJSObject()) {
|
||||
Context* native_context = isolate->context()->native_context();
|
||||
if (holder->IsNumber()) {
|
||||
holder = Handle<Object>(
|
||||
native_context->number_function()->instance_prototype(), isolate);
|
||||
} else if (holder->IsString()) {
|
||||
holder = Handle<Object>(
|
||||
native_context->string_function()->instance_prototype(), isolate);
|
||||
} else if (holder->IsSymbol()) {
|
||||
holder = Handle<Object>(
|
||||
native_context->symbol_function()->instance_prototype(), isolate);
|
||||
} else if (holder->IsBoolean()) {
|
||||
holder = Handle<Object>(
|
||||
native_context->boolean_function()->instance_prototype(), isolate);
|
||||
} else if (holder->IsJSProxy()) {
|
||||
if (holder->IsJSProxy()) {
|
||||
return JSProxy::GetElementWithHandler(
|
||||
Handle<JSProxy>::cast(holder), receiver, index);
|
||||
} else {
|
||||
// Undefined and null have no indexed properties.
|
||||
ASSERT(holder->IsUndefined() || holder->IsNull());
|
||||
} else if (holder->IsUndefined()) {
|
||||
// Undefined has no indexed properties.
|
||||
return isolate->factory()->undefined_value();
|
||||
} else {
|
||||
holder = Handle<Object>(holder->GetPrototype(isolate), isolate);
|
||||
ASSERT(holder->IsJSObject());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user