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

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

Issue 173703003: Merged r19500 into 3.23 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.23
Patch Set: Created 6 years, 10 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 | « no previous file | src/version.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 2760 matching lines...) Expand 10 before | Expand all | Expand 10 after
2771 Handle<Name> name, 2771 Handle<Name> name,
2772 Code::StubType type, 2772 Code::StubType type,
2773 IcCheckType check) { 2773 IcCheckType check) {
2774 Label miss; 2774 Label miss;
2775 2775
2776 if (check == PROPERTY) { 2776 if (check == PROPERTY) {
2777 GenerateNameCheck(name, this->name(), &miss); 2777 GenerateNameCheck(name, this->name(), &miss);
2778 } 2778 }
2779 2779
2780 Label number_case; 2780 Label number_case;
2781 Register match = scratch1();
2781 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 2782 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
2782 __ JumpIfSmi(receiver(), smi_target); 2783 __ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi.
2783 2784
2784 Register map_reg = scratch1(); 2785 Register map_reg = scratch2();
2785 2786
2786 int receiver_count = types->length(); 2787 int receiver_count = types->length();
2787 int number_of_handled_maps = 0; 2788 int number_of_handled_maps = 0;
2788 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 2789 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
2789 for (int current = 0; current < receiver_count; ++current) { 2790 for (int current = 0; current < receiver_count; ++current) {
2790 Handle<Type> type = types->at(current); 2791 Handle<Type> type = types->at(current);
2791 Handle<Map> map = IC::TypeToMap(*type, isolate()); 2792 Handle<Map> map = IC::TypeToMap(*type, isolate());
2792 if (!map->is_deprecated()) { 2793 if (!map->is_deprecated()) {
2793 number_of_handled_maps++; 2794 number_of_handled_maps++;
2795 // Check map and tail call if there's a match.
2796 // Separate compare from branch, to provide path for above JumpIfSmi().
2797 __ Subu(match, map_reg, Operand(map));
2794 if (type->Is(Type::Number())) { 2798 if (type->Is(Type::Number())) {
2795 ASSERT(!number_case.is_unused()); 2799 ASSERT(!number_case.is_unused());
2796 __ bind(&number_case); 2800 __ bind(&number_case);
2797 } 2801 }
2798 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, 2802 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET,
2799 eq, map_reg, Operand(map)); 2803 eq, match, Operand(zero_reg));
2800 } 2804 }
2801 } 2805 }
2802 ASSERT(number_of_handled_maps != 0); 2806 ASSERT(number_of_handled_maps != 0);
2803 2807
2804 __ bind(&miss); 2808 __ bind(&miss);
2805 TailCallBuiltin(masm(), MissBuiltin(kind())); 2809 TailCallBuiltin(masm(), MissBuiltin(kind()));
2806 2810
2807 // Return the generated code. 2811 // Return the generated code.
2808 InlineCacheState state = 2812 InlineCacheState state =
2809 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; 2813 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 // ----------------------------------- 2891 // -----------------------------------
2888 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 2892 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2889 } 2893 }
2890 2894
2891 2895
2892 #undef __ 2896 #undef __
2893 2897
2894 } } // namespace v8::internal 2898 } } // namespace v8::internal
2895 2899
2896 #endif // V8_TARGET_ARCH_MIPS 2900 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698