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

Side by Side Diff: src/codegen-arm.cc

Issue 9040: * Added check for HeapNumber in the fast-cast Smi switch. (Closed)
Patch Set: Fix ofr Issue 137. Addressed reviewer comments Created 12 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
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 SwitchStatement* node, 1240 SwitchStatement* node,
1241 int min_index, 1241 int min_index,
1242 int range, 1242 int range,
1243 Label* fail_label, 1243 Label* fail_label,
1244 Vector<Label*> case_targets, 1244 Vector<Label*> case_targets,
1245 Vector<Label> case_labels) { 1245 Vector<Label> case_labels) {
1246 1246
1247 ASSERT(kSmiTag == 0 && kSmiTagSize <= 2); 1247 ASSERT(kSmiTag == 0 && kSmiTagSize <= 2);
1248 1248
1249 __ pop(r0); 1249 __ pop(r0);
1250
1251 // Test for a Smi value in a HeapNumber.
1252 Label is_smi;
1253 __ tst(r0, Operand(kSmiTagMask));
1254 __ b(eq, &is_smi);
1255 __ ldr(r1, MemOperand(r0, HeapObject::kMapOffset - kHeapObjectTag));
1256 __ ldrb(r1, MemOperand(r1, Map::kInstanceTypeOffset - kHeapObjectTag));
1257 __ cmp(r1, Operand(HEAP_NUMBER_TYPE));
1258 __ b(ne, fail_label);
1259 __ push(r0);
1260 __ CallRuntime(Runtime::kNumberToSmi, 1);
1261 __ bind(&is_smi);
1262
1250 if (min_index != 0) { 1263 if (min_index != 0) {
1251 // small positive numbers can be immediate operands. 1264 // small positive numbers can be immediate operands.
1252 if (min_index < 0) { 1265 if (min_index < 0) {
1253 __ add(r0, r0, Operand(Smi::FromInt(-min_index))); 1266 __ add(r0, r0, Operand(Smi::FromInt(-min_index)));
1254 } else { 1267 } else {
1255 __ sub(r0, r0, Operand(Smi::FromInt(min_index))); 1268 __ sub(r0, r0, Operand(Smi::FromInt(min_index)));
1256 } 1269 }
1257 } 1270 }
1258 __ tst(r0, Operand(0x80000000 | kSmiTagMask)); 1271 __ tst(r0, Operand(0x80000000 | kSmiTagMask));
1259 __ b(ne, fail_label); 1272 __ b(ne, fail_label);
(...skipping 2950 matching lines...) Expand 10 before | Expand all | Expand 10 after
4210 // Slow-case: Non-function called. 4223 // Slow-case: Non-function called.
4211 __ bind(&slow); 4224 __ bind(&slow);
4212 __ mov(r0, Operand(argc_)); // Setup the number of arguments. 4225 __ mov(r0, Operand(argc_)); // Setup the number of arguments.
4213 __ InvokeBuiltin(Builtins::CALL_NON_FUNCTION, JUMP_JS); 4226 __ InvokeBuiltin(Builtins::CALL_NON_FUNCTION, JUMP_JS);
4214 } 4227 }
4215 4228
4216 4229
4217 #undef __ 4230 #undef __
4218 4231
4219 } } // namespace v8::internal 4232 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698