| Index: src/mips/stub-cache-mips.cc
|
| diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc
|
| index 27be2d45147836c34c4ad0b2d96fe89665d6f8dc..25edc6d2e9c65b555c6b6da5854789552e0127db 100644
|
| --- a/src/mips/stub-cache-mips.cc
|
| +++ b/src/mips/stub-cache-mips.cc
|
| @@ -1287,34 +1287,33 @@ Register StubCompiler::CheckPrototypes(Handle<JSObject> object,
|
| }
|
|
|
|
|
| -void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name,
|
| - Label* success,
|
| - Label* miss) {
|
| +void LoadStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
|
| if (!miss->is_unused()) {
|
| - __ Branch(success);
|
| + Label success;
|
| + __ Branch(&success);
|
| __ bind(miss);
|
| TailCallBuiltin(masm(), MissBuiltin(kind()));
|
| + __ bind(&success);
|
| }
|
| }
|
|
|
|
|
| -void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name,
|
| - Label* success,
|
| - Label* miss) {
|
| +void StoreStubCompiler::HandlerFrontendFooter(Handle<Name> name, Label* miss) {
|
| if (!miss->is_unused()) {
|
| - __ b(success);
|
| + Label success;
|
| + __ Branch(&success);
|
| GenerateRestoreName(masm(), miss, name);
|
| TailCallBuiltin(masm(), MissBuiltin(kind()));
|
| + __ bind(&success);
|
| }
|
| }
|
|
|
|
|
| Register LoadStubCompiler::CallbackHandlerFrontend(
|
| - Handle<JSObject> object,
|
| + Handle<Object> object,
|
| Register object_reg,
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| - Label* success,
|
| Handle<Object> callback) {
|
| Label miss;
|
|
|
| @@ -1350,7 +1349,7 @@ Register LoadStubCompiler::CallbackHandlerFrontend(
|
| __ Branch(&miss, ne, scratch2(), Operand(callback));
|
| }
|
|
|
| - HandlerFrontendFooter(name, success, &miss);
|
| + HandlerFrontendFooter(name, &miss);
|
| return reg;
|
| }
|
|
|
| @@ -1460,7 +1459,7 @@ void LoadStubCompiler::GenerateLoadCallback(
|
|
|
| void LoadStubCompiler::GenerateLoadInterceptor(
|
| Register holder_reg,
|
| - Handle<JSObject> object,
|
| + Handle<Object> object,
|
| Handle<JSObject> interceptor_holder,
|
| LookupResult* lookup,
|
| Handle<Name> name) {
|
| @@ -1673,7 +1672,7 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall(
|
| }
|
|
|
| Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite();
|
| - site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind()));
|
| + site->SetElementsKind(GetInitialFastElementsKind());
|
| Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site);
|
| __ li(a0, Operand(argc));
|
| __ li(a2, Operand(site_feedback_cell));
|
| @@ -1705,8 +1704,12 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| // -- sp[argc * 4] : receiver
|
| // -----------------------------------
|
|
|
| - // If object is not an array, bail out to regular call.
|
| - if (!object->IsJSArray() || !cell.is_null()) return Handle<Code>::null();
|
| + // If object is not an array or is observed, bail out to regular call.
|
| + if (!object->IsJSArray() ||
|
| + !cell.is_null() ||
|
| + Handle<JSArray>::cast(object)->map()->is_observed()) {
|
| + return Handle<Code>::null();
|
| + }
|
|
|
| Label miss;
|
|
|
| @@ -1960,8 +1963,12 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| // -- sp[argc * 4] : receiver
|
| // -----------------------------------
|
|
|
| - // If object is not an array, bail out to regular call.
|
| - if (!object->IsJSArray() || !cell.is_null()) return Handle<Code>::null();
|
| + // If object is not an array or is observed, bail out to regular call.
|
| + if (!object->IsJSArray() ||
|
| + !cell.is_null() ||
|
| + Handle<JSArray>::cast(object)->map()->is_observed()) {
|
| + return Handle<Code>::null();
|
| + }
|
|
|
| Label miss, return_undefined, call_builtin;
|
| Register receiver = a1;
|
| @@ -2550,11 +2557,21 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
| }
|
|
|
|
|
| +void StubCompiler::GenerateBooleanCheck(Register object, Label* miss) {
|
| + Label success;
|
| + // Check that the object is a boolean.
|
| + __ LoadRoot(at, Heap::kTrueValueRootIndex);
|
| + __ Branch(&success, eq, object, Operand(at));
|
| + __ LoadRoot(at, Heap::kFalseValueRootIndex);
|
| + __ Branch(miss, ne, object, Operand(at));
|
| + __ bind(&success);
|
| +}
|
| +
|
| +
|
| void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| - CheckType check,
|
| - Label* success) {
|
| + CheckType check) {
|
| // ----------- S t a t e -------------
|
| // -- a2 : name
|
| // -- ra : return address
|
| @@ -2630,13 +2647,8 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| break;
|
| }
|
| case BOOLEAN_CHECK: {
|
| - Label fast;
|
| - // Check that the object is a boolean.
|
| - __ LoadRoot(t0, Heap::kTrueValueRootIndex);
|
| - __ Branch(&fast, eq, a1, Operand(t0));
|
| - __ LoadRoot(t0, Heap::kFalseValueRootIndex);
|
| - __ Branch(&miss, ne, a1, Operand(t0));
|
| - __ bind(&fast);
|
| + GenerateBooleanCheck(a1, &miss);
|
| +
|
| // Check that the maps starting from the prototype haven't changed.
|
| GenerateDirectLoadGlobalFunctionPrototype(
|
| masm(), Context::BOOLEAN_FUNCTION_INDEX, a0, &miss);
|
| @@ -2647,12 +2659,15 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| }
|
| }
|
|
|
| - __ jmp(success);
|
| + Label success;
|
| + __ Branch(&success);
|
|
|
| // Handle call cache miss.
|
| __ bind(&miss);
|
|
|
| GenerateMissBranch();
|
| +
|
| + __ bind(&success);
|
| }
|
|
|
|
|
| @@ -2681,10 +2696,7 @@ Handle<Code> CallStubCompiler::CompileCallConstant(
|
| if (!code.is_null()) return code;
|
| }
|
|
|
| - Label success;
|
| -
|
| - CompileHandlerFrontend(object, holder, name, check, &success);
|
| - __ bind(&success);
|
| + CompileHandlerFrontend(object, holder, name, check);
|
| CompileHandlerBackend(function);
|
|
|
| // Return the generated code.
|
| @@ -2798,9 +2810,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| Handle<ExecutableAccessorInfo> callback) {
|
| - Label success;
|
| - HandlerFrontend(object, receiver(), holder, name, &success);
|
| - __ bind(&success);
|
| + HandlerFrontend(object, receiver(), holder, name);
|
|
|
| // Stub never generated for non-global objects that require access
|
| // checks.
|
| @@ -2827,9 +2837,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
|
| Handle<JSObject> holder,
|
| Handle<Name> name,
|
| const CallOptimization& call_optimization) {
|
| - Label success;
|
| - HandlerFrontend(object, receiver(), holder, name, &success);
|
| - __ bind(&success);
|
| + HandlerFrontend(object, receiver(), holder, name);
|
|
|
| Register values[] = { value() };
|
| GenerateFastApiCall(
|
| @@ -2925,15 +2933,12 @@ Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
|
|
|
|
|
| Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
| - Handle<JSObject> object,
|
| + Handle<Object> object,
|
| Handle<JSObject> last,
|
| Handle<Name> name,
|
| Handle<JSGlobalObject> global) {
|
| - Label success;
|
| + NonexistentHandlerFrontend(object, last, name, global);
|
|
|
| - NonexistentHandlerFrontend(object, last, name, &success, global);
|
| -
|
| - __ bind(&success);
|
| // Return undefined if maps of the full prototype chain is still the same.
|
| __ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
|
| __ Ret();
|
| @@ -3025,12 +3030,12 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
|
|
|
|
| Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
| - Handle<JSObject> object,
|
| + Handle<Object> object,
|
| Handle<GlobalObject> global,
|
| Handle<PropertyCell> cell,
|
| Handle<Name> name,
|
| bool is_dont_delete) {
|
| - Label success, miss;
|
| + Label miss;
|
|
|
| HandlerFrontendHeader(object, receiver(), global, name, &miss);
|
|
|
| @@ -3044,8 +3049,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
| __ Branch(&miss, eq, t0, Operand(at));
|
| }
|
|
|
| - HandlerFrontendFooter(name, &success, &miss);
|
| - __ bind(&success);
|
| + HandlerFrontendFooter(name, &miss);
|
|
|
| Counters* counters = isolate()->counters();
|
| __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3);
|
| @@ -3069,16 +3073,24 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
|
| GenerateNameCheck(name, this->name(), &miss);
|
| }
|
|
|
| - __ JumpIfSmi(receiver(), &miss);
|
| + Label number_case;
|
| + Label* smi_target = HasHeapNumberMap(receiver_maps) ? &number_case : &miss;
|
| + __ JumpIfSmi(receiver(), smi_target);
|
| +
|
| Register map_reg = scratch1();
|
|
|
| int receiver_count = receiver_maps->length();
|
| int number_of_handled_maps = 0;
|
| __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
|
| + Handle<Map> heap_number_map = isolate()->factory()->heap_number_map();
|
| for (int current = 0; current < receiver_count; ++current) {
|
| Handle<Map> map = receiver_maps->at(current);
|
| if (!map->is_deprecated()) {
|
| number_of_handled_maps++;
|
| + if (map.is_identical_to(heap_number_map)) {
|
| + ASSERT(!number_case.is_unused());
|
| + __ bind(&number_case);
|
| + }
|
| __ Jump(handlers->at(current), RelocInfo::CODE_TARGET,
|
| eq, map_reg, Operand(receiver_maps->at(current)));
|
| }
|
|
|