Reviewers: Paul Lind, Toon Verwaest, danno, kisg, kilvadyb,
Description:
MIPS: Handle holes in smi-untag from LoadKeyed requiring hole handling.
Port r14756 (fda1989f)
BUG=
Please review this at https://codereview.chromium.org/15690003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/mips/lithium-codegen-mips.cc
M src/mips/lithium-mips.h
M src/mips/lithium-mips.cc
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc
b/src/mips/lithium-codegen-mips.cc
index
ae0d6283f44c1a483964506e5644fbabccbf5ea8..49743fd5218bf86c78e825d67c2ccf1bf9064c38
100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -4610,6 +4610,22 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
__ 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);
}
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index
5ca8cd9b96c69fef24d28a699391eb7c267061d5..04125d1696d11eb40138281f9d81d3336701c572
100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -1773,6 +1773,13 @@ LInstruction* LChunkBuilder::DoChange(HChange*
instr) {
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();
Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index
1abea90141b67dc2ab1e22ba01832d0f1117496a..197254f703002d66de007854fa7cc3582306de2f
100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -2034,6 +2034,7 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0>
{
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.