Commit 90cecd65 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Only use Type for compiling load handlers.

BUG=
R=ishell@chromium.org

Review URL: https://chromiumcodereview.appspot.com/80693002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 016113d9
...@@ -1308,14 +1308,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { ...@@ -1308,14 +1308,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
Register LoadStubCompiler::CallbackHandlerFrontend( Register LoadStubCompiler::CallbackHandlerFrontend(
Handle<Object> object, Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<Object> callback) { Handle<Object> callback) {
Label miss; Label miss;
Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss);
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
ASSERT(!reg.is(scratch2())); ASSERT(!reg.is(scratch2()));
...@@ -2800,7 +2800,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -2800,7 +2800,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) { Handle<ExecutableAccessorInfo> callback) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
// Stub never generated for non-global objects that require access checks. // Stub never generated for non-global objects that require access checks.
ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded()); ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
...@@ -2826,7 +2827,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -2826,7 +2827,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
const CallOptimization& call_optimization) { const CallOptimization& call_optimization) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
Register values[] = { value() }; Register values[] = { value() };
GenerateFastApiCall( GenerateFastApiCall(
...@@ -2920,12 +2922,10 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor( ...@@ -2920,12 +2922,10 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
} }
Handle<Code> LoadStubCompiler::CompileLoadNonexistent( Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
Handle<Object> object, Handle<JSObject> last,
Handle<JSObject> last, Handle<Name> name) {
Handle<Name> name, NonexistentHandlerFrontend(type, last, name);
Handle<JSGlobalObject> global) {
NonexistentHandlerFrontend(object, last, name, global);
// Return undefined if maps of the full prototype chain are still the // Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value. // same and no global property with this name contains a value.
...@@ -3021,14 +3021,14 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, ...@@ -3021,14 +3021,14 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
Handle<Code> LoadStubCompiler::CompileLoadGlobal( Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<Object> object, Handle<Type> type,
Handle<GlobalObject> global, Handle<GlobalObject> global,
Handle<PropertyCell> cell, Handle<PropertyCell> cell,
Handle<Name> name, Handle<Name> name,
bool is_dont_delete) { bool is_dont_delete) {
Label miss; Label miss;
HandlerFrontendHeader(object, receiver(), global, name, &miss); HandlerFrontendHeader(type, receiver(), global, name, &miss);
// Get the value from the cell. // Get the value from the cell.
__ mov(r3, Operand(cell)); __ mov(r3, Operand(cell));
......
...@@ -1342,14 +1342,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { ...@@ -1342,14 +1342,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
Register LoadStubCompiler::CallbackHandlerFrontend( Register LoadStubCompiler::CallbackHandlerFrontend(
Handle<Object> object, Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<Object> callback) { Handle<Object> callback) {
Label miss; Label miss;
Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss);
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
ASSERT(!reg.is(scratch2())); ASSERT(!reg.is(scratch2()));
...@@ -2952,7 +2952,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -2952,7 +2952,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) { Handle<ExecutableAccessorInfo> callback) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
__ pop(scratch1()); // remove the return address __ pop(scratch1()); // remove the return address
__ push(receiver()); __ push(receiver());
...@@ -2976,7 +2977,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -2976,7 +2977,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
const CallOptimization& call_optimization) { const CallOptimization& call_optimization) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
Register values[] = { value() }; Register values[] = { value() };
GenerateFastApiCall( GenerateFastApiCall(
...@@ -3083,12 +3085,10 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( ...@@ -3083,12 +3085,10 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
} }
Handle<Code> LoadStubCompiler::CompileLoadNonexistent( Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
Handle<Object> object, Handle<JSObject> last,
Handle<JSObject> last, Handle<Name> name) {
Handle<Name> name, NonexistentHandlerFrontend(type, last, name);
Handle<JSGlobalObject> global) {
NonexistentHandlerFrontend(object, last, name, global);
// Return undefined if maps of the full prototype chain are still the // Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value. // same and no global property with this name contains a value.
...@@ -3179,14 +3179,14 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, ...@@ -3179,14 +3179,14 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
Handle<Code> LoadStubCompiler::CompileLoadGlobal( Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<Object> object, Handle<Type> type,
Handle<GlobalObject> global, Handle<GlobalObject> global,
Handle<PropertyCell> cell, Handle<PropertyCell> cell,
Handle<Name> name, Handle<Name> name,
bool is_dont_delete) { bool is_dont_delete) {
Label miss; Label miss;
HandlerFrontendHeader(object, receiver(), global, name, &miss); HandlerFrontendHeader(type, receiver(), global, name, &miss);
// Get the value from the cell. // Get the value from the cell.
if (Serializer::enabled()) { if (Serializer::enabled()) {
__ mov(eax, Immediate(cell)); __ mov(eax, Immediate(cell));
......
...@@ -1145,13 +1145,14 @@ void LoadIC::UpdateCaches(LookupResult* lookup, ...@@ -1145,13 +1145,14 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
return; return;
} }
Handle<Type> type = CurrentTypeOf(object, isolate());
Handle<Code> code; Handle<Code> code;
if (!lookup->IsCacheable()) { if (!lookup->IsCacheable()) {
// Bail out if the result is not cacheable. // Bail out if the result is not cacheable.
code = slow_stub(); code = slow_stub();
} else if (!lookup->IsProperty()) { } else if (!lookup->IsProperty()) {
if (kind() == Code::LOAD_IC) { if (kind() == Code::LOAD_IC) {
code = isolate()->stub_cache()->ComputeLoadNonexistent(name, object); code = isolate()->stub_cache()->ComputeLoadNonexistent(name, type);
} else { } else {
code = slow_stub(); code = slow_stub();
} }
...@@ -1159,7 +1160,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup, ...@@ -1159,7 +1160,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
code = ComputeHandler(lookup, object, name); code = ComputeHandler(lookup, object, name);
} }
PatchCache(CurrentTypeOf(object, isolate()), name, code); PatchCache(type, name, code);
TRACE_IC("LoadIC", name); TRACE_IC("LoadIC", name);
} }
...@@ -1181,7 +1182,7 @@ Handle<Code> IC::ComputeHandler(LookupResult* lookup, ...@@ -1181,7 +1182,7 @@ Handle<Code> IC::ComputeHandler(LookupResult* lookup,
isolate(), *object, cache_holder)); isolate(), *object, cache_holder));
Handle<Code> code = isolate()->stub_cache()->FindHandler( Handle<Code> code = isolate()->stub_cache()->FindHandler(
name, stub_holder, kind(), cache_holder, strict_mode()); name, handle(stub_holder->map()), kind(), cache_holder, strict_mode());
if (!code.is_null()) return code; if (!code.is_null()) return code;
code = CompileHandler(lookup, object, name, value, cache_holder); code = CompileHandler(lookup, object, name, value, cache_holder);
...@@ -1205,6 +1206,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1205,6 +1206,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
return SimpleFieldLoad(length_index); return SimpleFieldLoad(length_index);
} }
Handle<Type> type = CurrentTypeOf(object, isolate());
Handle<JSObject> holder(lookup->holder()); Handle<JSObject> holder(lookup->holder());
LoadStubCompiler compiler(isolate(), cache_holder, kind()); LoadStubCompiler compiler(isolate(), cache_holder, kind());
...@@ -1217,14 +1219,14 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1217,14 +1219,14 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
lookup->representation()); lookup->representation());
} }
return compiler.CompileLoadField( return compiler.CompileLoadField(
object, holder, name, field, lookup->representation()); type, holder, name, field, lookup->representation());
} }
case CONSTANT: { case CONSTANT: {
Handle<Object> constant(lookup->GetConstant(), isolate()); Handle<Object> constant(lookup->GetConstant(), isolate());
// TODO(2803): Don't compute a stub for cons strings because they cannot // TODO(2803): Don't compute a stub for cons strings because they cannot
// be embedded into code. // be embedded into code.
if (constant->IsConsString()) break; if (constant->IsConsString()) break;
return compiler.CompileLoadConstant(object, holder, name, constant); return compiler.CompileLoadConstant(type, holder, name, constant);
} }
case NORMAL: case NORMAL:
if (kind() != Code::LOAD_IC) break; if (kind() != Code::LOAD_IC) break;
...@@ -1233,7 +1235,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1233,7 +1235,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
Handle<PropertyCell> cell( Handle<PropertyCell> cell(
global->GetPropertyCell(lookup), isolate()); global->GetPropertyCell(lookup), isolate());
Handle<Code> code = compiler.CompileLoadGlobal( Handle<Code> code = compiler.CompileLoadGlobal(
object, global, cell, name, lookup->IsDontDelete()); type, global, cell, name, lookup->IsDontDelete());
// TODO(verwaest): Move caching of these NORMAL stubs outside as well. // TODO(verwaest): Move caching of these NORMAL stubs outside as well.
Handle<HeapObject> stub_holder(GetCodeCacheHolder( Handle<HeapObject> stub_holder(GetCodeCacheHolder(
isolate(), *object, cache_holder)); isolate(), *object, cache_holder));
...@@ -1263,7 +1265,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1263,7 +1265,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
Handle<ExecutableAccessorInfo>::cast(callback); Handle<ExecutableAccessorInfo>::cast(callback);
if (v8::ToCData<Address>(info->getter()) == 0) break; if (v8::ToCData<Address>(info->getter()) == 0) break;
if (!info->IsCompatibleReceiver(*object)) break; if (!info->IsCompatibleReceiver(*object)) break;
return compiler.CompileLoadCallback(object, holder, name, info); return compiler.CompileLoadCallback(type, holder, name, info);
} else if (callback->IsAccessorPair()) { } else if (callback->IsAccessorPair()) {
Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter(), Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter(),
isolate()); isolate());
...@@ -1282,9 +1284,9 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1282,9 +1284,9 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
if (call_optimization.is_simple_api_call() && if (call_optimization.is_simple_api_call() &&
call_optimization.IsCompatibleReceiver(*object)) { call_optimization.IsCompatibleReceiver(*object)) {
return compiler.CompileLoadCallback( return compiler.CompileLoadCallback(
object, holder, name, call_optimization); type, holder, name, call_optimization);
} }
return compiler.CompileLoadViaGetter(object, holder, name, function); return compiler.CompileLoadViaGetter(type, holder, name, function);
} }
// TODO(dcarney): Handle correctly. // TODO(dcarney): Handle correctly.
if (callback->IsDeclaredAccessorInfo()) break; if (callback->IsDeclaredAccessorInfo()) break;
...@@ -1294,7 +1296,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, ...@@ -1294,7 +1296,7 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
} }
case INTERCEPTOR: case INTERCEPTOR:
ASSERT(HasInterceptorGetter(*holder)); ASSERT(HasInterceptorGetter(*holder));
return compiler.CompileLoadInterceptor(object, holder, name); return compiler.CompileLoadInterceptor(type, holder, name);
default: default:
break; break;
} }
......
...@@ -100,21 +100,20 @@ Code* StubCache::Set(Name* name, Map* map, Code* code) { ...@@ -100,21 +100,20 @@ Code* StubCache::Set(Name* name, Map* map, Code* code) {
Handle<Code> StubCache::FindIC(Handle<Name> name, Handle<Code> StubCache::FindIC(Handle<Name> name,
Handle<Map> stub_holder_map, Handle<Map> stub_holder,
Code::Kind kind, Code::Kind kind,
Code::ExtraICState extra_state, Code::ExtraICState extra_state,
InlineCacheHolderFlag cache_holder) { InlineCacheHolderFlag cache_holder) {
Code::Flags flags = Code::ComputeMonomorphicFlags( Code::Flags flags = Code::ComputeMonomorphicFlags(
kind, extra_state, cache_holder); kind, extra_state, cache_holder);
Handle<Object> probe(stub_holder_map->FindInCodeCache(*name, flags), Handle<Object> probe(stub_holder->FindInCodeCache(*name, flags), isolate_);
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe); if (probe->IsCode()) return Handle<Code>::cast(probe);
return Handle<Code>::null(); return Handle<Code>::null();
} }
Handle<Code> StubCache::FindHandler(Handle<Name> name, Handle<Code> StubCache::FindHandler(Handle<Name> name,
Handle<HeapObject> stub_holder, Handle<Map> stub_holder,
Code::Kind kind, Code::Kind kind,
InlineCacheHolderFlag cache_holder, InlineCacheHolderFlag cache_holder,
StrictModeFlag strict_mode) { StrictModeFlag strict_mode) {
...@@ -126,8 +125,7 @@ Handle<Code> StubCache::FindHandler(Handle<Name> name, ...@@ -126,8 +125,7 @@ Handle<Code> StubCache::FindHandler(Handle<Name> name,
Code::Flags flags = Code::ComputeMonomorphicFlags( Code::Flags flags = Code::ComputeMonomorphicFlags(
Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind); Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind);
Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), Handle<Object> probe(stub_holder->FindInCodeCache(*name, flags), isolate_);
isolate_);
if (probe->IsCode()) return Handle<Code>::cast(probe); if (probe->IsCode()) return Handle<Code>::cast(probe);
return Handle<Code>::null(); return Handle<Code>::null();
} }
...@@ -173,41 +171,35 @@ Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, ...@@ -173,41 +171,35 @@ Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name,
Handle<Code> StubCache::ComputeLoadNonexistent(Handle<Name> name, Handle<Code> StubCache::ComputeLoadNonexistent(Handle<Name> name,
Handle<Object> object) { Handle<Type> type) {
InlineCacheHolderFlag cache_holder = IC::GetCodeCacheForObject(*object); InlineCacheHolderFlag flag = IC::GetCodeCacheFlag(*type);
Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder( Handle<Map> stub_holder = IC::GetCodeCacheHolder(flag, *type, isolate());
isolate(), *object, cache_holder)); // If no dictionary mode objects are present in the prototype chain, the load
// If no global objects are present in the prototype chain, the load // nonexistent IC stub can be shared for all names for a given map and we use
// nonexistent IC stub can be shared for all names for a given map // the empty string for the map cache in that case. If there are dictionary
// and we use the empty string for the map cache in that case. If // mode objects involved, we need to do negative lookups in the stub and
// there are global objects involved, we need to check global // therefore the stub will be specific to the name.
// property cells in the stub and therefore the stub will be Handle<Map> current_map = stub_holder;
// specific to the name. Handle<Name> cache_name = current_map->is_dictionary_map()
Handle<Name> cache_name = factory()->empty_string(); ? name : Handle<Name>::cast(isolate()->factory()->empty_string());
Handle<JSObject> current; Handle<Object> next(current_map->prototype(), isolate());
Handle<Object> next = stub_holder; Handle<JSObject> last = Handle<JSObject>::null();
Handle<JSGlobalObject> global; while (!next->IsNull()) {
do { last = Handle<JSObject>::cast(next);
current = Handle<JSObject>::cast(next); next = handle(current_map->prototype(), isolate());
next = Handle<Object>(current->GetPrototype(), isolate_); current_map = handle(Handle<HeapObject>::cast(next)->map());
if (current->IsJSGlobalObject()) { if (current_map->is_dictionary_map()) cache_name = name;
global = Handle<JSGlobalObject>::cast(current); }
cache_name = name;
} else if (!current->HasFastProperties()) {
cache_name = name;
}
} while (!next->IsNull());
// Compile the stub that is either shared for all names or // Compile the stub that is either shared for all names or
// name specific if there are global objects involved. // name specific if there are global objects involved.
Handle<Code> handler = FindHandler( Handle<Code> handler = FindHandler(
cache_name, stub_holder, Code::LOAD_IC, cache_holder); cache_name, stub_holder, Code::LOAD_IC, flag);
if (!handler.is_null()) return handler; if (!handler.is_null()) return handler;
LoadStubCompiler compiler(isolate_, cache_holder); LoadStubCompiler compiler(isolate_, flag);
handler = handler = compiler.CompileLoadNonexistent(type, last, cache_name);
compiler.CompileLoadNonexistent(object, current, cache_name, global); Map::UpdateCodeCache(stub_holder, cache_name, handler);
HeapObject::UpdateMapCodeCache(stub_holder, cache_name, handler);
return handler; return handler;
} }
...@@ -1135,56 +1127,54 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder, ...@@ -1135,56 +1127,54 @@ void StubCompiler::LookupPostInterceptor(Handle<JSObject> holder,
Register LoadStubCompiler::HandlerFrontendHeader( Register LoadStubCompiler::HandlerFrontendHeader(
Handle<Object> object, Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Label* miss) { Label* miss) {
Handle<JSObject> receiver;
PrototypeCheckType check_type = CHECK_ALL_MAPS; PrototypeCheckType check_type = CHECK_ALL_MAPS;
int function_index = -1; int function_index = -1;
if (object->IsJSObject()) { if (type->Is(Type::String())) {
receiver = Handle<JSObject>::cast(object); function_index = Context::STRING_FUNCTION_INDEX;
check_type = SKIP_RECEIVER; } else if (type->Is(Type::Symbol())) {
function_index = Context::SYMBOL_FUNCTION_INDEX;
} else if (type->Is(Type::Number())) {
function_index = Context::NUMBER_FUNCTION_INDEX;
} else if (type->Is(Type::Boolean())) {
// Booleans use the generic oddball map, so an additional check is needed to
// ensure the receiver is really a boolean.
GenerateBooleanCheck(object_reg, miss);
function_index = Context::BOOLEAN_FUNCTION_INDEX;
} else { } else {
if (object->IsString()) { check_type = SKIP_RECEIVER;
function_index = Context::STRING_FUNCTION_INDEX; }
} else if (object->IsSymbol()) {
function_index = Context::SYMBOL_FUNCTION_INDEX;
} else if (object->IsNumber()) {
function_index = Context::NUMBER_FUNCTION_INDEX;
} else {
ASSERT(object->IsBoolean());
// Booleans use the generic oddball map, so an additional check is
// needed to ensure the receiver is really a boolean.
GenerateBooleanCheck(object_reg, miss);
function_index = Context::BOOLEAN_FUNCTION_INDEX;
}
if (check_type == CHECK_ALL_MAPS) {
GenerateDirectLoadGlobalFunctionPrototype( GenerateDirectLoadGlobalFunctionPrototype(
masm(), function_index, scratch1(), miss); masm(), function_index, scratch1(), miss);
receiver = handle(JSObject::cast(object->GetPrototype(isolate()))); Object* function = isolate()->native_context()->get(function_index);
Object* prototype = JSFunction::cast(function)->instance_prototype();
type = IC::CurrentTypeOf(handle(prototype, isolate()), isolate());
object_reg = scratch1(); object_reg = scratch1();
} }
// Check that the maps starting from the prototype haven't changed. // Check that the maps starting from the prototype haven't changed.
return CheckPrototypes( return CheckPrototypes(
IC::CurrentTypeOf(receiver, isolate()), object_reg, holder, type, object_reg, holder, scratch1(), scratch2(), scratch3(),
scratch1(), scratch2(), scratch3(), name, miss, check_type); name, miss, check_type);
} }
// HandlerFrontend for store uses the name register. It has to be restored // HandlerFrontend for store uses the name register. It has to be restored
// before a miss. // before a miss.
Register StoreStubCompiler::HandlerFrontendHeader( Register StoreStubCompiler::HandlerFrontendHeader(
Handle<Object> object, Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Label* miss) { Label* miss) {
return CheckPrototypes( return CheckPrototypes(type, object_reg, holder, this->name(),
IC::CurrentTypeOf(object, isolate()), object_reg, holder, this->name(), scratch1(), scratch2(), name, miss, SKIP_RECEIVER);
scratch1(), scratch2(), name, miss, SKIP_RECEIVER);
} }
...@@ -1196,13 +1186,13 @@ bool BaseLoadStoreStubCompiler::IncludesNumberType(TypeHandleList* types) { ...@@ -1196,13 +1186,13 @@ bool BaseLoadStoreStubCompiler::IncludesNumberType(TypeHandleList* types) {
} }
Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Object> object, Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name) { Handle<Name> name) {
Label miss; Label miss;
Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss);
HandlerFrontendFooter(name, &miss); HandlerFrontendFooter(name, &miss);
...@@ -1210,32 +1200,43 @@ Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Object> object, ...@@ -1210,32 +1200,43 @@ Register BaseLoadStoreStubCompiler::HandlerFrontend(Handle<Object> object,
} }
void LoadStubCompiler::NonexistentHandlerFrontend( void LoadStubCompiler::NonexistentHandlerFrontend(Handle<Type> type,
Handle<Object> object, Handle<JSObject> last,
Handle<JSObject> last, Handle<Name> name) {
Handle<Name> name,
Handle<JSGlobalObject> global) {
Label miss; Label miss;
Register holder = HandlerFrontendHeader( Register holder;
object, receiver(), last, name, &miss); Handle<Map> last_map;
if (last.is_null()) {
holder = receiver();
last_map = IC::TypeToMap(*type, isolate());
// If |type| has null as its prototype, |last| is Handle<JSObject>::null().
ASSERT(last_map->prototype() == isolate()->heap()->null_value());
} else {
holder = HandlerFrontendHeader(type, receiver(), last, name, &miss);
last_map = handle(last->map());
}
if (!last->HasFastProperties() && if (last_map->is_dictionary_map() &&
!last->IsJSGlobalObject() && !last_map->IsJSGlobalObjectMap() &&
!last->IsJSGlobalProxy()) { !last_map->IsJSGlobalProxyMap()) {
if (!name->IsUniqueName()) { if (!name->IsUniqueName()) {
ASSERT(name->IsString()); ASSERT(name->IsString());
name = factory()->InternalizeString(Handle<String>::cast(name)); name = factory()->InternalizeString(Handle<String>::cast(name));
} }
ASSERT(last->property_dictionary()->FindEntry(*name) == ASSERT(last.is_null() ||
NameDictionary::kNotFound); last->property_dictionary()->FindEntry(*name) ==
NameDictionary::kNotFound);
GenerateDictionaryNegativeLookup(masm(), &miss, holder, name, GenerateDictionaryNegativeLookup(masm(), &miss, holder, name,
scratch2(), scratch3()); scratch2(), scratch3());
} }
// If the last object in the prototype chain is a global object, // If the last object in the prototype chain is a global object,
// check that the global property cell is empty. // check that the global property cell is empty.
if (!global.is_null()) { if (last_map->IsJSGlobalObjectMap()) {
Handle<JSGlobalObject> global = last.is_null()
? Handle<JSGlobalObject>::cast(type->AsConstant())
: Handle<JSGlobalObject>::cast(last);
GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss); GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss);
} }
...@@ -1244,14 +1245,14 @@ void LoadStubCompiler::NonexistentHandlerFrontend( ...@@ -1244,14 +1245,14 @@ void LoadStubCompiler::NonexistentHandlerFrontend(
Handle<Code> LoadStubCompiler::CompileLoadField( Handle<Code> LoadStubCompiler::CompileLoadField(
Handle<Object> object, Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
PropertyIndex field, PropertyIndex field,
Representation representation) { Representation representation) {
Label miss; Label miss;
Register reg = HandlerFrontendHeader(object, receiver(), holder, name, &miss); Register reg = HandlerFrontendHeader(type, receiver(), holder, name, &miss);
GenerateLoadField(reg, holder, field, representation); GenerateLoadField(reg, holder, field, representation);
...@@ -1264,11 +1265,11 @@ Handle<Code> LoadStubCompiler::CompileLoadField( ...@@ -1264,11 +1265,11 @@ Handle<Code> LoadStubCompiler::CompileLoadField(
Handle<Code> LoadStubCompiler::CompileLoadConstant( Handle<Code> LoadStubCompiler::CompileLoadConstant(
Handle<Object> object, Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<Object> value) { Handle<Object> value) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(type, receiver(), holder, name);
GenerateLoadConstant(value); GenerateLoadConstant(value);
// Return the generated code. // Return the generated code.
...@@ -1277,12 +1278,12 @@ Handle<Code> LoadStubCompiler::CompileLoadConstant( ...@@ -1277,12 +1278,12 @@ Handle<Code> LoadStubCompiler::CompileLoadConstant(
Handle<Code> LoadStubCompiler::CompileLoadCallback( Handle<Code> LoadStubCompiler::CompileLoadCallback(
Handle<Object> object, Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) { Handle<ExecutableAccessorInfo> callback) {
Register reg = CallbackHandlerFrontend( Register reg = CallbackHandlerFrontend(
object, receiver(), holder, name, callback); type, receiver(), holder, name, callback);
GenerateLoadCallback(reg, callback); GenerateLoadCallback(reg, callback);
// Return the generated code. // Return the generated code.
...@@ -1291,13 +1292,13 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback( ...@@ -1291,13 +1292,13 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
Handle<Code> LoadStubCompiler::CompileLoadCallback( Handle<Code> LoadStubCompiler::CompileLoadCallback(
Handle<Object> object, Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
const CallOptimization& call_optimization) { const CallOptimization& call_optimization) {
ASSERT(call_optimization.is_simple_api_call()); ASSERT(call_optimization.is_simple_api_call());
Handle<JSFunction> callback = call_optimization.constant_function(); Handle<JSFunction> callback = call_optimization.constant_function();
CallbackHandlerFrontend(object, receiver(), holder, name, callback); CallbackHandlerFrontend(type, receiver(), holder, name, callback);
GenerateLoadCallback(call_optimization); GenerateLoadCallback(call_optimization);
// Return the generated code. // Return the generated code.
...@@ -1306,16 +1307,16 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback( ...@@ -1306,16 +1307,16 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
Handle<Code> LoadStubCompiler::CompileLoadInterceptor( Handle<Code> LoadStubCompiler::CompileLoadInterceptor(
Handle<Object> object, Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name) { Handle<Name> name) {
LookupResult lookup(isolate()); LookupResult lookup(isolate());
LookupPostInterceptor(holder, name, &lookup); LookupPostInterceptor(holder, name, &lookup);
Register reg = HandlerFrontend(object, receiver(), holder, name); Register reg = HandlerFrontend(type, receiver(), holder, name);
// TODO(368): Compile in the whole chain: all the interceptors in // TODO(368): Compile in the whole chain: all the interceptors in
// prototypes and ultimate answer. // prototypes and ultimate answer.
GenerateLoadInterceptor(reg, object, holder, &lookup, name); GenerateLoadInterceptor(reg, type, holder, &lookup, name);
// Return the generated code. // Return the generated code.
return GetCode(kind(), Code::FAST, name); return GetCode(kind(), Code::FAST, name);
...@@ -1337,7 +1338,8 @@ void LoadStubCompiler::GenerateLoadPostInterceptor( ...@@ -1337,7 +1338,8 @@ void LoadStubCompiler::GenerateLoadPostInterceptor(
// We found FIELD property in prototype chain of interceptor's holder. // We found FIELD property in prototype chain of interceptor's holder.
// Retrieve a field from field's holder. // Retrieve a field from field's holder.
Register reg = HandlerFrontend( Register reg = HandlerFrontend(
interceptor_holder, interceptor_reg, holder, name); IC::CurrentTypeOf(interceptor_holder, isolate()),
interceptor_reg, holder, name);
GenerateLoadField( GenerateLoadField(
reg, holder, field, lookup->representation()); reg, holder, field, lookup->representation());
} }
...@@ -1350,7 +1352,8 @@ void LoadStubCompiler::GenerateLoadPostInterceptor( ...@@ -1350,7 +1352,8 @@ void LoadStubCompiler::GenerateLoadPostInterceptor(
ASSERT(callback->getter() != NULL); ASSERT(callback->getter() != NULL);
Register reg = CallbackHandlerFrontend( Register reg = CallbackHandlerFrontend(
interceptor_holder, interceptor_reg, holder, name, callback); IC::CurrentTypeOf(interceptor_holder, isolate()),
interceptor_reg, holder, name, callback);
GenerateLoadCallback(reg, callback); GenerateLoadCallback(reg, callback);
} }
} }
...@@ -1370,11 +1373,11 @@ Handle<Code> BaseLoadStoreStubCompiler::CompileMonomorphicIC( ...@@ -1370,11 +1373,11 @@ Handle<Code> BaseLoadStoreStubCompiler::CompileMonomorphicIC(
Handle<Code> LoadStubCompiler::CompileLoadViaGetter( Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
Handle<Object> object, Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<JSFunction> getter) { Handle<JSFunction> getter) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(type, receiver(), holder, name);
GenerateLoadViaGetter(masm(), receiver(), getter); GenerateLoadViaGetter(masm(), receiver(), getter);
// Return the generated code. // Return the generated code.
...@@ -1406,8 +1409,8 @@ Handle<Code> StoreStubCompiler::CompileStoreTransition( ...@@ -1406,8 +1409,8 @@ Handle<Code> StoreStubCompiler::CompileStoreTransition(
} while (holder->GetPrototype()->IsJSObject()); } while (holder->GetPrototype()->IsJSObject());
} }
Register holder_reg = Register holder_reg = HandlerFrontendHeader(
HandlerFrontendHeader(object, receiver(), holder, name, &miss); IC::CurrentTypeOf(object, isolate()), receiver(), holder, name, &miss);
// If no property was found, and the holder (the last object in the // If no property was found, and the holder (the last object in the
// prototype chain) is in slow mode, we need to do a negative lookup on the // prototype chain) is in slow mode, we need to do a negative lookup on the
...@@ -1444,7 +1447,8 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, ...@@ -1444,7 +1447,8 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object,
Handle<Name> name) { Handle<Name> name) {
Label miss; Label miss;
HandlerFrontendHeader(object, receiver(), object, name, &miss); HandlerFrontendHeader(IC::CurrentTypeOf(object, isolate()),
receiver(), object, name, &miss);
// Generate store field code. // Generate store field code.
GenerateStoreField(masm(), GenerateStoreField(masm(),
...@@ -1467,7 +1471,8 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( ...@@ -1467,7 +1471,8 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<JSFunction> setter) { Handle<JSFunction> setter) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
GenerateStoreViaSetter(masm(), setter); GenerateStoreViaSetter(masm(), setter);
return GetCode(kind(), Code::FAST, name); return GetCode(kind(), Code::FAST, name);
......
...@@ -87,7 +87,7 @@ class StubCache { ...@@ -87,7 +87,7 @@ class StubCache {
InlineCacheHolderFlag cache_holder = OWN_MAP); InlineCacheHolderFlag cache_holder = OWN_MAP);
Handle<Code> FindHandler(Handle<Name> name, Handle<Code> FindHandler(Handle<Name> name,
Handle<HeapObject> stub_holder, Handle<Map> map,
Code::Kind kind, Code::Kind kind,
InlineCacheHolderFlag cache_holder = OWN_MAP, InlineCacheHolderFlag cache_holder = OWN_MAP,
StrictModeFlag strict_mode = kNonStrictMode); StrictModeFlag strict_mode = kNonStrictMode);
...@@ -97,7 +97,7 @@ class StubCache { ...@@ -97,7 +97,7 @@ class StubCache {
Handle<Code> handler, Handle<Code> handler,
StrictModeFlag strict_mode); StrictModeFlag strict_mode);
Handle<Code> ComputeLoadNonexistent(Handle<Name> name, Handle<Object> object); Handle<Code> ComputeLoadNonexistent(Handle<Name> name, Handle<Type> type);
Handle<Code> ComputeKeyedLoadElement(Handle<Map> receiver_map); Handle<Code> ComputeKeyedLoadElement(Handle<Map> receiver_map);
...@@ -549,7 +549,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler { ...@@ -549,7 +549,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
} }
protected: protected:
virtual Register HandlerFrontendHeader(Handle<Object> object, virtual Register HandlerFrontendHeader(Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
...@@ -557,7 +557,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler { ...@@ -557,7 +557,7 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
virtual void HandlerFrontendFooter(Handle<Name> name, Label* miss) = 0; virtual void HandlerFrontendFooter(Handle<Name> name, Label* miss) = 0;
Register HandlerFrontend(Handle<Object> object, Register HandlerFrontend(Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name); Handle<Name> name);
...@@ -615,32 +615,32 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -615,32 +615,32 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
: BaseLoadStoreStubCompiler(isolate, kind, cache_holder) { } : BaseLoadStoreStubCompiler(isolate, kind, cache_holder) { }
virtual ~LoadStubCompiler() { } virtual ~LoadStubCompiler() { }
Handle<Code> CompileLoadField(Handle<Object> object, Handle<Code> CompileLoadField(Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
PropertyIndex index, PropertyIndex index,
Representation representation); Representation representation);
Handle<Code> CompileLoadCallback(Handle<Object> object, Handle<Code> CompileLoadCallback(Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback); Handle<ExecutableAccessorInfo> callback);
Handle<Code> CompileLoadCallback(Handle<Object> object, Handle<Code> CompileLoadCallback(Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
const CallOptimization& call_optimization); const CallOptimization& call_optimization);
Handle<Code> CompileLoadConstant(Handle<Object> object, Handle<Code> CompileLoadConstant(Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<Object> value); Handle<Object> value);
Handle<Code> CompileLoadInterceptor(Handle<Object> object, Handle<Code> CompileLoadInterceptor(Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name); Handle<Name> name);
Handle<Code> CompileLoadViaGetter(Handle<Object> object, Handle<Code> CompileLoadViaGetter(Handle<Type> type,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<JSFunction> getter); Handle<JSFunction> getter);
...@@ -649,12 +649,11 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -649,12 +649,11 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
Register receiver, Register receiver,
Handle<JSFunction> getter); Handle<JSFunction> getter);
Handle<Code> CompileLoadNonexistent(Handle<Object> object, Handle<Code> CompileLoadNonexistent(Handle<Type> type,
Handle<JSObject> last, Handle<JSObject> last,
Handle<Name> name, Handle<Name> name);
Handle<JSGlobalObject> global);
Handle<Code> CompileLoadGlobal(Handle<Object> object, Handle<Code> CompileLoadGlobal(Handle<Type> type,
Handle<GlobalObject> holder, Handle<GlobalObject> holder,
Handle<PropertyCell> cell, Handle<PropertyCell> cell,
Handle<Name> name, Handle<Name> name,
...@@ -663,7 +662,7 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -663,7 +662,7 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
static Register* registers(); static Register* registers();
protected: protected:
virtual Register HandlerFrontendHeader(Handle<Object> object, virtual Register HandlerFrontendHeader(Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
...@@ -671,15 +670,14 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -671,15 +670,14 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler {
virtual void HandlerFrontendFooter(Handle<Name> name, Label* miss); virtual void HandlerFrontendFooter(Handle<Name> name, Label* miss);
Register CallbackHandlerFrontend(Handle<Object> object, Register CallbackHandlerFrontend(Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<Object> callback); Handle<Object> callback);
void NonexistentHandlerFrontend(Handle<Object> object, void NonexistentHandlerFrontend(Handle<Type> type,
Handle<JSObject> last, Handle<JSObject> last,
Handle<Name> name, Handle<Name> name);
Handle<JSGlobalObject> global);
void GenerateLoadField(Register reg, void GenerateLoadField(Register reg,
Handle<JSObject> holder, Handle<JSObject> holder,
...@@ -812,7 +810,7 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler { ...@@ -812,7 +810,7 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler {
} }
protected: protected:
virtual Register HandlerFrontendHeader(Handle<Object> object, virtual Register HandlerFrontendHeader(Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
......
...@@ -1284,14 +1284,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) { ...@@ -1284,14 +1284,14 @@ void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
Register LoadStubCompiler::CallbackHandlerFrontend( Register LoadStubCompiler::CallbackHandlerFrontend(
Handle<Object> object, Handle<Type> type,
Register object_reg, Register object_reg,
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<Object> callback) { Handle<Object> callback) {
Label miss; Label miss;
Register reg = HandlerFrontendHeader(object, object_reg, holder, name, &miss); Register reg = HandlerFrontendHeader(type, object_reg, holder, name, &miss);
if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) {
ASSERT(!reg.is(scratch2())); ASSERT(!reg.is(scratch2()));
...@@ -2862,7 +2862,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -2862,7 +2862,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
Handle<ExecutableAccessorInfo> callback) { Handle<ExecutableAccessorInfo> callback) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
__ PopReturnAddressTo(scratch1()); __ PopReturnAddressTo(scratch1());
__ push(receiver()); __ push(receiver());
...@@ -2886,7 +2887,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( ...@@ -2886,7 +2887,8 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
Handle<JSObject> holder, Handle<JSObject> holder,
Handle<Name> name, Handle<Name> name,
const CallOptimization& call_optimization) { const CallOptimization& call_optimization) {
HandlerFrontend(object, receiver(), holder, name); HandlerFrontend(IC::CurrentTypeOf(object, isolate()),
receiver(), holder, name);
Register values[] = { value() }; Register values[] = { value() };
GenerateFastApiCall( GenerateFastApiCall(
...@@ -3000,12 +3002,10 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( ...@@ -3000,12 +3002,10 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
} }
Handle<Code> LoadStubCompiler::CompileLoadNonexistent( Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<Type> type,
Handle<Object> object, Handle<JSObject> last,
Handle<JSObject> last, Handle<Name> name) {
Handle<Name> name, NonexistentHandlerFrontend(type, last, name);
Handle<JSGlobalObject> global) {
NonexistentHandlerFrontend(object, last, name, global);
// Return undefined if maps of the full prototype chain are still the // Return undefined if maps of the full prototype chain are still the
// same and no global property with this name contains a value. // same and no global property with this name contains a value.
...@@ -3101,7 +3101,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, ...@@ -3101,7 +3101,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
Handle<Code> LoadStubCompiler::CompileLoadGlobal( Handle<Code> LoadStubCompiler::CompileLoadGlobal(
Handle<Object> object, Handle<Type> type,
Handle<GlobalObject> global, Handle<GlobalObject> global,
Handle<PropertyCell> cell, Handle<PropertyCell> cell,
Handle<Name> name, Handle<Name> name,
...@@ -3110,7 +3110,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal( ...@@ -3110,7 +3110,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
// TODO(verwaest): Directly store to rax. Currently we cannot do this, since // TODO(verwaest): Directly store to rax. Currently we cannot do this, since
// rax is used as receiver(), which we would otherwise clobber before a // rax is used as receiver(), which we would otherwise clobber before a
// potential miss. // potential miss.
HandlerFrontendHeader(object, receiver(), global, name, &miss); HandlerFrontendHeader(type, receiver(), global, name, &miss);
// Get the value from the cell. // Get the value from the cell.
__ Move(rbx, cell); __ Move(rbx, cell);
......
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