Commit 4cbbf0ae authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Reland "Track field types.".

Port r20746 (09f9176)

Original commit message:
This is an initial step towards tracking the exact types instead of just
the representations of fields. It adds support to track up to one map of
heap object field values, eliminating various map checks on values
loaded from such fields, at the cost of making stores to such fields
slightly more expensive.

Issues with transitioning stores and fast object literals in Crankshaft
fixed.

TEST=mjsunit/field-type-tracking
BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/238943002

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8b9fd696
......@@ -4085,7 +4085,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
__ SmiTst(value, scratch);
DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg));
// We know that value is a smi now, so we can omit the check below.
// 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()) {
......
......@@ -415,7 +415,14 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
} else if (representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label);
} else if (representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label);
HeapType* field_type = descriptors->GetFieldType(descriptor);
if (field_type->IsClass()) {
__ CheckMap(value_reg, scratch1, field_type->AsClass(),
miss_label, DO_SMI_CHECK);
} else {
ASSERT(HeapType::Any()->Is(field_type));
__ JumpIfSmi(value_reg, miss_label);
}
} else if (representation.IsDouble()) {
Label do_store, heap_number;
__ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
......@@ -578,7 +585,14 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
if (representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label);
} else if (representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label);
HeapType* field_type = lookup->GetFieldType();
if (field_type->IsClass()) {
__ CheckMap(value_reg, scratch1, field_type->AsClass(),
miss_label, DO_SMI_CHECK);
} else {
ASSERT(HeapType::Any()->Is(field_type));
__ JumpIfSmi(value_reg, miss_label);
}
} else if (representation.IsDouble()) {
// Load the double storage.
if (index < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment