| Index: src/ia32/builtins-ia32.cc
|
| ===================================================================
|
| --- src/ia32/builtins-ia32.cc (revision 8618)
|
| +++ src/ia32/builtins-ia32.cc (working copy)
|
| @@ -82,8 +82,7 @@
|
|
|
| Label non_function_call;
|
| // Check that function is not a smi.
|
| - __ test(edi, Immediate(kSmiTagMask));
|
| - __ j(zero, &non_function_call);
|
| + __ JumpIfSmi(edi, &non_function_call);
|
| // Check that function is a JSFunction.
|
| __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
|
| __ j(not_equal, &non_function_call);
|
| @@ -140,8 +139,7 @@
|
| // edi: constructor
|
| __ mov(eax, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset));
|
| // Will both indicate a NULL and a Smi
|
| - __ test(eax, Immediate(kSmiTagMask));
|
| - __ j(zero, &rt_call);
|
| + __ JumpIfSmi(eax, &rt_call);
|
| // edi: constructor
|
| // eax: initial map (if proven valid below)
|
| __ CmpObjectType(eax, MAP_TYPE, ebx);
|
| @@ -340,11 +338,12 @@
|
| Handle<Code> code =
|
| masm->isolate()->builtins()->HandleApiCallConstruct();
|
| ParameterCount expected(0);
|
| - __ InvokeCode(code, expected, expected,
|
| - RelocInfo::CODE_TARGET, CALL_FUNCTION);
|
| + __ InvokeCode(code, expected, expected, RelocInfo::CODE_TARGET,
|
| + CALL_FUNCTION, NullCallWrapper(), CALL_AS_METHOD);
|
| } else {
|
| ParameterCount actual(eax);
|
| - __ InvokeFunction(edi, actual, CALL_FUNCTION);
|
| + __ InvokeFunction(edi, actual, CALL_FUNCTION,
|
| + NullCallWrapper(), CALL_AS_METHOD);
|
| }
|
|
|
| // Restore context from the frame.
|
| @@ -356,12 +355,11 @@
|
| Label use_receiver, exit;
|
|
|
| // If the result is a smi, it is *not* an object in the ECMA sense.
|
| - __ test(eax, Immediate(kSmiTagMask));
|
| - __ j(zero, &use_receiver);
|
| + __ JumpIfSmi(eax, &use_receiver);
|
|
|
| // If the type of the result (stored in its map) is less than
|
| - // FIRST_JS_OBJECT_TYPE, it is not an object in the ECMA sense.
|
| - __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ecx);
|
| + // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense.
|
| + __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx);
|
| __ j(above_equal, &exit);
|
|
|
| // Throw away the result of the constructor invocation and use the
|
| @@ -443,7 +441,8 @@
|
| RelocInfo::CODE_TARGET);
|
| } else {
|
| ParameterCount actual(eax);
|
| - __ InvokeFunction(edi, actual, CALL_FUNCTION);
|
| + __ InvokeFunction(edi, actual, CALL_FUNCTION,
|
| + NullCallWrapper(), CALL_AS_METHOD);
|
| }
|
|
|
| // Exit the JS frame. Notice that this also removes the empty
|
| @@ -594,8 +593,7 @@
|
| Label non_function;
|
| // 1 ~ return address.
|
| __ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize));
|
| - __ test(edi, Immediate(kSmiTagMask));
|
| - __ j(zero, &non_function);
|
| + __ JumpIfSmi(edi, &non_function);
|
| __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
|
| __ j(not_equal, &non_function);
|
|
|
| @@ -613,8 +611,8 @@
|
| __ j(not_equal, &shift_arguments);
|
|
|
| // Do not transform the receiver for natives (shared already in ebx).
|
| - __ test_b(FieldOperand(ebx, SharedFunctionInfo::kES5NativeByteOffset),
|
| - 1 << SharedFunctionInfo::kES5NativeBitWithinByte);
|
| + __ test_b(FieldOperand(ebx, SharedFunctionInfo::kNativeByteOffset),
|
| + 1 << SharedFunctionInfo::kNativeBitWithinByte);
|
| __ j(not_equal, &shift_arguments);
|
|
|
| // Compute the receiver in non-strict mode.
|
| @@ -622,15 +620,13 @@
|
|
|
| // Call ToObject on the receiver if it is not an object, or use the
|
| // global object if it is null or undefined.
|
| - __ test(ebx, Immediate(kSmiTagMask));
|
| - __ j(zero, &convert_to_object);
|
| + __ JumpIfSmi(ebx, &convert_to_object);
|
| __ cmp(ebx, factory->null_value());
|
| __ j(equal, &use_global_receiver);
|
| __ cmp(ebx, factory->undefined_value());
|
| __ j(equal, &use_global_receiver);
|
| - STATIC_ASSERT(LAST_JS_OBJECT_TYPE + 1 == LAST_TYPE);
|
| - STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
|
| - __ CmpObjectType(ebx, FIRST_JS_OBJECT_TYPE, ecx);
|
| + STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
|
| + __ CmpObjectType(ebx, FIRST_SPEC_OBJECT_TYPE, ecx);
|
| __ j(above_equal, &shift_arguments);
|
|
|
| __ bind(&convert_to_object);
|
| @@ -715,7 +711,8 @@
|
| masm->isolate()->builtins()->ArgumentsAdaptorTrampoline());
|
|
|
| ParameterCount expected(0);
|
| - __ InvokeCode(Operand(edx), expected, expected, JUMP_FUNCTION);
|
| + __ InvokeCode(Operand(edx), expected, expected, JUMP_FUNCTION,
|
| + NullCallWrapper(), CALL_AS_METHOD);
|
| }
|
|
|
|
|
| @@ -777,22 +774,20 @@
|
| Factory* factory = masm->isolate()->factory();
|
|
|
| // Do not transform the receiver for natives (shared already in ecx).
|
| - __ test_b(FieldOperand(ecx, SharedFunctionInfo::kES5NativeByteOffset),
|
| - 1 << SharedFunctionInfo::kES5NativeBitWithinByte);
|
| + __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset),
|
| + 1 << SharedFunctionInfo::kNativeBitWithinByte);
|
| __ j(not_equal, &push_receiver);
|
|
|
| // Compute the receiver in non-strict mode.
|
| // Call ToObject on the receiver if it is not an object, or use the
|
| // global object if it is null or undefined.
|
| - __ test(ebx, Immediate(kSmiTagMask));
|
| - __ j(zero, &call_to_object);
|
| + __ JumpIfSmi(ebx, &call_to_object);
|
| __ cmp(ebx, factory->null_value());
|
| __ j(equal, &use_global_receiver);
|
| __ cmp(ebx, factory->undefined_value());
|
| __ j(equal, &use_global_receiver);
|
| - STATIC_ASSERT(LAST_JS_OBJECT_TYPE + 1 == LAST_TYPE);
|
| - STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
|
| - __ CmpObjectType(ebx, FIRST_JS_OBJECT_TYPE, ecx);
|
| + STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
|
| + __ CmpObjectType(ebx, FIRST_SPEC_OBJECT_TYPE, ecx);
|
| __ j(above_equal, &push_receiver);
|
|
|
| __ bind(&call_to_object);
|
| @@ -845,7 +840,8 @@
|
| ParameterCount actual(eax);
|
| __ SmiUntag(eax);
|
| __ mov(edi, Operand(ebp, 4 * kPointerSize));
|
| - __ InvokeFunction(edi, actual, CALL_FUNCTION);
|
| + __ InvokeFunction(edi, actual, CALL_FUNCTION,
|
| + NullCallWrapper(), CALL_AS_METHOD);
|
|
|
| __ LeaveInternalFrame();
|
| __ ret(3 * kPointerSize); // remove this, receiver, and arguments
|
| @@ -1388,8 +1384,7 @@
|
| Label convert_argument;
|
| __ bind(¬_cached);
|
| STATIC_ASSERT(kSmiTag == 0);
|
| - __ test(eax, Immediate(kSmiTagMask));
|
| - __ j(zero, &convert_argument);
|
| + __ JumpIfSmi(eax, &convert_argument);
|
| Condition is_string = masm->IsObjectStringType(eax, ebx, ecx);
|
| __ j(NegateCondition(is_string), &convert_argument);
|
| __ mov(ebx, eax);
|
|
|