Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index 89f606d59850fede7bc74e830e8c9d401038b7f9..704f8de205aa4b43d1d48c5f35c236f33cf984a8 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -2965,9 +2965,9 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( |
Handle<Code> LoadStubCompiler::CompileLoadNonexistent( |
- Handle<String> name, |
Handle<JSObject> object, |
Handle<JSObject> last, |
+ Handle<String> name, |
Handle<GlobalObject> global) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
@@ -3013,45 +3013,25 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent( |
} |
-Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object, |
- Handle<JSObject> holder, |
- PropertyIndex index, |
- Handle<String> name) { |
- // ----------- S t a t e ------------- |
- // -- ecx : name |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- GenerateLoadField(object, holder, edx, ebx, eax, edi, 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[] = { edx, ecx, ebx, eax, edi, no_reg }; |
+ return registers; |
} |
-Handle<Code> LoadStubCompiler::CompileLoadCallback( |
- Handle<String> name, |
- Handle<JSObject> object, |
- Handle<JSObject> holder, |
- Handle<AccessorInfo> callback) { |
- // ----------- S t a t e ------------- |
- // -- ecx : name |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
+Register* KeyedLoadStubCompiler::registers() { |
+ // receiver, name, scratch1, scratch2, scratch3, scratch4. |
+ static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; |
+ return registers; |
+} |
- GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, no_reg, |
- callback, name, &miss); |
- __ bind(&miss); |
- GenerateLoadMiss(masm(), Code::LOAD_IC); |
- // Return the generated code. |
- return GetCode(Code::CALLBACKS, name); |
+void KeyedLoadStubCompiler::GenerateNameCheck(Handle<String> name, |
+ Register name_reg, |
+ Label* miss) { |
+ __ cmp(name_reg, Immediate(name)); |
+ __ j(not_equal, miss); |
} |
@@ -3093,9 +3073,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 ------------- |
// -- ecx : name |
@@ -3118,52 +3098,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 ------------- |
- // -- ecx : name |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- GenerateLoadConstant(object, holder, edx, ebx, eax, edi, 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> receiver, |
- Handle<JSObject> holder, |
- Handle<String> name) { |
- // ----------- S t a t e ------------- |
- // -- ecx : name |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- LookupResult lookup(isolate()); |
- LookupPostInterceptor(holder, name, &lookup); |
- |
- // TODO(368): Compile in the whole chain: all the interceptors in |
- // prototypes and ultimate answer. |
- GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi, |
- 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, |
@@ -3212,127 +3146,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 ------------- |
- // -- ecx : key |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- Counters* counters = isolate()->counters(); |
- __ IncrementCounter(counters->keyed_load_field(), 1); |
- |
- // Check that the name has not changed. |
- __ cmp(ecx, Immediate(name)); |
- __ j(not_equal, &miss); |
- |
- GenerateLoadField(receiver, holder, edx, ebx, eax, edi, index, name, &miss); |
- |
- __ bind(&miss); |
- __ DecrementCounter(counters->keyed_load_field(), 1); |
- GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
- |
- // Return the generated code. |
- 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 ------------- |
- // -- ecx : key |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- Counters* counters = isolate()->counters(); |
- __ IncrementCounter(counters->keyed_load_callback(), 1); |
- |
- // Check that the name has not changed. |
- __ cmp(ecx, Immediate(name)); |
- __ j(not_equal, &miss); |
- |
- GenerateLoadCallback(receiver, holder, edx, ecx, ebx, eax, edi, no_reg, |
- callback, name, &miss); |
- |
- __ bind(&miss); |
- __ DecrementCounter(counters->keyed_load_callback(), 1); |
- GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
- |
- // Return the generated code. |
- 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 ------------- |
- // -- ecx : key |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- Counters* counters = isolate()->counters(); |
- __ IncrementCounter(counters->keyed_load_constant_function(), 1); |
- |
- // Check that the name has not changed. |
- __ cmp(ecx, Immediate(name)); |
- __ j(not_equal, &miss); |
- |
- GenerateLoadConstant( |
- receiver, holder, edx, ebx, eax, edi, value, name, &miss); |
- __ bind(&miss); |
- __ DecrementCounter(counters->keyed_load_constant_function(), 1); |
- 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 ------------- |
- // -- ecx : key |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- Counters* counters = isolate()->counters(); |
- __ IncrementCounter(counters->keyed_load_interceptor(), 1); |
- |
- // Check that the name has not changed. |
- __ cmp(ecx, Immediate(name)); |
- __ j(not_equal, &miss); |
- |
- LookupResult lookup(isolate()); |
- LookupPostInterceptor(holder, name, &lookup); |
- GenerateLoadInterceptor(receiver, holder, &lookup, edx, ecx, eax, ebx, edi, |
- name, &miss); |
- __ bind(&miss); |
- __ DecrementCounter(counters->keyed_load_interceptor(), 1); |
- GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
- |
- // Return the generated code. |
- return GetCode(Code::INTERCEPTOR, name); |
-} |
- |
- |
Handle<Code> KeyedLoadStubCompiler::CompileLoadElement( |
Handle<Map> receiver_map) { |
// ----------- S t a t e ------------- |