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 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 CodeHandleList* handlers, | 3064 CodeHandleList* handlers, |
3065 Handle<Name> name, | 3065 Handle<Name> name, |
3066 Code::StubType type, | 3066 Code::StubType type, |
3067 IcCheckType check) { | 3067 IcCheckType check) { |
3068 Label miss; | 3068 Label miss; |
3069 | 3069 |
3070 if (check == PROPERTY) { | 3070 if (check == PROPERTY) { |
3071 GenerateNameCheck(name, this->name(), &miss); | 3071 GenerateNameCheck(name, this->name(), &miss); |
3072 } | 3072 } |
3073 | 3073 |
3074 __ JumpIfSmi(receiver(), &miss); | 3074 Label number_case; |
| 3075 Label* smi_target = &miss; |
| 3076 for (int i = 0; i < receiver_maps->length(); ++i) { |
| 3077 Handle<Map> map = receiver_maps->at(i); |
| 3078 if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
| 3079 // Indirectly jump to the number handler to ensure map / handler pairs are |
| 3080 // still in sync, rather than off-by-one because of an extra handler in |
| 3081 // the beginning of the stub. |
| 3082 smi_target = &number_case; |
| 3083 break; |
| 3084 } |
| 3085 } |
| 3086 __ JumpIfSmi(receiver(), smi_target); |
| 3087 |
3075 Register map_reg = scratch1(); | 3088 Register map_reg = scratch1(); |
3076 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); | 3089 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
3077 int receiver_count = receiver_maps->length(); | 3090 int receiver_count = receiver_maps->length(); |
3078 int number_of_handled_maps = 0; | 3091 int number_of_handled_maps = 0; |
3079 for (int current = 0; current < receiver_count; ++current) { | 3092 for (int current = 0; current < receiver_count; ++current) { |
3080 Handle<Map> map = receiver_maps->at(current); | 3093 Handle<Map> map = receiver_maps->at(current); |
3081 if (!map->is_deprecated()) { | 3094 if (!map->is_deprecated()) { |
3082 number_of_handled_maps++; | 3095 number_of_handled_maps++; |
3083 // Check map and tail call if there's a match | 3096 // Check map and tail call if there's a match |
3084 __ Cmp(map_reg, receiver_maps->at(current)); | 3097 __ Cmp(map_reg, receiver_maps->at(current)); |
| 3098 if (map.is_identical_to(isolate()->factory()->heap_number_map())) { |
| 3099 ASSERT(!number_case.is_unused()); |
| 3100 __ bind(&number_case); |
| 3101 } |
3085 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); | 3102 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); |
3086 } | 3103 } |
3087 } | 3104 } |
3088 ASSERT(number_of_handled_maps > 0); | 3105 ASSERT(number_of_handled_maps > 0); |
3089 | 3106 |
3090 __ bind(&miss); | 3107 __ bind(&miss); |
3091 TailCallBuiltin(masm(), MissBuiltin(kind())); | 3108 TailCallBuiltin(masm(), MissBuiltin(kind())); |
3092 | 3109 |
3093 // Return the generated code. | 3110 // Return the generated code. |
3094 InlineCacheState state = | 3111 InlineCacheState state = |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 // ----------------------------------- | 3158 // ----------------------------------- |
3142 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3159 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3143 } | 3160 } |
3144 | 3161 |
3145 | 3162 |
3146 #undef __ | 3163 #undef __ |
3147 | 3164 |
3148 } } // namespace v8::internal | 3165 } } // namespace v8::internal |
3149 | 3166 |
3150 #endif // V8_TARGET_ARCH_X64 | 3167 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |