Commit ef52aeb7 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove special ArrayCode CallIC.

Once Call ICs are replaced by LoadIC + CallFunctionStub, we'll need a new way
of tracking this information.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/141073006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18662 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 155ef100
...@@ -1571,39 +1571,6 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, ...@@ -1571,39 +1571,6 @@ 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;
HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
if (!cell.is_null()) {
ASSERT(cell->value() == *function);
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));
ArrayConstructorStub stub(isolate());
__ TailCallStub(&stub);
HandlerFrontendFooter(&miss);
// Return the generated code.
return GetCode(type, name);
}
Handle<Code> CallStubCompiler::CompileArrayPushCall( Handle<Code> CallStubCompiler::CompileArrayPushCall(
Handle<Object> object, Handle<Object> object,
Handle<JSObject> holder, Handle<JSObject> holder,
......
...@@ -1666,39 +1666,6 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, ...@@ -1666,39 +1666,6 @@ 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;
HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
if (!cell.is_null()) {
ASSERT(cell->value() == *function);
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(eax, Immediate(argc));
__ mov(ebx, site_feedback_cell);
__ mov(edi, function);
ArrayConstructorStub stub(isolate());
__ TailCallStub(&stub);
HandlerFrontendFooter(&miss);
// Return the generated code.
return GetCode(type, name);
}
Handle<Code> CallStubCompiler::CompileArrayPushCall( Handle<Code> CallStubCompiler::CompileArrayPushCall(
Handle<Object> object, Handle<Object> object,
Handle<JSObject> holder, Handle<JSObject> holder,
......
...@@ -1556,39 +1556,6 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, ...@@ -1556,39 +1556,6 @@ 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;
HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
if (!cell.is_null()) {
ASSERT(cell->value() == *function);
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();
__ li(a0, Operand(argc));
__ li(a2, Operand(site_feedback_cell));
__ li(a1, Operand(function));
ArrayConstructorStub stub(isolate());
__ TailCallStub(&stub);
HandlerFrontendFooter(&miss);
// Return the generated code.
return GetCode(type, name);
}
Handle<Code> CallStubCompiler::CompileArrayPushCall( Handle<Code> CallStubCompiler::CompileArrayPushCall(
Handle<Object> object, Handle<Object> object,
Handle<JSObject> holder, Handle<JSObject> holder,
......
...@@ -297,9 +297,7 @@ Handle<Code> StubCache::ComputeCallConstant(int argc, ...@@ -297,9 +297,7 @@ Handle<Code> StubCache::ComputeCallConstant(int argc,
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
if (CallStubCompiler::CanBeCached(function)) { HeapObject::UpdateMapCodeCache(stub_holder, name, code);
HeapObject::UpdateMapCodeCache(stub_holder, name, code);
}
return code; return code;
} }
...@@ -402,9 +400,7 @@ Handle<Code> StubCache::ComputeCallGlobal(int argc, ...@@ -402,9 +400,7 @@ Handle<Code> StubCache::ComputeCallGlobal(int argc,
PROFILE(isolate(), PROFILE(isolate(),
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
if (CallStubCompiler::CanBeCached(function)) { HeapObject::UpdateMapCodeCache(receiver, name, code);
HeapObject::UpdateMapCodeCache(receiver, name, code);
}
return code; return code;
} }
...@@ -1898,18 +1894,6 @@ bool CallStubCompiler::HasCustomCallGenerator(Handle<JSFunction> function) { ...@@ -1898,18 +1894,6 @@ bool CallStubCompiler::HasCustomCallGenerator(Handle<JSFunction> function) {
} }
bool CallStubCompiler::CanBeCached(Handle<JSFunction> function) {
if (function->shared()->HasBuiltinFunctionId()) {
BuiltinFunctionId id = function->shared()->builtin_function_id();
#define CALL_GENERATOR_CASE(name) if (id == k##name) return false;
SITE_SPECIFIC_CALL_GENERATORS(CALL_GENERATOR_CASE)
#undef CALL_GENERATOR_CASE
}
return true;
}
Handle<Code> CallStubCompiler::CompileCustomCall( Handle<Code> CallStubCompiler::CompileCustomCall(
Handle<Object> object, Handle<Object> object,
Handle<JSObject> holder, Handle<JSObject> holder,
......
...@@ -907,12 +907,7 @@ class KeyedStoreStubCompiler: public StoreStubCompiler { ...@@ -907,12 +907,7 @@ class KeyedStoreStubCompiler: public StoreStubCompiler {
V(StringCharAt) \ V(StringCharAt) \
V(StringFromCharCode) \ V(StringFromCharCode) \
V(MathFloor) \ V(MathFloor) \
V(MathAbs) \ V(MathAbs)
V(ArrayCode)
#define SITE_SPECIFIC_CALL_GENERATORS(V) \
V(ArrayCode)
class CallStubCompiler: public StubCompiler { class CallStubCompiler: public StubCompiler {
...@@ -969,7 +964,6 @@ class CallStubCompiler: public StubCompiler { ...@@ -969,7 +964,6 @@ class CallStubCompiler: public StubCompiler {
Handle<Name> name); Handle<Name> name);
static bool HasCustomCallGenerator(Handle<JSFunction> function); static bool HasCustomCallGenerator(Handle<JSFunction> function);
static bool CanBeCached(Handle<JSFunction> function);
private: private:
// Compiles a custom call constant/global IC. For constant calls cell is // Compiles a custom call constant/global IC. For constant calls cell is
......
...@@ -1593,39 +1593,6 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, ...@@ -1593,39 +1593,6 @@ 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;
HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
if (!cell.is_null()) {
ASSERT(cell->value() == *function);
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();
__ movq(rax, Immediate(argc));
__ Move(rbx, site_feedback_cell);
__ Move(rdi, function);
ArrayConstructorStub stub(isolate());
__ TailCallStub(&stub);
HandlerFrontendFooter(&miss);
// Return the generated code.
return GetCode(type, name);
}
Handle<Code> CallStubCompiler::CompileArrayPushCall( Handle<Code> CallStubCompiler::CompileArrayPushCall(
Handle<Object> object, Handle<Object> object,
Handle<JSObject> holder, Handle<JSObject> holder,
......
...@@ -90,66 +90,66 @@ if (support_smi_only_arrays) { ...@@ -90,66 +90,66 @@ if (support_smi_only_arrays) {
// Verify that basic elements kind feedback works for non-constructor // Verify that basic elements kind feedback works for non-constructor
// array calls (as long as the call is made through an IC, and not // array calls (as long as the call is made through an IC, and not
// a CallStub). // a CallStub).
(function (){ // (function (){
function create0() { // function create0() {
return Array(); // return Array();
} // }
// Calls through ICs need warm up through uninitialized, then // // Calls through ICs need warm up through uninitialized, then
// premonomorphic first. // // premonomorphic first.
create0(); // create0();
create0(); // create0();
a = create0(); // a = create0();
assertKind(elements_kind.fast_smi_only, a); // assertKind(elements_kind.fast_smi_only, a);
a[0] = 3.5; // a[0] = 3.5;
b = create0(); // b = create0();
assertKind(elements_kind.fast_double, b); // assertKind(elements_kind.fast_double, b);
function create1(arg) { // function create1(arg) {
return Array(arg); // return Array(arg);
} // }
create1(0); // create1(0);
create1(0); // create1(0);
a = create1(0); // a = create1(0);
assertFalse(isHoley(a)); // assertFalse(isHoley(a));
assertKind(elements_kind.fast_smi_only, a); // assertKind(elements_kind.fast_smi_only, a);
a[0] = "hello"; // a[0] = "hello";
b = create1(10); // b = create1(10);
assertTrue(isHoley(b)); // assertTrue(isHoley(b));
assertKind(elements_kind.fast, b); // assertKind(elements_kind.fast, b);
a = create1(100000); // a = create1(100000);
assertKind(elements_kind.dictionary, a); // assertKind(elements_kind.dictionary, a);
function create3(arg1, arg2, arg3) { // function create3(arg1, arg2, arg3) {
return Array(arg1, arg2, arg3); // return Array(arg1, arg2, arg3);
} // }
create3(); // create3();
create3(); // create3();
a = create3(1,2,3); // a = create3(1,2,3);
a[0] = 3.5; // a[0] = 3.5;
b = create3(1,2,3); // b = create3(1,2,3);
assertKind(elements_kind.fast_double, b); // assertKind(elements_kind.fast_double, b);
assertFalse(isHoley(b)); // assertFalse(isHoley(b));
})(); // })();
// Verify that keyed calls work // Verify that keyed calls work
(function (){ // (function (){
function create0(name) { // function create0(name) {
return this[name](); // return this[name]();
} // }
name = "Array"; // name = "Array";
create0(name); // create0(name);
create0(name); // create0(name);
a = create0(name); // a = create0(name);
a[0] = 3.5; // a[0] = 3.5;
b = create0(name); // b = create0(name);
assertKind(elements_kind.fast_double, b); // assertKind(elements_kind.fast_double, b);
})(); // })();
// Verify that the IC can't be spoofed by patching // Verify that the IC can't be spoofed by patching
...@@ -173,28 +173,28 @@ if (support_smi_only_arrays) { ...@@ -173,28 +173,28 @@ if (support_smi_only_arrays) {
// though the type information is reset. // though the type information is reset.
// TODO(mvstanton): instead, consume the type feedback gathered up // TODO(mvstanton): instead, consume the type feedback gathered up
// until crankshaft time. // until crankshaft time.
(function (){ // (function (){
function create0() { // function create0() {
return Array(); // return Array();
} // }
create0(); // create0();
create0(); // create0();
a = create0(); // a = create0();
a[0] = 3.5; // a[0] = 3.5;
%OptimizeFunctionOnNextCall(create0); // %OptimizeFunctionOnNextCall(create0);
create0(); // create0();
// This test only makes sense if crankshaft is allowed // // This test only makes sense if crankshaft is allowed
if (4 != %GetOptimizationStatus(create0)) { // if (4 != %GetOptimizationStatus(create0)) {
create0(); // create0();
b = create0(); // b = create0();
assertKind(elements_kind.fast_smi_only, b); // assertKind(elements_kind.fast_smi_only, b);
b[0] = 3.5; // b[0] = 3.5;
c = create0(); // c = create0();
assertKind(elements_kind.fast_double, c); // assertKind(elements_kind.fast_double, c);
assertOptimized(create0); // assertOptimized(create0);
} // }
})(); // })();
// Verify that cross context calls work // Verify that cross context calls work
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment