Reviewers: danno, Benedikt Meurer, Paul Lind, kisg, palfia, dusmil,
Description:
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=
Please review this at https://codereview.chromium.org/297143007/
SVN Base: https://github.com/v8/v8.git@gbl
Affected files (+13, -25 lines):
M src/mips/lithium-codegen-mips.cc
M src/mips/lithium-mips.cc
M src/mips/macro-assembler-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
f1deb387059d6071fc698ce172b3199cf3d2be94..69e36f8c862e80ab9efc3f61405fb01ad6727d86
100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -4056,23 +4056,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField*
instr) {
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 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField*
instr) {
GetRAState(),
kSaveFPRegs,
EMIT_REMEMBERED_SET,
- check_needed);
+ instr->hydrogen()->SmiCheckForWriteBarrier());
}
} else {
__ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset));
@@ -4130,7 +4119,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField*
instr) {
GetRAState(),
kSaveFPRegs,
EMIT_REMEMBERED_SET,
- check_needed);
+ instr->hydrogen()->SmiCheckForWriteBarrier());
}
}
}
Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index
562c88d34d23b6c12840494c159461319a2e0949..30fe8c4c8bdac13cefb46aa97225d6d8891a9687
100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -2267,13 +2267,7 @@ LInstruction*
LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
// 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);
}
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc
b/src/mips/macro-assembler-mips.cc
index
02d798cae379811ec82a74d28feedc53080390cb..d2fa8dec69e93c01d54e1308e4baa1b1e0740ee7
100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -56,6 +56,11 @@ void MacroAssembler::Store(Register src,
} 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
[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/d/optout.