📄 stub-cache-ia32.cc.svn-base
字号:
// Stub never generated for non-global objects that require access // checks. ASSERT(receiver->IsJSGlobalObject() || !receiver->IsAccessCheckNeeded()); __ pop(ebx); // remove the return address __ push(Operand(esp, 0)); // receiver __ push(ecx); // name __ push(eax); // value __ push(ebx); // restore return address // Do tail-call to the runtime system. ExternalReference store_ic_property = ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); __ TailCallRuntime(store_ic_property, 3); // Handle store cache miss. __ bind(&miss); __ mov(Operand(ecx), Immediate(Handle<String>(name))); // restore name Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); __ jmp(ic, RelocInfo::CODE_TARGET); // Return the generated code. return GetCode(INTERCEPTOR);}Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, int index, Map* transition, String* name) { // ----------- S t a t e ------------- // -- eax : value // -- esp[0] : return address // -- esp[4] : key // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ IncrementCounter(&Counters::keyed_store_field, 1); // Get the name from the stack. __ mov(ecx, Operand(esp, 1 * kPointerSize)); // Check that the name has not changed. __ cmp(Operand(ecx), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); // Get the object from the stack. __ mov(ebx, Operand(esp, 2 * kPointerSize)); // Generate store field code. Trashes the name register. GenerateStoreField(masm(), object, index, transition, ebx, ecx, edx, &miss); // Handle store cache miss. __ bind(&miss); __ DecrementCounter(&Counters::keyed_store_field, 1); Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); __ jmp(ic, RelocInfo::CODE_TARGET); // Return the generated code. return GetCode(transition == NULL ? FIELD : MAP_TRANSITION);}Object* LoadStubCompiler::CompileLoadField(JSObject* object, JSObject* holder, int index) { // ----------- S t a t e ------------- // -- ecx : name // -- esp[0] : return address // -- esp[4] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); GenerateLoadField(masm(), object, holder, eax, ebx, edx, index, &miss); __ bind(&miss); GenerateLoadMiss(masm(), Code::LOAD_IC); // Return the generated code. return GetCode(FIELD);}Object* LoadStubCompiler::CompileLoadCallback(JSObject* object, JSObject* holder, AccessorInfo* callback) { // ----------- S t a t e ------------- // -- ecx : name // -- esp[0] : return address // -- esp[4] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); GenerateLoadCallback(masm(), object, holder, eax, ecx, ebx, edx, callback, &miss); __ bind(&miss); GenerateLoadMiss(masm(), Code::LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, JSObject* holder, Object* value) { // ----------- S t a t e ------------- // -- ecx : name // -- esp[0] : return address // -- esp[4] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); GenerateLoadConstant(masm(), object, holder, eax, ebx, edx, value, &miss); __ bind(&miss); GenerateLoadMiss(masm(), Code::LOAD_IC); // Return the generated code. return GetCode(CONSTANT_FUNCTION);}Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, JSObject* holder, String* name) { // ----------- S t a t e ------------- // -- ecx : name // -- esp[0] : return address // -- esp[4] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); GenerateLoadInterceptor(masm(), receiver, holder, eax, ecx, edx, ebx, &miss); __ bind(&miss); GenerateLoadMiss(masm(), Code::LOAD_IC); // Return the generated code. return GetCode(INTERCEPTOR);}Object* KeyedLoadStubCompiler::CompileLoadField(String* name, JSObject* receiver, JSObject* holder, int index) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_field, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadField(masm(), receiver, holder, ecx, ebx, edx, index, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_field, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(FIELD);}Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, JSObject* receiver, JSObject* holder, AccessorInfo* callback) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_callback, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadCallback(masm(), receiver, holder, ecx, eax, ebx, edx, callback, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_callback, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, JSObject* receiver, JSObject* holder, Object* value) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_constant_function, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadConstant(masm(), receiver, holder, ecx, ebx, edx, value, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_constant_function, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CONSTANT_FUNCTION);}Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver, JSObject* holder, String* name) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_interceptor, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadInterceptor(masm(), receiver, holder, ecx, eax, edx, ebx, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_interceptor, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(INTERCEPTOR);}Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_array_length, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadArrayLength(masm(), ecx, edx, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_array_length, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}Object* KeyedLoadStubCompiler::CompileLoadShortStringLength(String* name) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_string_length, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadShortStringLength(masm(), ecx, edx, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_string_length, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}Object* KeyedLoadStubCompiler::CompileLoadMediumStringLength(String* name) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_string_length, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadMediumStringLength(masm(), ecx, edx, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_string_length, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}Object* KeyedLoadStubCompiler::CompileLoadLongStringLength(String* name) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_string_length, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadLongStringLength(masm(), ecx, edx, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_string_length, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { // ----------- S t a t e ------------- // -- esp[0] : return address // -- esp[4] : name // -- esp[8] : receiver // ----------------------------------- HandleScope scope; Label miss; __ mov(eax, (Operand(esp, kPointerSize))); __ mov(ecx, (Operand(esp, 2 * kPointerSize))); __ IncrementCounter(&Counters::keyed_load_function_prototype, 1); // Check that the name has not changed. __ cmp(Operand(eax), Immediate(Handle<String>(name))); __ j(not_equal, &miss, not_taken); GenerateLoadFunctionPrototype(masm(), ecx, edx, ebx, &miss); __ bind(&miss); __ DecrementCounter(&Counters::keyed_load_function_prototype, 1); GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); // Return the generated code. return GetCode(CALLBACKS);}#undef __} } // namespace v8::internal
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -