From: balazs.kilvady@imgtec.com Date: Wed, 30 Jul 2014 13:39:20 +0000 (+0000) Subject: MIPS: Encapsulate type in the PropertyHandlerCompiler. X-Git-Tag: upstream/4.7.83~7961 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50869d70a96a6a86c86229c89064780ff6f07c9d;p=platform%2Fupstream%2Fv8.git MIPS: Encapsulate type in the PropertyHandlerCompiler. Port r22700 (587340c) BUG= R=akos.palfi@imgtec.com Review URL: https://codereview.chromium.org/429863003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 166540d..f8c6507 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -725,10 +725,10 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, Register PropertyHandlerCompiler::CheckPrototypes( - Handle type, Register object_reg, Handle holder, - Register holder_reg, Register scratch1, Register scratch2, - Handle name, Label* miss, PrototypeCheckType check) { - Handle receiver_map(IC::TypeToMap(*type, isolate())); + Register object_reg, Handle holder, Register holder_reg, + Register scratch1, Register scratch2, Handle name, Label* miss, + PrototypeCheckType check) { + Handle receiver_map(IC::TypeToMap(*type(), isolate())); // Make sure there's no overlap between holder and object registers. ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); @@ -740,8 +740,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( int depth = 0; Handle current = Handle::null(); - if (type->IsConstant()) { - current = Handle::cast(type->AsConstant()->Value()); + if (type()->IsConstant()) { + current = Handle::cast(type()->AsConstant()->Value()); } Handle prototype = Handle::null(); Handle current_map = receiver_map; @@ -856,14 +856,13 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle name, Label* miss) { } -Register NamedLoadHandlerCompiler::CallbackFrontend(Handle type, - Register object_reg, +Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg, Handle holder, Handle name, Handle callback) { Label miss; - Register reg = FrontendHeader(type, object_reg, holder, name, &miss); + Register reg = FrontendHeader(object_reg, holder, name, &miss); if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { ASSERT(!reg.is(scratch2())); @@ -966,9 +965,8 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( void NamedLoadHandlerCompiler::GenerateLoadInterceptor( - Register holder_reg, Handle object, - Handle interceptor_holder, LookupResult* lookup, - Handle name) { + Register holder_reg, Handle interceptor_holder, + LookupResult* lookup, Handle name) { ASSERT(interceptor_holder->HasNamedInterceptor()); ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined()); @@ -981,10 +979,12 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor( compile_followup_inline = true; } else if (lookup->type() == CALLBACKS && lookup->GetCallbackObject()->IsExecutableAccessorInfo()) { - ExecutableAccessorInfo* callback = - ExecutableAccessorInfo::cast(lookup->GetCallbackObject()); - compile_followup_inline = callback->getter() != NULL && - callback->IsCompatibleReceiver(*object); + Handle callback( + ExecutableAccessorInfo::cast(lookup->GetCallbackObject())); + compile_followup_inline = + callback->getter() != NULL && + ExecutableAccessorInfo::IsCompatibleReceiverType(isolate(), callback, + type()); } } @@ -1052,8 +1052,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor( Handle NamedStoreHandlerCompiler::CompileStoreCallback( Handle object, Handle holder, Handle name, Handle callback) { - Register holder_reg = - Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name); + Register holder_reg = Frontend(receiver(), holder, name); // Stub never generated for non-global objects that require access // checks. @@ -1138,8 +1137,8 @@ Handle NamedStoreHandlerCompiler::CompileStoreInterceptor( Handle NamedLoadHandlerCompiler::CompileLoadNonexistent( - Handle type, Handle last, Handle name) { - NonexistentFrontend(type, last, name); + Handle last, Handle name) { + NonexistentFrontend(last, name); // Return undefined if maps of the full prototype chain is still the same. __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); @@ -1226,26 +1225,27 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( Handle NamedLoadHandlerCompiler::CompileLoadGlobal( - Handle type, Handle global, - Handle cell, Handle name, bool is_dont_delete) { + Handle global, Handle cell, Handle name, + bool is_dont_delete) { Label miss; - FrontendHeader(type, receiver(), global, name, &miss); + FrontendHeader(receiver(), global, name, &miss); // Get the value from the cell. - __ li(a3, Operand(cell)); - __ lw(t0, FieldMemOperand(a3, Cell::kValueOffset)); + Register result = StoreIC::ValueRegister(); + __ li(result, Operand(cell)); + __ lw(result, FieldMemOperand(result, Cell::kValueOffset)); // Check for deleted property if property can actually be deleted. if (!is_dont_delete) { __ LoadRoot(at, Heap::kTheHoleValueRootIndex); - __ Branch(&miss, eq, t0, Operand(at)); + __ Branch(&miss, eq, result, Operand(at)); } Counters* counters = isolate()->counters(); __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); __ Ret(USE_DELAY_SLOT); - __ mov(v0, t0); + __ mov(v0, result); FrontendFooter(name, &miss); diff --git a/src/mips64/stub-cache-mips64.cc b/src/mips64/stub-cache-mips64.cc index 2f3ba92..0279a51 100644 --- a/src/mips64/stub-cache-mips64.cc +++ b/src/mips64/stub-cache-mips64.cc @@ -726,10 +726,10 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, Register PropertyHandlerCompiler::CheckPrototypes( - Handle type, Register object_reg, Handle holder, - Register holder_reg, Register scratch1, Register scratch2, - Handle name, Label* miss, PrototypeCheckType check) { - Handle receiver_map(IC::TypeToMap(*type, isolate())); + Register object_reg, Handle holder, Register holder_reg, + Register scratch1, Register scratch2, Handle name, Label* miss, + PrototypeCheckType check) { + Handle receiver_map(IC::TypeToMap(*type(), isolate())); // Make sure there's no overlap between holder and object registers. ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); @@ -741,8 +741,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( int depth = 0; Handle current = Handle::null(); - if (type->IsConstant()) { - current = Handle::cast(type->AsConstant()->Value()); + if (type()->IsConstant()) { + current = Handle::cast(type()->AsConstant()->Value()); } Handle prototype = Handle::null(); Handle current_map = receiver_map; @@ -857,14 +857,13 @@ void NamedStoreHandlerCompiler::FrontendFooter(Handle name, Label* miss) { } -Register NamedLoadHandlerCompiler::CallbackFrontend(Handle type, - Register object_reg, +Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg, Handle holder, Handle name, Handle callback) { Label miss; - Register reg = FrontendHeader(type, object_reg, holder, name, &miss); + Register reg = FrontendHeader(object_reg, holder, name, &miss); if (!holder->HasFastProperties() && !holder->IsJSGlobalObject()) { ASSERT(!reg.is(scratch2())); @@ -967,9 +966,8 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback( void NamedLoadHandlerCompiler::GenerateLoadInterceptor( - Register holder_reg, Handle object, - Handle interceptor_holder, LookupResult* lookup, - Handle name) { + Register holder_reg, Handle interceptor_holder, + LookupResult* lookup, Handle name) { ASSERT(interceptor_holder->HasNamedInterceptor()); ASSERT(!interceptor_holder->GetNamedInterceptor()->getter()->IsUndefined()); @@ -982,10 +980,12 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor( compile_followup_inline = true; } else if (lookup->type() == CALLBACKS && lookup->GetCallbackObject()->IsExecutableAccessorInfo()) { - ExecutableAccessorInfo* callback = - ExecutableAccessorInfo::cast(lookup->GetCallbackObject()); - compile_followup_inline = callback->getter() != NULL && - callback->IsCompatibleReceiver(*object); + Handle callback( + ExecutableAccessorInfo::cast(lookup->GetCallbackObject())); + compile_followup_inline = + callback->getter() != NULL && + ExecutableAccessorInfo::IsCompatibleReceiverType(isolate(), callback, + type()); } } @@ -1053,8 +1053,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor( Handle NamedStoreHandlerCompiler::CompileStoreCallback( Handle object, Handle holder, Handle name, Handle callback) { - Register holder_reg = - Frontend(IC::CurrentTypeOf(object, isolate()), receiver(), holder, name); + Register holder_reg = Frontend(receiver(), holder, name); // Stub never generated for non-global objects that require access // checks. @@ -1139,8 +1138,8 @@ Handle NamedStoreHandlerCompiler::CompileStoreInterceptor( Handle NamedLoadHandlerCompiler::CompileLoadNonexistent( - Handle type, Handle last, Handle name) { - NonexistentFrontend(type, last, name); + Handle last, Handle name) { + NonexistentFrontend(last, name); // Return undefined if maps of the full prototype chain is still the same. __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); @@ -1227,26 +1226,27 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( Handle NamedLoadHandlerCompiler::CompileLoadGlobal( - Handle type, Handle global, - Handle cell, Handle name, bool is_dont_delete) { + Handle global, Handle cell, Handle name, + bool is_dont_delete) { Label miss; - FrontendHeader(type, receiver(), global, name, &miss); + FrontendHeader(receiver(), global, name, &miss); // Get the value from the cell. - __ li(a3, Operand(cell)); - __ ld(a4, FieldMemOperand(a3, Cell::kValueOffset)); + Register result = StoreIC::ValueRegister(); + __ li(result, Operand(cell)); + __ ld(result, FieldMemOperand(result, Cell::kValueOffset)); // Check for deleted property if property can actually be deleted. if (!is_dont_delete) { __ LoadRoot(at, Heap::kTheHoleValueRootIndex); - __ Branch(&miss, eq, a4, Operand(at)); + __ Branch(&miss, eq, result, Operand(at)); } Counters* counters = isolate()->counters(); __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); __ Ret(USE_DELAY_SLOT); - __ mov(v0, a4); + __ mov(v0, result); FrontendFooter(name, &miss);