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 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3061 __ IncrementCounter(counters->named_load_global_stub(), 1); | 3061 __ IncrementCounter(counters->named_load_global_stub(), 1); |
3062 __ movq(rax, rbx); | 3062 __ movq(rax, rbx); |
3063 __ ret(0); | 3063 __ ret(0); |
3064 | 3064 |
3065 // Return the generated code. | 3065 // Return the generated code. |
3066 return GetCode(kind(), Code::NORMAL, name); | 3066 return GetCode(kind(), Code::NORMAL, name); |
3067 } | 3067 } |
3068 | 3068 |
3069 | 3069 |
3070 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( | 3070 Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC( |
3071 MapHandleList* receiver_maps, | 3071 TypeHandleList* types, |
3072 CodeHandleList* handlers, | 3072 CodeHandleList* handlers, |
3073 Handle<Name> name, | 3073 Handle<Name> name, |
3074 Code::StubType type, | 3074 Code::StubType type, |
3075 IcCheckType check) { | 3075 IcCheckType check) { |
3076 Label miss; | 3076 Label miss; |
3077 | 3077 |
3078 if (check == PROPERTY) { | 3078 if (check == PROPERTY) { |
3079 GenerateNameCheck(name, this->name(), &miss); | 3079 GenerateNameCheck(name, this->name(), &miss); |
3080 } | 3080 } |
3081 | 3081 |
3082 Label number_case; | 3082 Label number_case; |
3083 Label* smi_target = HasHeapNumberMap(receiver_maps) ? &number_case : &miss; | 3083 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
3084 __ JumpIfSmi(receiver(), smi_target); | 3084 __ JumpIfSmi(receiver(), smi_target); |
3085 | 3085 |
3086 Register map_reg = scratch1(); | 3086 Register map_reg = scratch1(); |
3087 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); | 3087 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
3088 int receiver_count = receiver_maps->length(); | 3088 int receiver_count = types->length(); |
3089 int number_of_handled_maps = 0; | 3089 int number_of_handled_maps = 0; |
3090 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); | |
3091 for (int current = 0; current < receiver_count; ++current) { | 3090 for (int current = 0; current < receiver_count; ++current) { |
3092 Handle<Map> map = receiver_maps->at(current); | 3091 Handle<Type> type = types->at(current); |
| 3092 Handle<Map> map = IC::GetMap(*type, isolate()); |
3093 if (!map->is_deprecated()) { | 3093 if (!map->is_deprecated()) { |
3094 number_of_handled_maps++; | 3094 number_of_handled_maps++; |
3095 // Check map and tail call if there's a match | 3095 // Check map and tail call if there's a match |
3096 __ Cmp(map_reg, receiver_maps->at(current)); | 3096 __ Cmp(map_reg, map); |
3097 if (map.is_identical_to(heap_number_map)) { | 3097 if (type->Is(Type::Number())) { |
3098 ASSERT(!number_case.is_unused()); | 3098 ASSERT(!number_case.is_unused()); |
3099 __ bind(&number_case); | 3099 __ bind(&number_case); |
3100 } | 3100 } |
3101 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); | 3101 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); |
3102 } | 3102 } |
3103 } | 3103 } |
3104 ASSERT(number_of_handled_maps > 0); | 3104 ASSERT(number_of_handled_maps > 0); |
3105 | 3105 |
3106 __ bind(&miss); | 3106 __ bind(&miss); |
3107 TailCallBuiltin(masm(), MissBuiltin(kind())); | 3107 TailCallBuiltin(masm(), MissBuiltin(kind())); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3157 // ----------------------------------- | 3157 // ----------------------------------- |
3158 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 3158 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
3159 } | 3159 } |
3160 | 3160 |
3161 | 3161 |
3162 #undef __ | 3162 #undef __ |
3163 | 3163 |
3164 } } // namespace v8::internal | 3164 } } // namespace v8::internal |
3165 | 3165 |
3166 #endif // V8_TARGET_ARCH_X64 | 3166 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |