Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 68523009: Also support smi in load-ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = HasHeapNumberMap(receiver_maps) ? &number_case : &miss;
3076 __ JumpIfSmi(receiver(), smi_target);
3077
3075 Register map_reg = scratch1(); 3078 Register map_reg = scratch1();
3076 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 3079 __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
3077 int receiver_count = receiver_maps->length(); 3080 int receiver_count = receiver_maps->length();
3078 int number_of_handled_maps = 0; 3081 int number_of_handled_maps = 0;
3082 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map();
3079 for (int current = 0; current < receiver_count; ++current) { 3083 for (int current = 0; current < receiver_count; ++current) {
3080 Handle<Map> map = receiver_maps->at(current); 3084 Handle<Map> map = receiver_maps->at(current);
3081 if (!map->is_deprecated()) { 3085 if (!map->is_deprecated()) {
3082 number_of_handled_maps++; 3086 number_of_handled_maps++;
3083 // Check map and tail call if there's a match 3087 // Check map and tail call if there's a match
3084 __ Cmp(map_reg, receiver_maps->at(current)); 3088 __ Cmp(map_reg, receiver_maps->at(current));
3089 if (map.is_identical_to(heap_number_map)) {
3090 ASSERT(!number_case.is_unused());
3091 __ bind(&number_case);
3092 }
3085 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET); 3093 __ j(equal, handlers->at(current), RelocInfo::CODE_TARGET);
3086 } 3094 }
3087 } 3095 }
3088 ASSERT(number_of_handled_maps > 0); 3096 ASSERT(number_of_handled_maps > 0);
3089 3097
3090 __ bind(&miss); 3098 __ bind(&miss);
3091 TailCallBuiltin(masm(), MissBuiltin(kind())); 3099 TailCallBuiltin(masm(), MissBuiltin(kind()));
3092 3100
3093 // Return the generated code. 3101 // Return the generated code.
3094 InlineCacheState state = 3102 InlineCacheState state =
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3141 // ----------------------------------- 3149 // -----------------------------------
3142 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3150 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3143 } 3151 }
3144 3152
3145 3153
3146 #undef __ 3154 #undef __
3147 3155
3148 } } // namespace v8::internal 3156 } } // namespace v8::internal
3149 3157
3150 #endif // V8_TARGET_ARCH_X64 3158 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698