| 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..b3753f72a30f76f6a0021f52557bf196a32fde38 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) {
|
| @@ -2613,11 +2612,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 +2705,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 +2716,14 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object,
|
| }
|
| }
|
|
|
| - __ jmp(success);
|
| + Label success;
|
| + __ jmp(&success);
|
|
|
| // Handle call cache miss.
|
| __ bind(&miss);
|
| GenerateMissBranch();
|
| +
|
| + __ bind(&success);
|
| }
|
|
|
|
|
| @@ -2747,10 +2753,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 +2888,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 +2912,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 +3019,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, global);
|
|
|
| - NonexistentHandlerFrontend(object, last, name, &success, 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 +3114,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 +3139,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);
|
|
|