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

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: 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 4135 matching lines...) Expand 10 before | Expand all | Expand 10 after
4146 __ Tbnz(dividend, kWSignBit, &deopt); 4146 __ Tbnz(dividend, kWSignBit, &deopt);
4147 } else { 4147 } else {
4148 DeoptimizeIfNegative(dividend, instr->environment()); 4148 DeoptimizeIfNegative(dividend, instr->environment());
4149 } 4149 }
4150 } 4150 }
4151 } 4151 }
4152 __ Bind(&done); 4152 __ Bind(&done);
4153 } 4153 }
4154 4154
4155 4155
4156 void LCodeGen::DoMulConstI(LMulConstI* instr) { 4156 void LCodeGen::DoMulConstI(LMulConstI* instr) {
jbramley 2014/02/03 15:46:32 Since it now handles smis, could you rename it to
4157 // TODO(jbramley): Support smi operations (or make a separate DoMulConstS). 4157 ASSERT(instr->hydrogen()->representation().IsSmiOrInteger32());
4158 4158 bool is_smi = instr->hydrogen()->representation().IsSmi();
4159 Register result = ToRegister32(instr->result()); 4159 Register result =
4160 Register left = ToRegister32(instr->left()); 4160 is_smi ? ToRegister(instr->result()) : ToRegister32(instr->result());
4161 Register left =
4162 is_smi ? ToRegister(instr->left()) : ToRegister32(instr->left()) ;
4161 int32_t right = ToInteger32(instr->right()); 4163 int32_t right = ToInteger32(instr->right());
4162 4164
4163 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); 4165 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow);
4164 bool bailout_on_minus_zero = 4166 bool bailout_on_minus_zero =
4165 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); 4167 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
4166 4168
4167 if (bailout_on_minus_zero) { 4169 if (bailout_on_minus_zero) {
4168 if (right < 0) { 4170 if (right < 0) {
4169 // The result is -0 if right is negative and left is zero. 4171 // The result is -0 if right is negative and left is zero.
4170 DeoptimizeIfZero(left, instr->environment()); 4172 DeoptimizeIfZero(left, instr->environment());
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
5662 __ Bind(&out_of_object); 5664 __ Bind(&out_of_object);
5663 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5665 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
5664 // Index is equal to negated out of object property index plus 1. 5666 // Index is equal to negated out of object property index plus 1.
5665 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5667 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
5666 __ Ldr(result, FieldMemOperand(result, 5668 __ Ldr(result, FieldMemOperand(result,
5667 FixedArray::kHeaderSize - kPointerSize)); 5669 FixedArray::kHeaderSize - kPointerSize));
5668 __ Bind(&done); 5670 __ Bind(&done);
5669 } 5671 }
5670 5672
5671 } } // namespace v8::internal 5673 } } // 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