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

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

Issue 141763002: De-virtualize GenerateNameCheck. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 } 2640 }
2641 2641
2642 2642
2643 Register* KeyedStoreStubCompiler::registers() { 2643 Register* KeyedStoreStubCompiler::registers() {
2644 // receiver, name, value, scratch1, scratch2, scratch3. 2644 // receiver, name, value, scratch1, scratch2, scratch3.
2645 static Register registers[] = { edx, ecx, eax, ebx, edi, no_reg }; 2645 static Register registers[] = { edx, ecx, eax, ebx, edi, no_reg };
2646 return registers; 2646 return registers;
2647 } 2647 }
2648 2648
2649 2649
2650 void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
2651 Register name_reg,
2652 Label* miss) {
2653 __ cmp(name_reg, Immediate(name));
2654 __ j(not_equal, miss);
2655 }
2656
2657
2658 void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name,
2659 Register name_reg,
2660 Label* miss) {
2661 __ cmp(name_reg, Immediate(name));
2662 __ j(not_equal, miss);
2663 }
2664
2665
2666 #undef __ 2650 #undef __
2667 #define __ ACCESS_MASM(masm) 2651 #define __ ACCESS_MASM(masm)
2668 2652
2669 2653
2670 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, 2654 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
2671 Register receiver, 2655 Register receiver,
2672 Handle<JSFunction> getter) { 2656 Handle<JSFunction> getter) {
2673 { 2657 {
2674 FrameScope scope(masm, StackFrame::INTERNAL); 2658 FrameScope scope(masm, StackFrame::INTERNAL);
2675 2659
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 2720
2737 2721
2738 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( 2722 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
2739 TypeHandleList* types, 2723 TypeHandleList* types,
2740 CodeHandleList* handlers, 2724 CodeHandleList* handlers,
2741 Handle<Name> name, 2725 Handle<Name> name,
2742 Code::StubType type, 2726 Code::StubType type,
2743 IcCheckType check) { 2727 IcCheckType check) {
2744 Label miss; 2728 Label miss;
2745 2729
2746 if (check == PROPERTY) { 2730 if (check == PROPERTY &&
2747 GenerateNameCheck(name, this->name(), &miss); 2731 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
2732 __ cmp(this->name(), Immediate(name));
2733 __ j(not_equal, &miss);
2748 } 2734 }
2749 2735
2750 Label number_case; 2736 Label number_case;
2751 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 2737 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
2752 __ JumpIfSmi(receiver(), smi_target); 2738 __ JumpIfSmi(receiver(), smi_target);
2753 2739
2754 Register map_reg = scratch1(); 2740 Register map_reg = scratch1();
2755 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 2741 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
2756 int receiver_count = types->length(); 2742 int receiver_count = types->length();
2757 int number_of_handled_maps = 0; 2743 int number_of_handled_maps = 0;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 // ----------------------------------- 2812 // -----------------------------------
2827 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 2813 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2828 } 2814 }
2829 2815
2830 2816
2831 #undef __ 2817 #undef __
2832 2818
2833 } } // namespace v8::internal 2819 } } // namespace v8::internal
2834 2820
2835 #endif // V8_TARGET_ARCH_IA32 2821 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698