Revision: 17451
Author: [email protected]
Date: Thu Oct 31 14:32:08 2013 UTC
Log: MIPS: Fix uint32-to-smi conversion in Lithium.
Port r17441 (f1968f4)
BUG=chromium:309623
TEST=mjsunit/regress/regress-crbug-309623
[email protected]
Review URL: https://codereview.chromium.org/49783010
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=17451
Modified:
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.h
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Oct 23
13:48:04 2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Thu Oct 31
14:32:08 2013 UTC
@@ -4584,9 +4584,7 @@
void LCodeGen::DoInteger32ToSmi(LInteger32ToSmi* instr) {
LOperand* input = instr->value();
- ASSERT(input->IsRegister());
LOperand* output = instr->result();
- ASSERT(output->IsRegister());
Register scratch = scratch0();
__ SmiTagCheckOverflow(ToRegister(output), ToRegister(input), scratch);
@@ -4605,6 +4603,19 @@
__ mtc1(ToRegister(input), dbl_scratch);
__ Cvt_d_uw(ToDoubleRegister(output), dbl_scratch, f22);
}
+
+
+void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) {
+ LOperand* input = instr->value();
+ LOperand* output = instr->result();
+ if (!instr->hydrogen()->value()->HasRange() ||
+ !instr->hydrogen()->value()->range()->IsInSmiRange()) {
+ Register scratch = scratch0();
+ __ And(scratch, ToRegister(input), Operand(0xc0000000));
+ DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg));
+ }
+ __ SmiTag(ToRegister(output), ToRegister(input));
+}
void LCodeGen::DoNumberTagI(LNumberTagI* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Oct 21 22:20:45
2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Thu Oct 31 14:32:08
2013 UTC
@@ -1934,8 +1934,9 @@
} else if (to.IsSmi()) {
HValue* val = instr->value();
LOperand* value = UseRegister(val);
- LInstruction* result =
- DefineSameAsFirst(new(zone()) LInteger32ToSmi(value));
+ LInstruction* result = val->CheckFlag(HInstruction::kUint32)
+ ? DefineSameAsFirst(new(zone()) LUint32ToSmi(value))
+ : DefineSameAsFirst(new(zone()) LInteger32ToSmi(value));
if (val->HasRange() && val->range()->IsInSmiRange()) {
return result;
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Mon Oct 21 22:20:45
2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-mips.h Thu Oct 31 14:32:08
2013 UTC
@@ -182,6 +182,7 @@
V(Typeof) \
V(TypeofIsAndBranch) \
V(Uint32ToDouble) \
+ V(Uint32ToSmi) \
V(UnknownOSRValue) \
V(ValueOf) \
V(WrapReceiver)
@@ -2052,6 +2053,19 @@
};
+class LUint32ToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LUint32ToSmi(LOperand* value) {
+ inputs_[0] = value;
+ }
+
+ LOperand* value() { return inputs_[0]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(Uint32ToSmi, "uint32-to-smi")
+ DECLARE_HYDROGEN_ACCESSOR(Change)
+};
+
+
class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
public:
explicit LNumberTagI(LOperand* value) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.