Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index 9b2ba53bde0aa1b1f388922db8dac18e42a95a36..06ef9319dd8a3dda537eeb7b697a3d5f14f3c9d5 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -757,13 +757,6 @@ static void GenerateCallFunction(MacroAssembler* masm, |
__ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE); |
__ b(ne, miss); |
- // Patch the receiver on the stack with the global proxy if |
- // necessary. |
- if (object->IsGlobalObject()) { |
- __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); |
- __ str(r3, MemOperand(sp, arguments.immediate() * kPointerSize)); |
- } |
- |
Igor Sheludko
2013/11/25 16:31:53
Non-equivalent modification for one of the Generat
Toon Verwaest
2013/11/27 15:16:55
Done.
|
// Invoke the function. |
CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state) |
? CALL_AS_FUNCTION |
@@ -1549,25 +1542,6 @@ void CallStubCompiler::GenerateNameCheck(Handle<Name> name, Label* miss) { |
} |
-void CallStubCompiler::GenerateGlobalReceiverCheck(Handle<JSObject> object, |
- Handle<JSObject> holder, |
- Handle<Name> name, |
- Label* miss) { |
- ASSERT(holder->IsGlobalObject()); |
- |
- // Get the number of arguments. |
- const int argc = arguments().immediate(); |
- |
- // Get the receiver from the stack. |
- __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
- |
- // Check that the maps haven't changed. |
- __ JumpIfSmi(r0, miss); |
- CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), r0, holder, r3, r1, r4, name, miss); |
-} |
- |
- |
void CallStubCompiler::GenerateLoadFunctionFromCell( |
Handle<Cell> cell, |
Handle<JSFunction> function, |
@@ -1611,33 +1585,16 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, |
Handle<JSObject> holder, |
PropertyIndex index, |
Handle<Name> name) { |
- // ----------- S t a t e ------------- |
- // -- r2 : name |
- // -- lr : return address |
- // ----------------------------------- |
Igor Sheludko
2013/11/25 16:31:53
Are these (and similar) comments really useless he
Toon Verwaest
2013/11/27 15:16:55
Yes they are. Look at Load/Store, that's what I wa
|
Label miss; |
- GenerateNameCheck(name, &miss); |
- |
- const int argc = arguments().immediate(); |
- |
- // Get the receiver of the function from the stack into r0. |
- __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
- // Check that the receiver isn't a smi. |
- __ JumpIfSmi(r0, &miss); |
- |
- // Do the right check and compute the holder register. |
- Register reg = CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), |
- r0, holder, r1, r3, r4, name, &miss); |
+ Register reg = HandlerFrontendHeader( |
+ object, holder, name, RECEIVER_MAP_CHECK, &miss); |
GenerateFastPropertyLoad(masm(), r1, reg, index.is_inobject(holder), |
index.translate(holder), Representation::Tagged()); |
GenerateCallFunction(masm(), object, arguments(), &miss, extra_state_); |
- // Handle call cache miss. |
- __ bind(&miss); |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(Code::FAST, name); |
@@ -1653,31 +1610,16 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall( |
Code::StubType type) { |
Label miss; |
- // Check that function is still array |
- const int argc = arguments().immediate(); |
- GenerateNameCheck(name, &miss); |
- Register receiver = r1; |
- |
- if (cell.is_null()) { |
- __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); |
- |
- // Check that the receiver isn't a smi. |
- __ JumpIfSmi(receiver, &miss); |
- |
- // Check that the maps haven't changed. |
- CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), receiver, holder, |
- r3, r0, r4, name, &miss); |
- } else { |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
Igor Sheludko
2013/11/25 16:31:53
Eagle's eye!
|
+ if (!cell.is_null()) { |
ASSERT(cell->value() == *function); |
- GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, |
- &miss); |
GenerateLoadFunctionFromCell(cell, function, &miss); |
} |
Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite(); |
site->SetElementsKind(GetInitialFastElementsKind()); |
Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site); |
+ const int argc = arguments().immediate(); |
__ mov(r0, Operand(argc)); |
__ mov(r2, Operand(site_feedback_cell)); |
__ mov(r1, Operand(function)); |
@@ -1685,8 +1627,7 @@ Handle<Code> CallStubCompiler::CompileArrayCodeCall( |
ArrayConstructorStub stub(isolate()); |
__ TailCallStub(&stub); |
- __ bind(&miss); |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(type, name); |
@@ -1700,14 +1641,6 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
// If object is not an array or is observed, bail out to regular call. |
if (!object->IsJSArray() || |
!cell.is_null() || |
@@ -1716,21 +1649,11 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall( |
} |
Label miss; |
- GenerateNameCheck(name, &miss); |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
Register receiver = r1; |
- // Get the receiver from the stack |
- const int argc = arguments().immediate(); |
- __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); |
- |
- // Check that the receiver isn't a smi. |
- __ JumpIfSmi(receiver, &miss); |
- |
- // Check that the maps haven't changed. |
- CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), receiver, holder, |
- r3, r0, r4, name, &miss); |
+ const int argc = arguments().immediate(); |
if (argc == 0) { |
// Nothing to do, just return the length. |
__ ldr(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
@@ -1943,9 +1866,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall( |
ExternalReference(Builtins::c_ArrayPush, isolate()), argc + 1, 1); |
} |
- // Handle call cache miss. |
- __ bind(&miss); |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(type, name); |
@@ -1959,14 +1880,6 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
// If object is not an array or is observed, bail out to regular call. |
if (!object->IsJSArray() || |
!cell.is_null() || |
@@ -1977,17 +1890,8 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall( |
Label miss, return_undefined, call_builtin; |
Register receiver = r1; |
Register elements = r3; |
- GenerateNameCheck(name, &miss); |
- // Get the receiver from the stack |
- const int argc = arguments().immediate(); |
- __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); |
- // Check that the receiver isn't a smi. |
- __ JumpIfSmi(receiver, &miss); |
- |
- // Check that the maps haven't changed. |
- CheckPrototypes(IC::CurrentTypeOf(object, isolate()), receiver, holder, |
- elements, r4, r0, name, &miss); |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
// Get the elements array of the object. |
__ ldr(elements, FieldMemOperand(receiver, JSArray::kElementsOffset)); |
@@ -2018,6 +1922,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall( |
// Fill with the hole. |
__ str(r6, FieldMemOperand(elements, FixedArray::kHeaderSize)); |
+ const int argc = arguments().immediate(); |
__ Drop(argc + 1); |
__ Ret(); |
@@ -2030,9 +1935,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall( |
__ TailCallExternalReference( |
ExternalReference(Builtins::c_ArrayPop, isolate()), argc + 1, 1); |
- // Handle call cache miss. |
- __ bind(&miss); |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(type, name); |
@@ -2046,18 +1949,9 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : function name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
// If object is not a string, bail out to regular call. |
if (!object->IsString() || !cell.is_null()) return Handle<Code>::null(); |
- const int argc = arguments().immediate(); |
Label miss; |
Label name_miss; |
Label index_out_of_range; |
@@ -2068,22 +1962,13 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( |
DEFAULT_STRING_STUB)) { |
index_out_of_range_label = &miss; |
} |
- GenerateNameCheck(name, &name_miss); |
- |
- // Check that the maps starting from the prototype haven't changed. |
- GenerateDirectLoadGlobalFunctionPrototype(masm(), |
- Context::STRING_FUNCTION_INDEX, |
- r0, |
- &miss); |
- ASSERT(!object.is_identical_to(holder)); |
- Handle<JSObject> prototype(JSObject::cast(object->GetPrototype(isolate()))); |
- CheckPrototypes( |
- IC::CurrentTypeOf(prototype, isolate()), |
- r0, holder, r1, r3, r4, name, &miss); |
+ |
+ HandlerFrontendHeader(object, holder, name, STRING_CHECK, &name_miss); |
Register receiver = r1; |
Register index = r4; |
Register result = r0; |
+ const int argc = arguments().immediate(); |
__ ldr(receiver, MemOperand(sp, argc * kPointerSize)); |
if (argc > 0) { |
__ ldr(index, MemOperand(sp, (argc - 1) * kPointerSize)); |
@@ -2130,14 +2015,6 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : function name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
// If object is not a string, bail out to regular call. |
if (!object->IsString() || !cell.is_null()) return Handle<Code>::null(); |
@@ -2151,18 +2028,8 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( |
DEFAULT_STRING_STUB)) { |
index_out_of_range_label = &miss; |
} |
- GenerateNameCheck(name, &name_miss); |
- |
- // Check that the maps starting from the prototype haven't changed. |
- GenerateDirectLoadGlobalFunctionPrototype(masm(), |
- Context::STRING_FUNCTION_INDEX, |
- r0, |
- &miss); |
- ASSERT(!object.is_identical_to(holder)); |
- Handle<JSObject> prototype(JSObject::cast(object->GetPrototype(isolate()))); |
- CheckPrototypes( |
- IC::CurrentTypeOf(prototype, isolate()), |
- r0, holder, r1, r3, r4, name, &miss); |
+ |
+ HandlerFrontendHeader(object, holder, name, STRING_CHECK, &name_miss); |
Register receiver = r0; |
Register index = r4; |
@@ -2215,14 +2082,6 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : function name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
const int argc = arguments().immediate(); |
// If the object is not a JSObject or we got an unexpected number of |
@@ -2230,20 +2089,10 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( |
if (!object->IsJSObject() || argc != 1) return Handle<Code>::null(); |
Label miss; |
- GenerateNameCheck(name, &miss); |
- |
- if (cell.is_null()) { |
- __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
- __ JumpIfSmi(r1, &miss); |
- |
- CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), |
- r1, holder, r0, r3, r4, name, &miss); |
- } else { |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
+ if (!cell.is_null()) { |
ASSERT(cell->value() == *function); |
- GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, |
- &miss); |
GenerateLoadFunctionFromCell(cell, function, &miss); |
} |
@@ -2273,9 +2122,7 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( |
__ InvokeFunction(function, expected, arguments(), |
JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
- __ bind(&miss); |
- // r2: function name. |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(type, name); |
@@ -2289,32 +2136,16 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : function name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
const int argc = arguments().immediate(); |
// If the object is not a JSObject or we got an unexpected number of |
// arguments, bail out to the regular call. |
if (!object->IsJSObject() || argc != 1) return Handle<Code>::null(); |
Label miss, slow; |
- GenerateNameCheck(name, &miss); |
- if (cell.is_null()) { |
- __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
- __ JumpIfSmi(r1, &miss); |
- CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), |
- r1, holder, r0, r3, r4, name, &miss); |
- } else { |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
+ if (!cell.is_null()) { |
ASSERT(cell->value() == *function); |
- GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, |
- &miss); |
GenerateLoadFunctionFromCell(cell, function, &miss); |
} |
@@ -2383,9 +2214,7 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall( |
__ InvokeFunction(function, expected, arguments(), |
JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
- __ bind(&miss); |
- // r2: function name. |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(type, name); |
@@ -2399,31 +2228,16 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall( |
Handle<JSFunction> function, |
Handle<String> name, |
Code::StubType type) { |
- // ----------- S t a t e ------------- |
- // -- r2 : function name |
- // -- lr : return address |
- // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
- // -- ... |
- // -- sp[argc * 4] : receiver |
- // ----------------------------------- |
- |
const int argc = arguments().immediate(); |
// If the object is not a JSObject or we got an unexpected number of |
// arguments, bail out to the regular call. |
if (!object->IsJSObject() || argc != 1) return Handle<Code>::null(); |
Label miss; |
- GenerateNameCheck(name, &miss); |
- if (cell.is_null()) { |
- __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
- __ JumpIfSmi(r1, &miss); |
- CheckPrototypes( |
- IC::CurrentTypeOf(object, isolate()), |
- r1, holder, r0, r3, r4, name, &miss); |
- } else { |
+ |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
+ if (!cell.is_null()) { |
ASSERT(cell->value() == *function); |
- GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, |
- &miss); |
GenerateLoadFunctionFromCell(cell, function, &miss); |
} |
@@ -2483,9 +2297,7 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall( |
__ InvokeFunction(function, expected, arguments(), |
JUMP_FUNCTION, NullCallWrapper(), CALL_AS_METHOD); |
- __ bind(&miss); |
- // r2: function name. |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(type, name); |
@@ -2557,24 +2369,27 @@ void StubCompiler::GenerateBooleanCheck(Register object, Label* miss) { |
} |
-void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object, |
- Handle<JSObject> holder, |
- Handle<Name> name, |
- CheckType check) { |
+Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, |
+ Handle<JSObject> holder, |
+ Handle<Name> name, |
+ CheckType check, |
+ Label* miss) { |
// ----------- S t a t e ------------- |
// -- r2 : name |
// -- lr : return address |
// ----------------------------------- |
Igor Sheludko
2013/11/25 16:31:53
What do you think about putting these comments her
Toon Verwaest
2013/11/27 15:16:55
I removed the comment altogether. I prefer to add
|
- Label miss; |
- GenerateNameCheck(name, &miss); |
+ GenerateNameCheck(name, miss); |
+ |
+ Register reg = r1; |
Igor Sheludko
2013/11/25 16:31:53
It looks like the other usages of "r1" below shoul
Toon Verwaest
2013/11/27 15:16:55
Done.
|
// Get the receiver from the stack |
const int argc = arguments().immediate(); |
- __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
+ const int receiver_offset = argc * kPointerSize; |
+ __ ldr(r1, MemOperand(sp, receiver_offset)); |
// Check that the receiver isn't a smi. |
if (check != NUMBER_CHECK) { |
- __ JumpIfSmi(r1, &miss); |
+ __ JumpIfSmi(r1, miss); |
} |
// Make sure that it's okay not to patch the on stack receiver |
@@ -2585,42 +2400,34 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object, |
__ IncrementCounter(isolate()->counters()->call_const(), 1, r0, r3); |
// Check that the maps haven't changed. |
- CheckPrototypes( |
+ reg = CheckPrototypes( |
IC::CurrentTypeOf(object, isolate()), |
- r1, holder, r0, r3, r4, name, &miss); |
+ r1, holder, r0, r3, r4, name, miss); |
// Patch the receiver on the stack with the global proxy if |
// necessary. |
if (object->IsGlobalObject()) { |
__ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); |
- __ str(r3, MemOperand(sp, argc * kPointerSize)); |
+ __ str(r3, MemOperand(sp, receiver_offset)); |
} |
break; |
case STRING_CHECK: { |
// Check that the object is a string. |
__ CompareObjectType(r1, r3, r3, FIRST_NONSTRING_TYPE); |
- __ b(ge, &miss); |
+ __ b(ge, miss); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::STRING_FUNCTION_INDEX, r0, &miss); |
- Handle<Object> prototype(object->GetPrototype(isolate()), isolate()); |
- CheckPrototypes( |
- IC::CurrentTypeOf(prototype, isolate()), |
- r0, holder, r3, r1, r4, name, &miss); |
+ masm(), Context::STRING_FUNCTION_INDEX, r0, miss); |
break; |
} |
case SYMBOL_CHECK: { |
// Check that the object is a symbol. |
__ CompareObjectType(r1, r1, r3, SYMBOL_TYPE); |
- __ b(ne, &miss); |
+ __ b(ne, miss); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::SYMBOL_FUNCTION_INDEX, r0, &miss); |
- Handle<Object> prototype(object->GetPrototype(isolate()), isolate()); |
- CheckPrototypes( |
- IC::CurrentTypeOf(prototype, isolate()), |
- r0, holder, r3, r1, r4, name, &miss); |
+ masm(), Context::SYMBOL_FUNCTION_INDEX, r0, miss); |
break; |
} |
case NUMBER_CHECK: { |
@@ -2628,39 +2435,31 @@ void CallStubCompiler::CompileHandlerFrontend(Handle<Object> object, |
// Check that the object is a smi or a heap number. |
__ JumpIfSmi(r1, &fast); |
__ CompareObjectType(r1, r0, r0, HEAP_NUMBER_TYPE); |
- __ b(ne, &miss); |
+ __ b(ne, miss); |
__ bind(&fast); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); |
- Handle<Object> prototype(object->GetPrototype(isolate()), isolate()); |
- CheckPrototypes( |
- IC::CurrentTypeOf(prototype, isolate()), |
- r0, holder, r3, r1, r4, name, &miss); |
+ masm(), Context::NUMBER_FUNCTION_INDEX, r0, miss); |
break; |
} |
case BOOLEAN_CHECK: { |
- GenerateBooleanCheck(r1, &miss); |
+ GenerateBooleanCheck(r1, miss); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss); |
- Handle<Object> prototype(object->GetPrototype(isolate()), isolate()); |
- CheckPrototypes( |
- IC::CurrentTypeOf(prototype, isolate()), |
- r0, holder, r3, r1, r4, name, &miss); |
+ masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, miss); |
break; |
} |
} |
- Label success; |
- __ b(&success); |
- |
- // Handle call cache miss. |
- __ bind(&miss); |
- GenerateMissBranch(); |
+ if (check != RECEIVER_MAP_CHECK) { |
+ Handle<Object> prototype(object->GetPrototype(isolate()), isolate()); |
+ reg = CheckPrototypes( |
+ IC::CurrentTypeOf(prototype, isolate()), |
+ r0, holder, r3, r1, r4, name, miss); |
+ } |
- __ bind(&success); |
+ return reg; |
} |
@@ -2689,8 +2488,10 @@ Handle<Code> CallStubCompiler::CompileCallConstant( |
if (!code.is_null()) return code; |
} |
- CompileHandlerFrontend(object, holder, name, check); |
+ Label miss; |
+ HandlerFrontendHeader(object, holder, name, check, &miss); |
CompileHandlerBackend(function); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(function); |
@@ -2700,10 +2501,6 @@ Handle<Code> CallStubCompiler::CompileCallConstant( |
Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, |
Handle<JSObject> holder, |
Handle<Name> name) { |
- // ----------- S t a t e ------------- |
- // -- r2 : name |
- // -- lr : return address |
- // ----------------------------------- |
Label miss; |
GenerateNameCheck(name, &miss); |
@@ -2741,10 +2538,6 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
Handle<PropertyCell> cell, |
Handle<JSFunction> function, |
Handle<Name> name) { |
- // ----------- S t a t e ------------- |
- // -- r2 : name |
- // -- lr : return address |
- // ----------------------------------- |
if (HasCustomCallGenerator(function)) { |
Handle<Code> code = CompileCustomCall( |
object, holder, cell, function, Handle<String>::cast(name), |
@@ -2754,20 +2547,9 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
} |
Label miss; |
- GenerateNameCheck(name, &miss); |
- |
- // Get the number of arguments. |
- const int argc = arguments().immediate(); |
- GenerateGlobalReceiverCheck(object, holder, name, &miss); |
+ HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
GenerateLoadFunctionFromCell(cell, function, &miss); |
- // Patch the receiver on the stack with the global proxy if |
- // necessary. |
- if (object->IsGlobalObject()) { |
- __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); |
- __ str(r3, MemOperand(sp, argc * kPointerSize)); |
- } |
- |
// Set up the context (function already in r1). |
__ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
@@ -2785,10 +2567,7 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
__ InvokeCode(r3, expected, arguments(), JUMP_FUNCTION, |
NullCallWrapper(), call_kind); |
- // Handle call cache miss. |
- __ bind(&miss); |
- __ IncrementCounter(counters->call_global_inline_miss(), 1, r1, r3); |
- GenerateMissBranch(); |
+ HandlerFrontendFooter(&miss); |
// Return the generated code. |
return GetCode(Code::NORMAL, name); |