Index: src/mips/stub-cache-mips.cc |
diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc |
index 51df45224abdb33a3d2e1d7cf4d758cf06b6e2d9..220233682a193fadd54f376f6f1931c290cc1fe7 100644 |
--- a/src/mips/stub-cache-mips.cc |
+++ b/src/mips/stub-cache-mips.cc |
@@ -1714,12 +1714,61 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, |
} |
+Handle<Code> CallStubCompiler::CompileArrayCodeCall( |
+ Handle<Object> object, |
+ Handle<JSObject> holder, |
+ Handle<Cell> cell, |
+ Handle<JSFunction> function, |
+ Handle<String> name, |
+ Code::StubType type) { |
+ Label miss; |
+ |
+ // Check that function is still array |
Paul Lind
2013/06/19 16:33:31
nit, end with period.
|
+ const int argc = arguments().immediate(); |
+ GenerateNameCheck(name, &miss); |
+ Register receiver = a1; |
+ |
+ if (cell.is_null()) { |
+ __ lw(receiver, MemOperand(sp, argc * kPointerSize)); |
+ |
+ // Check that the receiver isn't a smi. |
+ __ JumpIfSmi(receiver, &miss); |
+ |
+ // Check that the maps haven't changed. |
+ CheckPrototypes(Handle<JSObject>::cast(object), receiver, holder, a3, a0, |
+ t0, name, &miss); |
+ } else { |
+ ASSERT(cell->value() == *function); |
+ GenerateGlobalReceiverCheck(Handle<JSObject>::cast(object), holder, name, |
+ &miss); |
+ GenerateLoadFunctionFromCell(cell, function, &miss); |
+ } |
+ |
+ Handle<Smi> kind(Smi::FromInt(GetInitialFastElementsKind()), isolate()); |
+ Handle<Cell> kind_feedback_cell = |
+ isolate()->factory()->NewCell(kind); |
+ __ li(a0, Operand(argc)); |
+ __ li(a2, Operand(kind_feedback_cell)); |
+ __ li(a1, Operand(function)); |
+ |
+ ArrayConstructorStub stub(isolate()); |
+ __ TailCallStub(&stub); |
+ |
+ __ bind(&miss); |
+ GenerateMissBranch(); |
+ |
+ // Return the generated code. |
+ return GetCode(type, name); |
+} |
+ |
+ |
Handle<Code> CallStubCompiler::CompileArrayPushCall( |
Handle<Object> object, |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : name |
// -- ra : return address |
@@ -1964,7 +2013,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return GetCode(function); |
+ return GetCode(type, name); |
} |
@@ -1973,7 +2022,8 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall( |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : name |
// -- ra : return address |
@@ -2046,7 +2096,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return GetCode(function); |
+ return GetCode(type, name); |
} |
@@ -2055,7 +2105,8 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : function name |
// -- ra : return address |
@@ -2128,7 +2179,7 @@ Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return GetCode(function); |
+ return GetCode(type, name); |
} |
@@ -2137,7 +2188,8 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : function name |
// -- ra : return address |
@@ -2209,7 +2261,7 @@ Handle<Code> CallStubCompiler::CompileStringCharAtCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return GetCode(function); |
+ return GetCode(type, name); |
} |
@@ -2218,7 +2270,8 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : function name |
// -- ra : return address |
@@ -2282,7 +2335,7 @@ Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
+ return GetCode(type, name); |
} |
@@ -2291,7 +2344,8 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall( |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : function name |
// -- ra : return address |
@@ -2411,7 +2465,7 @@ Handle<Code> CallStubCompiler::CompileMathFloorCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
+ return GetCode(type, name); |
} |
@@ -2420,7 +2474,8 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall( |
Handle<JSObject> holder, |
Handle<Cell> cell, |
Handle<JSFunction> function, |
- Handle<String> name) { |
+ Handle<String> name, |
+ Code::StubType type) { |
// ----------- S t a t e ------------- |
// -- a2 : function name |
// -- ra : return address |
@@ -2510,7 +2565,7 @@ Handle<Code> CallStubCompiler::CompileMathAbsCall( |
GenerateMissBranch(); |
// Return the generated code. |
- return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); |
+ return GetCode(type, name); |
} |
@@ -2692,7 +2747,8 @@ Handle<Code> CallStubCompiler::CompileCallConstant( |
if (HasCustomCallGenerator(function)) { |
Handle<Code> code = CompileCustomCall(object, holder, |
Handle<Cell>::null(), |
- function, Handle<String>::cast(name)); |
+ function, Handle<String>::cast(name), |
+ Code::CONSTANT_FUNCTION); |
// A null handle means bail out to the regular compiler code below. |
if (!code.is_null()) return code; |
} |
@@ -2761,7 +2817,8 @@ Handle<Code> CallStubCompiler::CompileCallGlobal( |
if (HasCustomCallGenerator(function)) { |
Handle<Code> code = CompileCustomCall( |
- object, holder, cell, function, Handle<String>::cast(name)); |
+ object, holder, cell, function, Handle<String>::cast(name), |
+ Code::NORMAL); |
// A null handle means bail out to the regular compiler code below. |
if (!code.is_null()) return code; |
} |