MIPS: Merge KeyedLoad and NamedLoad stub compiler code.
Port r13579 (e640269) BUG= Review URL: https://chromiumcodereview.appspot.com/12186003 Patch from Paul Lind <plind44@gmail.com>. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13580 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
0d89d9a019
commit
7282be179e
@ -2894,9 +2894,9 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal(
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
||||
Handle<String> name,
|
||||
Handle<JSObject> object,
|
||||
Handle<JSObject> last,
|
||||
Handle<String> name,
|
||||
Handle<GlobalObject> global) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : receiver
|
||||
@ -2937,46 +2937,24 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object,
|
||||
Handle<JSObject> holder,
|
||||
PropertyIndex index,
|
||||
Handle<String> name) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : receiver
|
||||
// -- a2 : name
|
||||
// -- ra : return address
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
__ mov(v0, a0);
|
||||
|
||||
GenerateLoadField(object, holder, v0, a3, a1, t0, index, name, &miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
||||
|
||||
// Return the generated code.
|
||||
return GetCode(Code::FIELD, name);
|
||||
Register* LoadStubCompiler::registers() {
|
||||
// receiver, name, scratch1, scratch2, scratch3, scratch4.
|
||||
static Register registers[] = { a0, a2, a3, a1, t0, t1 };
|
||||
return registers;
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadCallback(
|
||||
Handle<String> name,
|
||||
Handle<JSObject> object,
|
||||
Handle<JSObject> holder,
|
||||
Handle<AccessorInfo> callback) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : receiver
|
||||
// -- a2 : name
|
||||
// -- ra : return address
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
GenerateLoadCallback(object, holder, a0, a2, a3, a1, t0, t1, callback, name,
|
||||
&miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
||||
Register* KeyedLoadStubCompiler::registers() {
|
||||
// receiver, name, scratch1, scratch2, scratch3, scratch4.
|
||||
static Register registers[] = { a1, a0, a2, a3, t0, t1 };
|
||||
return registers;
|
||||
}
|
||||
|
||||
// Return the generated code.
|
||||
return GetCode(Code::CALLBACKS, name);
|
||||
|
||||
void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name,
|
||||
Register name_reg,
|
||||
Label* miss) {
|
||||
__ Branch(miss, ne, name_reg, Operand(name));
|
||||
}
|
||||
|
||||
|
||||
@ -3018,9 +2996,9 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
|
||||
Handle<String> name,
|
||||
Handle<JSObject> receiver,
|
||||
Handle<JSObject> holder,
|
||||
Handle<String> name,
|
||||
Handle<JSFunction> getter) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : receiver
|
||||
@ -3043,49 +3021,6 @@ Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
|
||||
Handle<JSObject> holder,
|
||||
Handle<JSFunction> value,
|
||||
Handle<String> name) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : receiver
|
||||
// -- a2 : name
|
||||
// -- ra : return address
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
GenerateLoadConstant(object, holder, a0, a3, a1, t0, value, name, &miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
||||
|
||||
// Return the generated code.
|
||||
return GetCode(Code::CONSTANT_FUNCTION, name);
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadInterceptor(Handle<JSObject> object,
|
||||
Handle<JSObject> holder,
|
||||
Handle<String> name) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- a0 : receiver
|
||||
// -- a2 : name
|
||||
// -- ra : return address
|
||||
// -- [sp] : receiver
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
LookupResult lookup(isolate());
|
||||
LookupPostInterceptor(holder, name, &lookup);
|
||||
GenerateLoadInterceptor(object, holder, &lookup, a0, a2, a3, a1, t0, name,
|
||||
&miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::LOAD_IC);
|
||||
|
||||
// Return the generated code.
|
||||
return GetCode(Code::INTERCEPTOR, name);
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
||||
Handle<JSObject> object,
|
||||
Handle<GlobalObject> holder,
|
||||
@ -3127,101 +3062,6 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name,
|
||||
Handle<JSObject> receiver,
|
||||
Handle<JSObject> holder,
|
||||
PropertyIndex index) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- ra : return address
|
||||
// -- a0 : key
|
||||
// -- a1 : receiver
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
// Check the key is the cached one.
|
||||
__ Branch(&miss, ne, a0, Operand(name));
|
||||
|
||||
GenerateLoadField(receiver, holder, a1, a2, a3, t0, index, name, &miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
||||
|
||||
return GetCode(Code::FIELD, name);
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> KeyedLoadStubCompiler::CompileLoadCallback(
|
||||
Handle<String> name,
|
||||
Handle<JSObject> receiver,
|
||||
Handle<JSObject> holder,
|
||||
Handle<AccessorInfo> callback) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- ra : return address
|
||||
// -- a0 : key
|
||||
// -- a1 : receiver
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
// Check the key is the cached one.
|
||||
__ Branch(&miss, ne, a0, Operand(name));
|
||||
|
||||
GenerateLoadCallback(receiver, holder, a1, a0, a2, a3, t0, t1, callback,
|
||||
name, &miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
||||
|
||||
return GetCode(Code::CALLBACKS, name);
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(
|
||||
Handle<String> name,
|
||||
Handle<JSObject> receiver,
|
||||
Handle<JSObject> holder,
|
||||
Handle<JSFunction> value) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- ra : return address
|
||||
// -- a0 : key
|
||||
// -- a1 : receiver
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
// Check the key is the cached one.
|
||||
__ Branch(&miss, ne, a0, Operand(name));
|
||||
|
||||
GenerateLoadConstant(receiver, holder, a1, a2, a3, t0, value, name, &miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
||||
|
||||
// Return the generated code.
|
||||
return GetCode(Code::CONSTANT_FUNCTION, name);
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> KeyedLoadStubCompiler::CompileLoadInterceptor(
|
||||
Handle<JSObject> receiver,
|
||||
Handle<JSObject> holder,
|
||||
Handle<String> name) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- ra : return address
|
||||
// -- a0 : key
|
||||
// -- a1 : receiver
|
||||
// -----------------------------------
|
||||
Label miss;
|
||||
|
||||
// Check the key is the cached one.
|
||||
__ Branch(&miss, ne, a0, Operand(name));
|
||||
|
||||
LookupResult lookup(isolate());
|
||||
LookupPostInterceptor(holder, name, &lookup);
|
||||
GenerateLoadInterceptor(receiver, holder, &lookup, a1, a0, a2, a3, t0, name,
|
||||
&miss);
|
||||
__ bind(&miss);
|
||||
GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
|
||||
|
||||
return GetCode(Code::INTERCEPTOR, name);
|
||||
}
|
||||
|
||||
|
||||
Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
|
||||
Handle<Map> receiver_map) {
|
||||
// ----------- S t a t e -------------
|
||||
|
Loading…
Reference in New Issue
Block a user