De-virtualize GenerateNameCheck.

Currently there are two kinds of "vtables" used in the load/store stub
compilers: kind() and C++'s own vtables. This is a bit confusing, and
this is a step towards simplifying things.

R=verwaest@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18676 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent de72001f
......@@ -2293,22 +2293,6 @@ Register* KeyedStoreStubCompiler::registers() {
}
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ cmp(name_reg, Operand(name));
__ b(ne, miss);
}
void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ cmp(name_reg, Operand(name));
__ b(ne, miss);
}
#undef __
#define __ ACCESS_MASM(masm)
......@@ -2389,8 +2373,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
IcCheckType check) {
Label miss;
if (check == PROPERTY) {
GenerateNameCheck(name, this->name(), &miss);
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ cmp(this->name(), Operand(name));
__ b(ne, &miss);
}
Label number_case;
......
......@@ -2396,22 +2396,6 @@ Register* KeyedStoreStubCompiler::registers() {
}
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ cmp(name_reg, Immediate(name));
__ j(not_equal, miss);
}
void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ cmp(name_reg, Immediate(name));
__ j(not_equal, miss);
}
#undef __
#define __ ACCESS_MASM(masm)
......@@ -2492,8 +2476,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
IcCheckType check) {
Label miss;
if (check == PROPERTY) {
GenerateNameCheck(name, this->name(), &miss);
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ cmp(this->name(), Immediate(name));
__ j(not_equal, &miss);
}
Label number_case;
......
......@@ -2277,20 +2277,6 @@ Register* KeyedStoreStubCompiler::registers() {
}
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ Branch(miss, ne, name_reg, Operand(name));
}
void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ Branch(miss, ne, name_reg, Operand(name));
}
#undef __
#define __ ACCESS_MASM(masm)
......@@ -2370,8 +2356,9 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
IcCheckType check) {
Label miss;
if (check == PROPERTY) {
GenerateNameCheck(name, this->name(), &miss);
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ Branch(&miss, ne, this->name(), Operand(name));
}
Label number_case;
......
......@@ -554,10 +554,6 @@ class BaseLoadStoreStubCompiler: public StubCompiler {
Code::StubType type,
IcCheckType check);
virtual void GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) { }
static Builtins::Name MissBuiltin(Code::Kind kind) {
switch (kind) {
case Code::LOAD_IC: return Builtins::kLoadIC_Miss;
......@@ -747,13 +743,8 @@ class KeyedLoadStubCompiler: public LoadStubCompiler {
static void GenerateLoadDictionaryElement(MacroAssembler* masm);
protected:
static Register* registers();
private:
virtual void GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss);
static Register* registers();
friend class BaseLoadStoreStubCompiler;
};
......@@ -879,21 +870,17 @@ class KeyedStoreStubCompiler: public StoreStubCompiler {
static void GenerateStoreDictionaryElement(MacroAssembler* masm);
protected:
private:
static Register* registers();
KeyedAccessStoreMode store_mode() {
return KeyedStoreIC::GetKeyedAccessStoreMode(extra_state());
}
private:
Register transition_map() {
return registers()[3];
}
virtual void GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss);
friend class BaseLoadStoreStubCompiler;
};
......
......@@ -2322,22 +2322,6 @@ Register* KeyedStoreStubCompiler::registers() {
}
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ Cmp(name_reg, name);
__ j(not_equal, miss);
}
void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name,
Register name_reg,
Label* miss) {
__ Cmp(name_reg, name);
__ j(not_equal, miss);
}
#undef __
#define __ ACCESS_MASM(masm)
......@@ -2422,8 +2406,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
IcCheckType check) {
Label miss;
if (check == PROPERTY) {
GenerateNameCheck(name, this->name(), &miss);
if (check == PROPERTY &&
(kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
__ Cmp(this->name(), name);
__ j(not_equal, &miss);
}
Label number_case;
......
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