Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: src/stub-cache-ia32.cc

Issue 10002: Use shorting encoding for mov reg, imm. (Closed)
Patch Set: Remove an accidental change Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/macro-assembler-ia32.cc ('K') | « src/macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 388 }
389 389
390 // Stub never generated for non-global objects that require access 390 // Stub never generated for non-global objects that require access
391 // checks. 391 // checks.
392 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); 392 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
393 393
394 // Perform map transition for the receiver if necessary. 394 // Perform map transition for the receiver if necessary.
395 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { 395 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) {
396 // The properties must be extended before we can store the value. 396 // The properties must be extended before we can store the value.
397 // We jump to a runtime call that extends the propeties array. 397 // We jump to a runtime call that extends the propeties array.
398 __ mov(Operand(ecx), Immediate(Handle<Map>(transition))); 398 __ mov(ecx, Immediate(Handle<Map>(transition)));
Kevin Millikin (Chromium) 2008/11/10 15:05:41 Ditto and below.
399 Handle<Code> ic(Builtins::builtin(storage_extend)); 399 Handle<Code> ic(Builtins::builtin(storage_extend));
400 __ jmp(ic, RelocInfo::CODE_TARGET); 400 __ jmp(ic, RelocInfo::CODE_TARGET);
401 return; 401 return;
402 } 402 }
403 403
404 // Adjust for the number of properties stored in the object. Even in the 404 // Adjust for the number of properties stored in the object. Even in the
405 // face of a transition we can use the old map here because the size of the 405 // face of a transition we can use the old map here because the size of the
406 // object and the number of in-object properties is not going to change. 406 // object and the number of in-object properties is not going to change.
407 index -= object->map()->inobject_properties(); 407 index -= object->map()->inobject_properties();
408 408
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), 621 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
622 Immediate(Factory::hash_table_map())); 622 Immediate(Factory::hash_table_map()));
623 __ j(equal, &miss, not_taken); 623 __ j(equal, &miss, not_taken);
624 break; 624 break;
625 625
626 default: 626 default:
627 UNREACHABLE(); 627 UNREACHABLE();
628 } 628 }
629 629
630 // Get the function and setup the context. 630 // Get the function and setup the context.
631 __ mov(Operand(edi), Immediate(Handle<JSFunction>(function))); 631 __ mov(edi, Immediate(Handle<JSFunction>(function)));
632 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); 632 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
633 633
634 // Jump to the cached code (tail call). 634 // Jump to the cached code (tail call).
635 Handle<Code> code(function->code()); 635 Handle<Code> code(function->code());
636 ParameterCount expected(function->shared()->formal_parameter_count()); 636 ParameterCount expected(function->shared()->formal_parameter_count());
637 __ InvokeCode(code, expected, arguments(), 637 __ InvokeCode(code, expected, arguments(),
638 RelocInfo::CODE_TARGET, JUMP_FUNCTION); 638 RelocInfo::CODE_TARGET, JUMP_FUNCTION);
639 639
640 // Handle call cache miss. 640 // Handle call cache miss.
641 __ bind(&miss); 641 __ bind(&miss);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 __ EnterInternalFrame(); 674 __ EnterInternalFrame();
675 675
676 // Push arguments on the expression stack. 676 // Push arguments on the expression stack.
677 __ push(edx); // receiver 677 __ push(edx); // receiver
678 __ push(reg); // holder 678 __ push(reg); // holder
679 __ push(Operand(ebp, (argc + 3) * kPointerSize)); // name 679 __ push(Operand(ebp, (argc + 3) * kPointerSize)); // name
680 680
681 // Perform call. 681 // Perform call.
682 ExternalReference load_interceptor = 682 ExternalReference load_interceptor =
683 ExternalReference(IC_Utility(IC::kLoadInterceptorProperty)); 683 ExternalReference(IC_Utility(IC::kLoadInterceptorProperty));
684 __ mov(Operand(eax), Immediate(3)); 684 __ mov(eax, Immediate(3));
685 __ mov(Operand(ebx), Immediate(load_interceptor)); 685 __ mov(ebx, Immediate(load_interceptor));
686 686
687 CEntryStub stub; 687 CEntryStub stub;
688 __ CallStub(&stub); 688 __ CallStub(&stub);
689 689
690 // Move result to edi and restore receiver. 690 // Move result to edi and restore receiver.
691 __ mov(Operand(edi), eax); 691 __ mov(edi, eax);
692 __ mov(edx, Operand(ebp, (argc + 2) * kPointerSize)); // receiver 692 __ mov(edx, Operand(ebp, (argc + 2) * kPointerSize)); // receiver
693 693
694 // Exit frame. 694 // Exit frame.
695 __ LeaveInternalFrame(); 695 __ LeaveInternalFrame();
696 696
697 // Check that the function really is a function. 697 // Check that the function really is a function.
698 __ test(edi, Immediate(kSmiTagMask)); 698 __ test(edi, Immediate(kSmiTagMask));
699 __ j(zero, &miss, not_taken); 699 __ j(zero, &miss, not_taken);
700 __ mov(ebx, FieldOperand(edi, HeapObject::kMapOffset)); 700 __ mov(ebx, FieldOperand(edi, HeapObject::kMapOffset));
701 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); 701 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 GenerateStoreField(masm(), 743 GenerateStoreField(masm(),
744 Builtins::StoreIC_ExtendStorage, 744 Builtins::StoreIC_ExtendStorage,
745 object, 745 object,
746 index, 746 index,
747 transition, 747 transition,
748 ebx, ecx, edx, 748 ebx, ecx, edx,
749 &miss); 749 &miss);
750 750
751 // Handle store cache miss. 751 // Handle store cache miss.
752 __ bind(&miss); 752 __ bind(&miss);
753 __ mov(Operand(ecx), Immediate(Handle<String>(name))); // restore name 753 __ mov(ecx, Immediate(Handle<String>(name))); // restore name
754 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); 754 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
755 __ jmp(ic, RelocInfo::CODE_TARGET); 755 __ jmp(ic, RelocInfo::CODE_TARGET);
756 756
757 // Return the generated code. 757 // Return the generated code.
758 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); 758 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION);
759 } 759 }
760 760
761 761
762 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object, 762 Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
763 AccessorInfo* callback, 763 AccessorInfo* callback,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 __ push(eax); // value 800 __ push(eax); // value
801 __ push(ebx); // restore return address 801 __ push(ebx); // restore return address
802 802
803 // Do tail-call to the runtime system. 803 // Do tail-call to the runtime system.
804 ExternalReference store_callback_property = 804 ExternalReference store_callback_property =
805 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); 805 ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
806 __ TailCallRuntime(store_callback_property, 4); 806 __ TailCallRuntime(store_callback_property, 4);
807 807
808 // Handle store cache miss. 808 // Handle store cache miss.
809 __ bind(&miss); 809 __ bind(&miss);
810 __ mov(Operand(ecx), Immediate(Handle<String>(name))); // restore name 810 __ mov(ecx, Immediate(Handle<String>(name))); // restore name
811 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); 811 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
812 __ jmp(ic, RelocInfo::CODE_TARGET); 812 __ jmp(ic, RelocInfo::CODE_TARGET);
813 813
814 // Return the generated code. 814 // Return the generated code.
815 return GetCode(CALLBACKS); 815 return GetCode(CALLBACKS);
816 } 816 }
817 817
818 818
819 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, 819 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
820 String* name) { 820 String* name) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 __ push(eax); // value 855 __ push(eax); // value
856 __ push(ebx); // restore return address 856 __ push(ebx); // restore return address
857 857
858 // Do tail-call to the runtime system. 858 // Do tail-call to the runtime system.
859 ExternalReference store_ic_property = 859 ExternalReference store_ic_property =
860 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); 860 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
861 __ TailCallRuntime(store_ic_property, 3); 861 __ TailCallRuntime(store_ic_property, 3);
862 862
863 // Handle store cache miss. 863 // Handle store cache miss.
864 __ bind(&miss); 864 __ bind(&miss);
865 __ mov(Operand(ecx), Immediate(Handle<String>(name))); // restore name 865 __ mov(ecx, Immediate(Handle<String>(name))); // restore name
866 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); 866 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
867 __ jmp(ic, RelocInfo::CODE_TARGET); 867 __ jmp(ic, RelocInfo::CODE_TARGET);
868 868
869 // Return the generated code. 869 // Return the generated code.
870 return GetCode(INTERCEPTOR); 870 return GetCode(INTERCEPTOR);
871 } 871 }
872 872
873 873
874 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, 874 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
875 int index, 875 int index,
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 1202 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
1203 1203
1204 // Return the generated code. 1204 // Return the generated code.
1205 return GetCode(CALLBACKS); 1205 return GetCode(CALLBACKS);
1206 } 1206 }
1207 1207
1208 1208
1209 #undef __ 1209 #undef __
1210 1210
1211 } } // namespace v8::internal 1211 } } // namespace v8::internal
OLDNEW
« src/macro-assembler-ia32.cc ('K') | « src/macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698