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 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3047 CodeHandleList* handlers, | 3047 CodeHandleList* handlers, |
3048 Handle<Name> name, | 3048 Handle<Name> name, |
3049 Code::StubType type, | 3049 Code::StubType type, |
3050 IcCheckType check) { | 3050 IcCheckType check) { |
3051 Label miss; | 3051 Label miss; |
3052 | 3052 |
3053 if (check == PROPERTY) { | 3053 if (check == PROPERTY) { |
3054 GenerateNameCheck(name, this->name(), &miss); | 3054 GenerateNameCheck(name, this->name(), &miss); |
3055 } | 3055 } |
3056 | 3056 |
3057 __ JumpIfSmi(receiver(), &miss); | 3057 Label number_case; |
| 3058 Label* smi_handler = &miss; |
| 3059 for (int i = 0; i < receiver_maps->length(); ++i) { |
| 3060 Handle<Map> map = receiver_maps->at(i); |
| 3061 if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
| 3062 // Do not jump to the handler directly to ensure maps / handlers are still |
| 3063 // in sync so updating a polymorphic IC can gather maps / handlers in |
| 3064 // sequence. |
| 3065 smi_handler = &number_case; |
| 3066 break; |
| 3067 } |
| 3068 } |
| 3069 __ JumpIfSmi(receiver(), smi_handler); |
| 3070 |
3058 Register map_reg = scratch1(); | 3071 Register map_reg = scratch1(); |
3059 | 3072 |
3060 int receiver_count = receiver_maps->length(); | 3073 int receiver_count = receiver_maps->length(); |
3061 int number_of_handled_maps = 0; | 3074 int number_of_handled_maps = 0; |
3062 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 3075 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
3063 for (int current = 0; current < receiver_count; ++current) { | 3076 for (int current = 0; current < receiver_count; ++current) { |
3064 Handle<Map> map = receiver_maps->at(current); | 3077 Handle<Map> map = receiver_maps->at(current); |
3065 if (!map->is_deprecated()) { | 3078 if (!map->is_deprecated()) { |
3066 number_of_handled_maps++; | 3079 number_of_handled_maps++; |
3067 __ mov(ip, Operand(receiver_maps->at(current))); | 3080 __ mov(ip, Operand(receiver_maps->at(current))); |
3068 __ cmp(map_reg, ip); | 3081 __ cmp(map_reg, ip); |
| 3082 if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
| 3083 ASSERT(!number_case.is_unused()); |
| 3084 __ bind(&number_case); |
| 3085 } |
3069 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq); | 3086 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq); |
3070 } | 3087 } |
3071 } | 3088 } |
3072 ASSERT(number_of_handled_maps != 0); | 3089 ASSERT(number_of_handled_maps != 0); |
3073 | 3090 |
3074 __ bind(&miss); | 3091 __ bind(&miss); |
3075 TailCallBuiltin(masm(), MissBuiltin(kind())); | 3092 TailCallBuiltin(masm(), MissBuiltin(kind())); |
3076 | 3093 |
3077 // Return the generated code. | 3094 // Return the generated code. |
3078 InlineCacheState state = | 3095 InlineCacheState state = |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3156 // ----------------------------------- | 3173 // ----------------------------------- |
3157 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3174 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3158 } | 3175 } |
3159 | 3176 |
3160 | 3177 |
3161 #undef __ | 3178 #undef __ |
3162 | 3179 |
3163 } } // namespace v8::internal | 3180 } } // namespace v8::internal |
3164 | 3181 |
3165 #endif // V8_TARGET_ARCH_ARM | 3182 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |