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

Side by Side Diff: src/ia32/stub-cache-ia32.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/arm/stub-cache-arm.cc ('k') | src/ic.h » ('j') | 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 3145 matching lines...) Expand 10 before | Expand all | Expand 10 after
3156 CodeHandleList* handlers, 3156 CodeHandleList* handlers,
3157 Handle<Name> name, 3157 Handle<Name> name,
3158 Code::StubType type, 3158 Code::StubType type,
3159 IcCheckType check) { 3159 IcCheckType check) {
3160 Label miss; 3160 Label miss;
3161 3161
3162 if (check == PROPERTY) { 3162 if (check == PROPERTY) {
3163 GenerateNameCheck(name, this->name(), &miss); 3163 GenerateNameCheck(name, this->name(), &miss);
3164 } 3164 }
3165 3165
3166 __ JumpIfSmi(receiver(), &miss); 3166 Label number_case;
3167 Label* smi_target = HasHeapNumberMap(receiver_maps) ? &number_case : &miss;
3168 __ JumpIfSmi(receiver(), smi_target);
3169
3167 Register map_reg = scratch1(); 3170 Register map_reg = scratch1();
3168 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 3171 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
3169 int receiver_count = receiver_maps->length(); 3172 int receiver_count = receiver_maps->length();
3170 int number_of_handled_maps = 0; 3173 int number_of_handled_maps = 0;
3174 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map();
3171 for (int current = 0; current < receiver_count; ++current) { 3175 for (int current = 0; current < receiver_count; ++current) {
3172 Handle<Map> map = receiver_maps->at(current); 3176 Handle<Map> map = receiver_maps->at(current);
3173 if (!map->is_deprecated()) { 3177 if (!map->is_deprecated()) {
3174 number_of_handled_maps++; 3178 number_of_handled_maps++;
3175 __ cmp(map_reg, map); 3179 __ cmp(map_reg, map);
3180 if (map.is_identical_to(heap_number_map)) {
3181 ASSERT(!number_case.is_unused());
3182 __ bind(&number_case);
3183 }
3176 __ j(equal, handlers->at(current)); 3184 __ j(equal, handlers->at(current));
3177 } 3185 }
3178 } 3186 }
3179 ASSERT(number_of_handled_maps != 0); 3187 ASSERT(number_of_handled_maps != 0);
3180 3188
3181 __ bind(&miss); 3189 __ bind(&miss);
3182 TailCallBuiltin(masm(), MissBuiltin(kind())); 3190 TailCallBuiltin(masm(), MissBuiltin(kind()));
3183 3191
3184 // Return the generated code. 3192 // Return the generated code.
3185 InlineCacheState state = 3193 InlineCacheState state =
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 // ----------------------------------- 3242 // -----------------------------------
3235 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3243 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3236 } 3244 }
3237 3245
3238 3246
3239 #undef __ 3247 #undef __
3240 3248
3241 } } // namespace v8::internal 3249 } } // namespace v8::internal
3242 3250
3243 #endif // V8_TARGET_ARCH_IA32 3251 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698