Revision: 14761
Author: [email protected]
Date: Wed May 22 16:09:22 2013
Log: MIPS: Handle holes in smi-untag from LoadKeyed requiring hole
handling.
Port r14756 (fda1989f)
BUG=
Review URL: https://codereview.chromium.org/15690003
http://code.google.com/p/v8/source/detail?r=14761
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 May 15
07:24:47 2013
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed May 22
16:09:22 2013
@@ -4610,6 +4610,22 @@
__ And(scratch, input, Operand(kHeapObjectTag));
__ SmiUntag(result, input);
DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg));
+ } else if (instr->hydrogen()->value()->IsLoadKeyed()) {
+ HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value());
+ if (load->UsesMustHandleHole()) {
+ __ And(scratch, input, Operand(kHeapObjectTag));
+ __ SmiUntag(result, input);
+ if (load->hole_mode() == ALLOW_RETURN_HOLE) {
+ Label done;
+ __ Branch(&done, eq, scratch, Operand(zero_reg));
+ __ li(result, Operand(Smi::FromInt(0)));
+ __ bind(&done);
+ } else {
+ DeoptimizeIf(ne, instr->environment(), scratch, Operand(zero_reg));
+ }
+ } else {
+ __ SmiUntag(result, input);
+ }
} else {
__ SmiUntag(result, input);
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Thu May 16 07:27:39
2013
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Wed May 22 16:09:22
2013
@@ -1773,6 +1773,13 @@
if (instr->value()->type().IsSmi()) {
value = UseRegisterAtStart(instr->value());
res = DefineAsRegister(new(zone()) LSmiUntag(value, false));
+ if (instr->value()->IsLoadKeyed()) {
+ HLoadKeyed* load_keyed = HLoadKeyed::cast(instr->value());
+ if (load_keyed->UsesMustHandleHole() &&
+ load_keyed->hole_mode() == NEVER_RETURN_HOLE) {
+ res = AssignEnvironment(res);
+ }
+ }
} else {
value = UseRegister(instr->value());
LOperand* temp1 = TempRegister();
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Wed May 15 07:24:47 2013
+++ /branches/bleeding_edge/src/mips/lithium-mips.h Wed May 22 16:09:22 2013
@@ -2034,6 +2034,7 @@
LOperand* value() { return inputs_[0]; }
bool needs_check() const { return needs_check_; }
+ DECLARE_HYDROGEN_ACCESSOR(Change);
DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
private:
--
--
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.