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

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

Issue 16134003: Support Smi in CompareIDAndBranch (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 6 months 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/lithium-arm.cc ('k') | src/hydrogen.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 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 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2407 } else { 2407 } else {
2408 if (instr->is_double()) { 2408 if (instr->is_double()) {
2409 // Compare left and right operands as doubles and load the 2409 // Compare left and right operands as doubles and load the
2410 // resulting flags into the normal status register. 2410 // resulting flags into the normal status register.
2411 __ VFPCompareAndSetFlags(ToDoubleRegister(left), ToDoubleRegister(right)); 2411 __ VFPCompareAndSetFlags(ToDoubleRegister(left), ToDoubleRegister(right));
2412 // If a NaN is involved, i.e. the result is unordered (V set), 2412 // If a NaN is involved, i.e. the result is unordered (V set),
2413 // jump to false block label. 2413 // jump to false block label.
2414 __ b(vs, chunk_->GetAssemblyLabel(false_block)); 2414 __ b(vs, chunk_->GetAssemblyLabel(false_block));
2415 } else { 2415 } else {
2416 if (right->IsConstantOperand()) { 2416 if (right->IsConstantOperand()) {
2417 __ cmp(ToRegister(left), 2417 int32_t value = ToInteger32(LConstantOperand::cast(right));
2418 Operand(ToInteger32(LConstantOperand::cast(right)))); 2418 if (instr->hydrogen_value()->representation().IsSmi()) {
2419 __ cmp(ToRegister(left), Operand(Smi::FromInt(value)));
2420 } else {
2421 __ cmp(ToRegister(left), Operand(value));
2422 }
2419 } else if (left->IsConstantOperand()) { 2423 } else if (left->IsConstantOperand()) {
2420 __ cmp(ToRegister(right), 2424 int32_t value = ToInteger32(LConstantOperand::cast(left));
2421 Operand(ToInteger32(LConstantOperand::cast(left)))); 2425 if (instr->hydrogen_value()->representation().IsSmi()) {
2426 __ cmp(ToRegister(right), Operand(Smi::FromInt(value)));
2427 } else {
2428 __ cmp(ToRegister(right), Operand(value));
2429 }
2422 // We transposed the operands. Reverse the condition. 2430 // We transposed the operands. Reverse the condition.
2423 cond = ReverseCondition(cond); 2431 cond = ReverseCondition(cond);
2424 } else { 2432 } else {
2425 __ cmp(ToRegister(left), ToRegister(right)); 2433 __ cmp(ToRegister(left), ToRegister(right));
2426 } 2434 }
2427 } 2435 }
2428 EmitBranch(true_block, false_block, cond); 2436 EmitBranch(true_block, false_block, cond);
2429 } 2437 }
2430 } 2438 }
2431 2439
(...skipping 3540 matching lines...) Expand 10 before | Expand all | Expand 10 after
5972 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5980 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5973 __ ldr(result, FieldMemOperand(scratch, 5981 __ ldr(result, FieldMemOperand(scratch,
5974 FixedArray::kHeaderSize - kPointerSize)); 5982 FixedArray::kHeaderSize - kPointerSize));
5975 __ bind(&done); 5983 __ bind(&done);
5976 } 5984 }
5977 5985
5978 5986
5979 #undef __ 5987 #undef __
5980 5988
5981 } } // namespace v8::internal 5989 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698