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

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: 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') | src/ic-inl.h » ('J')
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 = &miss;
ulan 2013/11/14 14:52:11 I think it would be more readable if you would def
3168 for (int i = 0; i < receiver_maps->length(); ++i) {
3169 Handle<Map> map = receiver_maps->at(i);
3170 if (map.is_identical_to(isolate()->factory()->heap_number_map())) {
ulan 2013/11/14 14:52:11 Micro-optimization: keep isolate()->factory()->hea
3171 // Indirectly jump to the number handler to ensure map / handler pairs are
3172 // still in sync, rather than off-by-one because of an extra handler in
3173 // the beginning of the stub.
3174 smi_target = &number_case;
3175 break;
3176 }
3177 }
3178 __ JumpIfSmi(receiver(), smi_target);
3179
3167 Register map_reg = scratch1(); 3180 Register map_reg = scratch1();
3168 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 3181 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
3169 int receiver_count = receiver_maps->length(); 3182 int receiver_count = receiver_maps->length();
3170 int number_of_handled_maps = 0; 3183 int number_of_handled_maps = 0;
3171 for (int current = 0; current < receiver_count; ++current) { 3184 for (int current = 0; current < receiver_count; ++current) {
3172 Handle<Map> map = receiver_maps->at(current); 3185 Handle<Map> map = receiver_maps->at(current);
3173 if (!map->is_deprecated()) { 3186 if (!map->is_deprecated()) {
3174 number_of_handled_maps++; 3187 number_of_handled_maps++;
3175 __ cmp(map_reg, map); 3188 __ cmp(map_reg, map);
3189 if (map.is_identical_to(isolate()->factory()->heap_number_map())) {
3190 ASSERT(!number_case.is_unused());
3191 __ bind(&number_case);
3192 }
3176 __ j(equal, handlers->at(current)); 3193 __ j(equal, handlers->at(current));
3177 } 3194 }
3178 } 3195 }
3179 ASSERT(number_of_handled_maps != 0); 3196 ASSERT(number_of_handled_maps != 0);
3180 3197
3181 __ bind(&miss); 3198 __ bind(&miss);
3182 TailCallBuiltin(masm(), MissBuiltin(kind())); 3199 TailCallBuiltin(masm(), MissBuiltin(kind()));
3183 3200
3184 // Return the generated code. 3201 // Return the generated code.
3185 InlineCacheState state = 3202 InlineCacheState state =
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 // ----------------------------------- 3251 // -----------------------------------
3235 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3252 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3236 } 3253 }
3237 3254
3238 3255
3239 #undef __ 3256 #undef __
3240 3257
3241 } } // namespace v8::internal 3258 } } // namespace v8::internal
3242 3259
3243 #endif // V8_TARGET_ARCH_IA32 3260 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.h » ('j') | src/ic-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698