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

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

Issue 22600005: Eliminate intentional conversion from Smi to Int32 in HMul (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Fixed navier stokes benchmark fails Created 7 years, 4 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
« no previous file with comments | « no previous file | src/hydrogen-canonicalize.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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 LConstantOperand* const_op = LConstantOperand::cast(op); 424 LConstantOperand* const_op = LConstantOperand::cast(op);
425 HConstant* constant = chunk_->LookupConstant(const_op); 425 HConstant* constant = chunk_->LookupConstant(const_op);
426 Handle<Object> literal = constant->handle(); 426 Handle<Object> literal = constant->handle();
427 Representation r = chunk_->LookupLiteralRepresentation(const_op); 427 Representation r = chunk_->LookupLiteralRepresentation(const_op);
428 if (r.IsInteger32()) { 428 if (r.IsInteger32()) {
429 ASSERT(literal->IsNumber()); 429 ASSERT(literal->IsNumber());
430 __ mov(scratch, Operand(static_cast<int32_t>(literal->Number()))); 430 __ mov(scratch, Operand(static_cast<int32_t>(literal->Number())));
431 } else if (r.IsDouble()) { 431 } else if (r.IsDouble()) {
432 Abort(kEmitLoadRegisterUnsupportedDoubleImmediate); 432 Abort(kEmitLoadRegisterUnsupportedDoubleImmediate);
433 } else { 433 } else {
434 ASSERT(r.IsTagged()); 434 ASSERT(r.IsSmiOrTagged());
435 __ LoadObject(scratch, literal); 435 __ LoadObject(scratch, literal);
436 } 436 }
437 return scratch; 437 return scratch;
438 } else if (op->IsStackSlot() || op->IsArgument()) { 438 } else if (op->IsStackSlot() || op->IsArgument()) {
439 __ ldr(scratch, ToMemOperand(op)); 439 __ ldr(scratch, ToMemOperand(op));
440 return scratch; 440 return scratch;
441 } 441 }
442 UNREACHABLE(); 442 UNREACHABLE();
443 return scratch; 443 return scratch;
444 } 444 }
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 Register result = ToRegister(instr->result()); 1576 Register result = ToRegister(instr->result());
1577 // Note that result may alias left. 1577 // Note that result may alias left.
1578 Register left = ToRegister(instr->left()); 1578 Register left = ToRegister(instr->left());
1579 LOperand* right_op = instr->right(); 1579 LOperand* right_op = instr->right();
1580 1580
1581 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); 1581 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
1582 bool bailout_on_minus_zero = 1582 bool bailout_on_minus_zero =
1583 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); 1583 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
1584 1584
1585 if (right_op->IsConstantOperand() && !can_overflow) { 1585 if (right_op->IsConstantOperand() && !can_overflow) {
1586 // Use optimized code for specific constants. 1586 int32_t constant = ToInteger32(LConstantOperand::cast(right_op));
1587 int32_t constant = ToRepresentation(
1588 LConstantOperand::cast(right_op),
1589 instr->hydrogen()->right()->representation());
1590 1587
1591 if (bailout_on_minus_zero && (constant < 0)) { 1588 if (bailout_on_minus_zero && (constant < 0)) {
1592 // The case of a null constant will be handled separately. 1589 // The case of a null constant will be handled separately.
1593 // If constant is negative and left is null, the result should be -0. 1590 // If constant is negative and left is null, the result should be -0.
1594 __ cmp(left, Operand::Zero()); 1591 __ cmp(left, Operand::Zero());
1595 DeoptimizeIf(eq, instr->environment()); 1592 DeoptimizeIf(eq, instr->environment());
1596 } 1593 }
1597 1594
1598 switch (constant) { 1595 switch (constant) {
1599 case -1: 1596 case -1:
(...skipping 4187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5787 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5784 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5788 __ ldr(result, FieldMemOperand(scratch, 5785 __ ldr(result, FieldMemOperand(scratch,
5789 FixedArray::kHeaderSize - kPointerSize)); 5786 FixedArray::kHeaderSize - kPointerSize));
5790 __ bind(&done); 5787 __ bind(&done);
5791 } 5788 }
5792 5789
5793 5790
5794 #undef __ 5791 #undef __
5795 5792
5796 } } // namespace v8::internal 5793 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-canonicalize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698