| 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 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3149 __ IncrementCounter(counters->named_load_global_stub(), 1); | 3149 __ IncrementCounter(counters->named_load_global_stub(), 1); |
| 3150 // The code above already loads the result into the return register. | 3150 // The code above already loads the result into the return register. |
| 3151 __ ret(0); | 3151 __ ret(0); |
| 3152 | 3152 |
| 3153 // Return the generated code. | 3153 // Return the generated code. |
| 3154 return GetCode(kind(), Code::NORMAL, name); | 3154 return GetCode(kind(), Code::NORMAL, name); |
| 3155 } | 3155 } |
| 3156 | 3156 |
| 3157 | 3157 |
| 3158 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( | 3158 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
| 3159 MapHandleList* receiver_maps, | 3159 TypeHandleList* types, |
| 3160 CodeHandleList* handlers, | 3160 CodeHandleList* handlers, |
| 3161 Handle<Name> name, | 3161 Handle<Name> name, |
| 3162 Code::StubType type, | 3162 Code::StubType type, |
| 3163 IcCheckType check) { | 3163 IcCheckType check) { |
| 3164 Label miss; | 3164 Label miss; |
| 3165 | 3165 |
| 3166 if (check == PROPERTY) { | 3166 if (check == PROPERTY) { |
| 3167 GenerateNameCheck(name, this->name(), &miss); | 3167 GenerateNameCheck(name, this->name(), &miss); |
| 3168 } | 3168 } |
| 3169 | 3169 |
| 3170 Label number_case; | 3170 Label number_case; |
| 3171 Label* smi_target = HasHeapNumberMap(receiver_maps) ? &number_case : &miss; | 3171 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
| 3172 __ JumpIfSmi(receiver(), smi_target); | 3172 __ JumpIfSmi(receiver(), smi_target); |
| 3173 | 3173 |
| 3174 Register map_reg = scratch1(); | 3174 Register map_reg = scratch1(); |
| 3175 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); | 3175 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
| 3176 int receiver_count = receiver_maps->length(); | 3176 int receiver_count = types->length(); |
| 3177 int number_of_handled_maps = 0; | 3177 int number_of_handled_maps = 0; |
| 3178 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); | |
| 3179 for (int current = 0; current < receiver_count; ++current) { | 3178 for (int current = 0; current < receiver_count; ++current) { |
| 3180 Handle<Map> map = receiver_maps->at(current); | 3179 Handle<Type> type = types->at(current); |
| 3180 Handle<Map> map = IC::GetMap(*type, isolate()); |
| 3181 if (!map->is_deprecated()) { | 3181 if (!map->is_deprecated()) { |
| 3182 number_of_handled_maps++; | 3182 number_of_handled_maps++; |
| 3183 __ cmp(map_reg, map); | 3183 __ cmp(map_reg, map); |
| 3184 if (map.is_identical_to(heap_number_map)) { | 3184 if (type->Is(Type::Number())) { |
| 3185 ASSERT(!number_case.is_unused()); | 3185 ASSERT(!number_case.is_unused()); |
| 3186 __ bind(&number_case); | 3186 __ bind(&number_case); |
| 3187 } | 3187 } |
| 3188 __ j(equal, handlers->at(current)); | 3188 __ j(equal, handlers->at(current)); |
| 3189 } | 3189 } |
| 3190 } | 3190 } |
| 3191 ASSERT(number_of_handled_maps != 0); | 3191 ASSERT(number_of_handled_maps != 0); |
| 3192 | 3192 |
| 3193 __ bind(&miss); | 3193 __ bind(&miss); |
| 3194 TailCallBuiltin(masm(), MissBuiltin(kind())); | 3194 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3246 // ----------------------------------- | 3246 // ----------------------------------- |
| 3247 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 3247 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 3248 } | 3248 } |
| 3249 | 3249 |
| 3250 | 3250 |
| 3251 #undef __ | 3251 #undef __ |
| 3252 | 3252 |
| 3253 } } // namespace v8::internal | 3253 } } // namespace v8::internal |
| 3254 | 3254 |
| 3255 #endif // V8_TARGET_ARCH_IA32 | 3255 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |