OLD | NEW |
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 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2890 __ Ret(); | 2890 __ Ret(); |
2891 | 2891 |
2892 // Return the generated code. | 2892 // Return the generated code. |
2893 return GetICCode(kind(), Code::NORMAL, name); | 2893 return GetICCode(kind(), Code::NORMAL, name); |
2894 } | 2894 } |
2895 | 2895 |
2896 | 2896 |
2897 Handle<Code> BaseLoadStubCompiler::CompilePolymorphicIC( | 2897 Handle<Code> BaseLoadStubCompiler::CompilePolymorphicIC( |
2898 MapHandleList* receiver_maps, | 2898 MapHandleList* receiver_maps, |
2899 CodeHandleList* handlers, | 2899 CodeHandleList* handlers, |
| 2900 int number_of_valid_maps, |
2900 Handle<Name> name, | 2901 Handle<Name> name, |
2901 Code::StubType type, | 2902 Code::StubType type, |
2902 IcCheckType check) { | 2903 IcCheckType check) { |
2903 Label miss; | 2904 Label miss; |
2904 | 2905 |
2905 if (check == PROPERTY) { | 2906 if (check == PROPERTY) { |
2906 GenerateNameCheck(name, this->name(), &miss); | 2907 GenerateNameCheck(name, this->name(), &miss); |
2907 } | 2908 } |
2908 | 2909 |
2909 __ JumpIfSmi(receiver(), &miss); | 2910 __ JumpIfSmi(receiver(), &miss); |
2910 Register map_reg = scratch1(); | 2911 Register map_reg = scratch1(); |
2911 | 2912 |
2912 int receiver_count = receiver_maps->length(); | 2913 int receiver_count = receiver_maps->length(); |
2913 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 2914 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
2914 for (int current = 0; current < receiver_count; ++current) { | 2915 for (int current = 0; current < receiver_count; ++current) { |
2915 __ mov(ip, Operand(receiver_maps->at(current))); | 2916 Handle<Map> map = receiver_maps->at(current); |
2916 __ cmp(map_reg, ip); | 2917 if (!map->is_invalid_transition()) { |
2917 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq); | 2918 __ mov(ip, Operand(receiver_maps->at(current))); |
| 2919 __ cmp(map_reg, ip); |
| 2920 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq); |
| 2921 } |
2918 } | 2922 } |
2919 | 2923 |
2920 __ bind(&miss); | 2924 __ bind(&miss); |
2921 TailCallBuiltin(masm(), MissBuiltin(kind())); | 2925 TailCallBuiltin(masm(), MissBuiltin(kind())); |
2922 | 2926 |
2923 // Return the generated code. | 2927 // Return the generated code. |
2924 InlineCacheState state = | 2928 InlineCacheState state = number_of_valid_maps > 1 ? POLYMORPHIC : MONOMORPHIC; |
2925 receiver_maps->length() > 1 ? POLYMORPHIC : MONOMORPHIC; | |
2926 return GetICCode(kind(), type, name, state); | 2929 return GetICCode(kind(), type, name, state); |
2927 } | 2930 } |
2928 | 2931 |
2929 | 2932 |
2930 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( | 2933 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( |
2931 MapHandleList* receiver_maps, | 2934 MapHandleList* receiver_maps, |
2932 CodeHandleList* handler_stubs, | 2935 CodeHandleList* handler_stubs, |
2933 MapHandleList* transitioned_maps) { | 2936 MapHandleList* transitioned_maps) { |
2934 Label miss; | 2937 Label miss; |
2935 __ JumpIfSmi(receiver(), &miss); | 2938 __ JumpIfSmi(receiver(), &miss); |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3684 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); | 3687 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); |
3685 } | 3688 } |
3686 } | 3689 } |
3687 | 3690 |
3688 | 3691 |
3689 #undef __ | 3692 #undef __ |
3690 | 3693 |
3691 } } // namespace v8::internal | 3694 } } // namespace v8::internal |
3692 | 3695 |
3693 #endif // V8_TARGET_ARCH_ARM | 3696 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |