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

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

Issue 152133003: A64: Add support for SMI representation to MulConstI. Also add a test. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Rename LMulConstI to LMulConstIS Created 6 years, 10 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/a64/lithium-a64.cc ('k') | test/mjsunit/smi-mul-const.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 4100 matching lines...) Expand 10 before | Expand all | Expand 10 after
4111 __ Tbnz(dividend, kWSignBit, &deopt); 4111 __ Tbnz(dividend, kWSignBit, &deopt);
4112 } else { 4112 } else {
4113 DeoptimizeIfNegative(dividend, instr->environment()); 4113 DeoptimizeIfNegative(dividend, instr->environment());
4114 } 4114 }
4115 } 4115 }
4116 } 4116 }
4117 __ Bind(&done); 4117 __ Bind(&done);
4118 } 4118 }
4119 4119
4120 4120
4121 void LCodeGen::DoMulConstI(LMulConstI* instr) { 4121 void LCodeGen::DoMulConstIS(LMulConstIS* instr) {
4122 // TODO(jbramley): Support smi operations (or make a separate DoMulConstS). 4122 ASSERT(instr->hydrogen()->representation().IsSmiOrInteger32());
4123 4123 bool is_smi = instr->hydrogen()->representation().IsSmi();
4124 Register result = ToRegister32(instr->result()); 4124 Register result =
4125 Register left = ToRegister32(instr->left()); 4125 is_smi ? ToRegister(instr->result()) : ToRegister32(instr->result());
4126 Register left =
4127 is_smi ? ToRegister(instr->left()) : ToRegister32(instr->left()) ;
4126 int32_t right = ToInteger32(instr->right()); 4128 int32_t right = ToInteger32(instr->right());
4127 4129
4128 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); 4130 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
4129 bool bailout_on_minus_zero = 4131 bool bailout_on_minus_zero =
4130 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); 4132 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
4131 4133
4132 if (bailout_on_minus_zero) { 4134 if (bailout_on_minus_zero) {
4133 if (right < 0) { 4135 if (right < 0) {
4134 // The result is -0 if right is negative and left is zero. 4136 // The result is -0 if right is negative and left is zero.
4135 DeoptimizeIfZero(left, instr->environment()); 4137 DeoptimizeIfZero(left, instr->environment());
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
5578 __ Bind(&out_of_object); 5580 __ Bind(&out_of_object);
5579 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5581 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5580 // Index is equal to negated out of object property index plus 1. 5582 // Index is equal to negated out of object property index plus 1.
5581 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5583 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5582 __ Ldr(result, FieldMemOperand(result, 5584 __ Ldr(result, FieldMemOperand(result,
5583 FixedArray::kHeaderSize - kPointerSize)); 5585 FixedArray::kHeaderSize - kPointerSize));
5584 __ Bind(&done); 5586 __ Bind(&done);
5585 } 5587 }
5586 5588
5587 } } // namespace v8::internal 5589 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | test/mjsunit/smi-mul-const.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698