Revision: 21525
Author: plin...@gmail.com
Date: Tue May 27 13:37:33 2014 UTC
Log: MIPS: Avoid HeapObject check in HStoreNamedField.
Port r21509 (78a54b0)
Original commit message:
This way an HStoreNamedField instruction can never deoptimize
itself, which is another important step towards a working
store elimination.
BUG=
R=plin...@gmail.com
Review URL: https://codereview.chromium.org/297143007
Patch from Balazs Kilvady <kilva...@homejinni.com>.
http://code.google.com/p/v8/source/detail?r=21525
Modified:
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.cc
/branches/bleeding_edge/src/mips/macro-assembler-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon May 26
14:40:55 2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Tue May 27
13:37:33 2014 UTC
@@ -4056,23 +4056,12 @@
return;
}
- SmiCheck check_needed =
- instr->hydrogen()->value()->IsHeapObject()
- ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
+ __ AssertNotSmi(object);
- ASSERT(!(representation.IsSmi() &&
- instr->value()->IsConstantOperand() &&
- !IsSmi(LConstantOperand::cast(instr->value()))));
- if (representation.IsHeapObject()) {
- Register value = ToRegister(instr->value());
- if (!instr->hydrogen()->value()->type().IsHeapObject()) {
- __ SmiTst(value, scratch);
- DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg));
-
- // We know now that value is not a smi, so we can omit the check
below.
- check_needed = OMIT_SMI_CHECK;
- }
- } else if (representation.IsDouble()) {
+ ASSERT(!representation.IsSmi() ||
+ !instr->value()->IsConstantOperand() ||
+ IsSmi(LConstantOperand::cast(instr->value())));
+ if (representation.IsDouble()) {
ASSERT(access.IsInobject());
ASSERT(!instr->hydrogen()->has_transition());
ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
@@ -4114,7 +4103,7 @@
GetRAState(),
kSaveFPRegs,
EMIT_REMEMBERED_SET,
- check_needed);
+ instr->hydrogen()->SmiCheckForWriteBarrier());
}
} else {
__ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
@@ -4130,7 +4119,7 @@
GetRAState(),
kSaveFPRegs,
EMIT_REMEMBERED_SET,
- check_needed);
+ instr->hydrogen()->SmiCheckForWriteBarrier());
}
}
}
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Fri May 23 14:06:42
2014 UTC
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Tue May 27 13:37:33
2014 UTC
@@ -2267,13 +2267,7 @@
// We need a temporary register for write barrier of the map field.
LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL;
- LInstruction* result = new(zone()) LStoreNamedField(obj, val, temp);
- if (!instr->access().IsExternalMemory() &&
- instr->field_representation().IsHeapObject() &&
- !instr->value()->type().IsHeapObject()) {
- result = AssignEnvironment(result);
- }
- return result;
+ return new(zone()) LStoreNamedField(obj, val, temp);
}
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue May 27
09:38:01 2014 UTC
+++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue May 27
13:37:33 2014 UTC
@@ -56,6 +56,11 @@
} else if (r.IsInteger16() || r.IsUInteger16()) {
sh(src, dst);
} else {
+ if (r.IsHeapObject()) {
+ AssertNotSmi(src);
+ } else if (r.IsSmi()) {
+ AssertSmi(src);
+ }
sw(src, dst);
}
}
--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.