| Index: src/ia32/stub-cache-ia32.cc
|
| diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
|
| index 23e2398b34657d6efbd0f25f7a99bd026de21925..b839333288c2c2f336ae44df284a2c4ed8c6613e 100644
|
| --- a/src/ia32/stub-cache-ia32.cc
|
| +++ b/src/ia32/stub-cache-ia32.cc
|
| @@ -1267,34 +1267,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()) {
|
| - __ jmp(success);
|
| + Label success;
|
| + __ jmp(&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()) {
|
| - __ jmp(success);
|
| + Label success;
|
| + __ jmp(&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;
|
|
|
| @@ -1344,7 +1343,7 @@ Register LoadStubCompiler::CallbackHandlerFrontend(
|
| __ j(not_equal, &miss);
|
| }
|
|
|
| - HandlerFrontendFooter(name, success, &miss);
|
| + HandlerFrontendFooter(name, &miss);
|
| return reg;
|
| }
|
|
|
| @@ -1450,7 +1449,7 @@ void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
|
|
|
| void LoadStubCompiler::GenerateLoadInterceptor(
|
| Register holder_reg,
|
| - Handle<JSObject> object,
|
| + Handle<Object> object,
|
| Handle<JSObject> interceptor_holder,
|
| LookupResult* lookup,
|
| Handle<Name> name) {
|
| @@ -1705,7 +1704,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);
|
| __ mov(eax, Immediate(argc));
|
| __ mov(ebx, site_feedback_cell);
|
| @@ -1737,8 +1736,10 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| // -- esp[(argc + 1) * 4] : receiver
|
| // -----------------------------------
|
|
|
| - // If object is not an array, bail out to regular call.
|
| - if (!object->IsJSArray() || !cell.is_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();
|
| }
|
|
|
| @@ -1996,8 +1997,10 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| // -- esp[(argc + 1) * 4] : receiver
|
| // -----------------------------------
|
|
|
| - // If object is not an array, bail out to regular call.
|
| - if (!object->IsJSArray() || !cell.is_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();
|
| }
|
|
|
| @@ -2613,11 +2616,21 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
| }
|
|
|
|
|
| +void StubCompiler::GenerateBooleanCheck(Register object, Label* miss) {
|
| + Label success;
|
| + // Check that the object is a boolean.
|
| + __ cmp(object, factory()->true_value());
|
| + __ j(equal, &success);
|
| + __ cmp(object, factory()->false_value());
|
| + __ j(not_equal, miss);
|
| + __ 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 -------------
|
| // -- ecx : name
|
| // -- esp[0] : return address
|
| @@ -2696,13 +2709,7 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| break;
|
| }
|
| case BOOLEAN_CHECK: {
|
| - Label fast;
|
| - // Check that the object is a boolean.
|
| - __ cmp(edx, factory()->true_value());
|
| - __ j(equal, &fast);
|
| - __ cmp(edx, factory()->false_value());
|
| - __ j(not_equal, &miss);
|
| - __ bind(&fast);
|
| + GenerateBooleanCheck(edx, &miss);
|
| // Check that the maps starting from the prototype haven't changed.
|
| GenerateDirectLoadGlobalFunctionPrototype(
|
| masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss);
|
| @@ -2713,11 +2720,14 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| }
|
| }
|
|
|
| - __ jmp(success);
|
| + Label success;
|
| + __ jmp(&success);
|
|
|
| // Handle call cache miss.
|
| __ bind(&miss);
|
| GenerateMissBranch();
|
| +
|
| + __ bind(&success);
|
| }
|
|
|
|
|
| @@ -2747,10 +2757,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.
|
| @@ -2885,9 +2892,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);
|
|
|
| __ pop(scratch1()); // remove the return address
|
| __ push(receiver());
|
| @@ -2911,9 +2916,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(
|
| @@ -3020,15 +3023,12 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
|
|
|
|
|
| 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, &success, global);
|
| + NonexistentHandlerFrontend(object, last, name, global);
|
|
|
| - __ bind(&success);
|
| // Return undefined if maps of the full prototype chain are still the
|
| // same and no global property with this name contains a value.
|
| __ mov(eax, isolate()->factory()->undefined_value());
|
| @@ -3118,12 +3118,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);
|
| // Get the value from the cell.
|
| @@ -3143,8 +3143,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
| __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
|
| }
|
|
|
| - HandlerFrontendFooter(name, &success, &miss);
|
| - __ bind(&success);
|
| + HandlerFrontendFooter(name, &miss);
|
|
|
| Counters* counters = isolate()->counters();
|
| __ IncrementCounter(counters->named_load_global_stub(), 1);
|
| @@ -3168,16 +3167,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();
|
| __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
|
| int receiver_count = receiver_maps->length();
|
| int number_of_handled_maps = 0;
|
| + 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++;
|
| __ cmp(map_reg, map);
|
| + if (map.is_identical_to(heap_number_map)) {
|
| + ASSERT(!number_case.is_unused());
|
| + __ bind(&number_case);
|
| + }
|
| __ j(equal, handlers->at(current));
|
| }
|
| }
|
|
|