Revision: 3824
Author: [email protected]
Date: Tue Feb 9 07:18:37 2010
Log: Eliminate unused function KeyedStoreIC::GenerateExtendStorage, and
unused parameter from StubCompiler::GenerateStoreField.
Review URL: http://codereview.chromium.org/575022
http://code.google.com/p/v8/source/detail?r=3824
Modified:
/branches/bleeding_edge/src/arm/ic-arm.cc
/branches/bleeding_edge/src/arm/stub-cache-arm.cc
/branches/bleeding_edge/src/builtins.cc
/branches/bleeding_edge/src/builtins.h
/branches/bleeding_edge/src/ia32/ic-ia32.cc
/branches/bleeding_edge/src/ia32/stub-cache-ia32.cc
/branches/bleeding_edge/src/ic.h
/branches/bleeding_edge/src/stub-cache.h
/branches/bleeding_edge/src/x64/ic-x64.cc
/branches/bleeding_edge/src/x64/stub-cache-x64.cc
=======================================
--- /branches/bleeding_edge/src/arm/ic-arm.cc Tue Feb 9 05:06:37 2010
+++ /branches/bleeding_edge/src/arm/ic-arm.cc Tue Feb 9 07:18:37 2010
@@ -786,23 +786,6 @@
// TODO(476): port specialized code.
GenerateGeneric(masm);
}
-
-
-void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) {
- // ---------- S t a t e --------------
- // -- r0 : value
- // -- lr : return address
- // -- sp[0] : key
- // -- sp[1] : receiver
- // ----------- S t a t e -------------
-
- __ ldm(ia, sp, r2.bit() | r3.bit());
- __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
-
- // Perform tail call to the entry.
- __ TailCallRuntime(
- ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
-}
void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
@@ -823,23 +806,6 @@
// Cache miss: Jump to runtime.
GenerateMiss(masm);
}
-
-
-void StoreIC::GenerateExtendStorage(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- r0 : value
- // -- r2 : name
- // -- lr : return address
- // -- [sp] : receiver
- // -----------------------------------
-
- __ ldr(r3, MemOperand(sp)); // copy receiver
- __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
-
- // Perform tail call to the entry.
- __ TailCallRuntime(
- ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
-}
void StoreIC::GenerateMiss(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Tue Feb 9 06:19:23
2010
+++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Tue Feb 9 07:18:37
2010
@@ -261,7 +261,6 @@
// After executing generated code, the receiver_reg and name_reg
// may be clobbered.
void StubCompiler::GenerateStoreField(MacroAssembler* masm,
- Builtins::Name storage_extend,
JSObject* object,
int index,
Map* transition,
@@ -294,11 +293,12 @@
if ((transition != NULL) && (object->map()->unused_property_fields() ==
0)) {
// The properties must be extended before we can store the value.
// We jump to a runtime call that extends the properties array.
+ __ push(receiver_reg);
__ mov(r2, Operand(Handle<Map>(transition)));
- // Please note, if we implement keyed store for arm we need
- // to call the Builtins::KeyedStoreIC_ExtendStorage.
- Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_ExtendStorage));
- __ Jump(ic, RelocInfo::CODE_TARGET);
+ __ stm(db_w, sp, r2.bit() | r0.bit());
+ __ TailCallRuntime(
+ ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)),
+ 3, 1);
return;
}
@@ -1215,7 +1215,6 @@
// name register might be clobbered.
GenerateStoreField(masm(),
- Builtins::StoreIC_ExtendStorage,
object,
index,
transition,
@@ -1719,7 +1718,6 @@
__ ldr(r3, MemOperand(sp));
// r1 is used as scratch register, r3 and r2 might be clobbered.
GenerateStoreField(masm(),
- Builtins::StoreIC_ExtendStorage,
object,
index,
transition,
=======================================
--- /branches/bleeding_edge/src/builtins.cc Fri Jan 29 03:46:55 2010
+++ /branches/bleeding_edge/src/builtins.cc Tue Feb 9 07:18:37 2010
@@ -668,10 +668,6 @@
}
-static void Generate_StoreIC_ExtendStorage(MacroAssembler* masm) {
- StoreIC::GenerateExtendStorage(masm);
-}
-
static void Generate_StoreIC_Megamorphic(MacroAssembler* masm) {
StoreIC::GenerateMegamorphic(masm);
}
@@ -718,11 +714,6 @@
static void Generate_KeyedStoreIC_ExternalFloatArray(MacroAssembler* masm)
{
KeyedStoreIC::GenerateExternalArray(masm, kExternalFloatArray);
}
-
-
-static void Generate_KeyedStoreIC_ExtendStorage(MacroAssembler* masm) {
- KeyedStoreIC::GenerateExtendStorage(masm);
-}
static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/builtins.h Fri Jan 15 04:25:24 2010
+++ /branches/bleeding_edge/src/builtins.h Tue Feb 9 07:18:37 2010
@@ -69,9 +69,6 @@
V(StoreIC_Miss, BUILTIN, UNINITIALIZED) \
V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED) \
\
- V(StoreIC_ExtendStorage, BUILTIN, UNINITIALIZED) \
- V(KeyedStoreIC_ExtendStorage, BUILTIN, UNINITIALIZED) \
- \
V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED) \
V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC) \
V(LoadIC_Normal, LOAD_IC, MONOMORPHIC) \
=======================================
--- /branches/bleeding_edge/src/ia32/ic-ia32.cc Tue Feb 9 05:06:37 2010
+++ /branches/bleeding_edge/src/ia32/ic-ia32.cc Tue Feb 9 07:18:37 2010
@@ -1383,26 +1383,6 @@
// Cache miss: Jump to runtime.
GenerateMiss(masm);
}
-
-
-void StoreIC::GenerateExtendStorage(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- eax : value
- // -- ecx : transition map
- // -- edx : receiver
- // -- esp[0] : return address
- // -----------------------------------
-
- __ pop(ebx);
- __ push(edx); // receiver
- __ push(ecx); // transition map
- __ push(eax); // value
- __ push(ebx); // return address
-
- // Perform tail call to the entry.
- __ TailCallRuntime(
- ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
-}
void StoreIC::GenerateMiss(MacroAssembler* masm) {
@@ -1463,27 +1443,6 @@
// Do tail-call to runtime routine.
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3,
1);
}
-
-
-void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- eax : value
- // -- ecx : transition map
- // -- esp[0] : return address
- // -- esp[4] : key
- // -- esp[8] : receiver
- // -----------------------------------
-
- __ pop(ebx);
- __ push(Operand(esp, 1 * kPointerSize));
- __ push(ecx);
- __ push(eax);
- __ push(ebx);
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(
- ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
-}
#undef __
=======================================
--- /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Tue Feb 9 06:19:23
2010
+++ /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Tue Feb 9 07:18:37
2010
@@ -607,8 +607,9 @@
}
+// Both name_reg and receiver_reg are preserved on jumps to miss_label,
+// but may be destroyed if store is successful.
void StubCompiler::GenerateStoreField(MacroAssembler* masm,
- Builtins::Name storage_extend,
JSObject* object,
int index,
Map* transition,
@@ -638,9 +639,13 @@
if ((transition != NULL) && (object->map()->unused_property_fields() ==
0)) {
// The properties must be extended before we can store the value.
// We jump to a runtime call that extends the properties array.
- __ mov(ecx, Immediate(Handle<Map>(transition)));
- Handle<Code> ic(Builtins::builtin(storage_extend));
- __ jmp(ic, RelocInfo::CODE_TARGET);
+ __ pop(scratch); // Return address.
+ __ push(receiver_reg);
+ __ push(Immediate(Handle<Map>(transition)));
+ __ push(eax);
+ __ push(scratch);
+ __ TailCallRuntime(
+ ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)),
3, 1);
return;
}
@@ -1251,7 +1256,6 @@
// Generate store field code. Trashes the name register.
GenerateStoreField(masm(),
- Builtins::StoreIC_ExtendStorage,
object,
index,
transition,
@@ -1425,15 +1429,14 @@
__ j(not_equal, &miss, not_taken);
// Get the object from the stack.
- __ mov(ebx, Operand(esp, 2 * kPointerSize));
+ __ mov(edx, Operand(esp, 2 * kPointerSize));
// Generate store field code. Trashes the name register.
GenerateStoreField(masm(),
- Builtins::KeyedStoreIC_ExtendStorage,
object,
index,
transition,
- ebx, ecx, edx,
+ edx, ecx, ebx,
&miss);
// Handle store cache miss.
=======================================
--- /branches/bleeding_edge/src/ic.h Mon Feb 8 08:08:26 2010
+++ /branches/bleeding_edge/src/ic.h Tue Feb 9 07:18:37 2010
@@ -352,7 +352,6 @@
static void GenerateInitialize(MacroAssembler* masm) {
GenerateMiss(masm); }
static void GenerateMiss(MacroAssembler* masm);
static void GenerateMegamorphic(MacroAssembler* masm);
- static void GenerateExtendStorage(MacroAssembler* masm);
private:
// Update the inline cache and the global stub cache based on the
@@ -389,7 +388,6 @@
static void GenerateMiss(MacroAssembler* masm);
static void GenerateRuntimeSetProperty(MacroAssembler* masm);
static void GenerateGeneric(MacroAssembler* masm);
- static void GenerateExtendStorage(MacroAssembler* masm);
// Generators for external array types. See objects.h.
// These are similar to the generic IC; they optimize the case of
=======================================
--- /branches/bleeding_edge/src/stub-cache.h Tue Feb 9 06:19:23 2010
+++ /branches/bleeding_edge/src/stub-cache.h Tue Feb 9 07:18:37 2010
@@ -369,7 +369,6 @@
Label* miss_label);
static void GenerateStoreField(MacroAssembler* masm,
- Builtins::Name storage_extend,
JSObject* object,
int index,
Map* transition,
=======================================
--- /branches/bleeding_edge/src/x64/ic-x64.cc Tue Feb 9 05:06:37 2010
+++ /branches/bleeding_edge/src/x64/ic-x64.cc Tue Feb 9 07:18:37 2010
@@ -609,27 +609,6 @@
// Do tail-call to runtime routine.
__ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1);
}
-
-
-void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- rax : value
- // -- rcx : transition map
- // -- rsp[0] : return address
- // -- rsp[8] : key
- // -- rsp[16] : receiver
- // -----------------------------------
-
- __ pop(rbx);
- __ push(Operand(rsp, 1 * kPointerSize)); // receiver
- __ push(rcx); // transition map
- __ push(rax); // value
- __ push(rbx); // return address
-
- // Do tail-call to runtime routine.
- __ TailCallRuntime(
- ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
-}
void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
@@ -1306,7 +1285,6 @@
__ bind(&miss);
StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC);
}
-
bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
@@ -1335,6 +1313,7 @@
*reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
return true;
}
+
void StoreIC::GenerateMiss(MacroAssembler* masm) {
// ----------- S t a t e -------------
@@ -1354,24 +1333,6 @@
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1);
}
-void StoreIC::GenerateExtendStorage(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- rax : value
- // -- rcx : Map (target of map transition)
- // -- rdx : receiver
- // -- rsp[0] : return address
- // -----------------------------------
-
- __ pop(rbx);
- __ push(rdx); // receiver
- __ push(rcx); // transition map
- __ push(rax); // value
- __ push(rbx); // return address
-
- // Perform tail call to the entry.
- __ TailCallRuntime(
- ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
-}
void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
// ----------- S t a t e -------------
=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc Tue Feb 9 06:19:23
2010
+++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc Tue Feb 9 07:18:37
2010
@@ -201,8 +201,9 @@
}
+// Both name_reg and receiver_reg are preserved on jumps to miss_label,
+// but may be destroyed if store is successful.
void StubCompiler::GenerateStoreField(MacroAssembler* masm,
- Builtins::Name storage_extend,
JSObject* object,
int index,
Map* transition,
@@ -231,9 +232,13 @@
if ((transition != NULL) && (object->map()->unused_property_fields() ==
0)) {
// The properties must be extended before we can store the value.
// We jump to a runtime call that extends the properties array.
- __ Move(rcx, Handle<Map>(transition));
- Handle<Code> ic(Builtins::builtin(storage_extend));
- __ Jump(ic, RelocInfo::CODE_TARGET);
+ __ pop(scratch); // Return address.
+ __ push(receiver_reg);
+ __ Push(Handle<Map>(transition));
+ __ push(rax);
+ __ push(scratch);
+ __ TailCallRuntime(
+ ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)),
3, 1);
return;
}
@@ -1399,9 +1404,8 @@
// -----------------------------------
Label miss;
- // Generate store field code. Trashes the name register.
+ // Generate store field code. Preserves receiver and name on jump to
miss.
GenerateStoreField(masm(),
- Builtins::StoreIC_ExtendStorage,
object,
index,
transition,
@@ -1410,7 +1414,6 @@
// Handle store cache miss.
__ bind(&miss);
- __ Move(rcx, Handle<String>(name)); // restore name
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
__ Jump(ic, RelocInfo::CODE_TARGET);
@@ -1552,16 +1555,15 @@
__ Cmp(rcx, Handle<String>(name));
__ j(not_equal, &miss);
- // Get the object from the stack.
- __ movq(rbx, Operand(rsp, 2 * kPointerSize));
-
- // Generate store field code. Trashes the name register.
+ // Get the receiver from the stack.
+ __ movq(rdx, Operand(rsp, 2 * kPointerSize));
+
+ // Generate store field code. Preserves receiver and name on jump to
miss.
GenerateStoreField(masm(),
- Builtins::KeyedStoreIC_ExtendStorage,
object,
index,
transition,
- rbx, rcx, rdx,
+ rdx, rcx, rbx,
&miss);
// Handle store cache miss.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev