Commit fd0df23b authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: Track up to 5 stable maps as field type.

Port r20831 (f91f993)

BUG=
R=plind44@gmail.com

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20847 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 313844d8
...@@ -415,13 +415,24 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, ...@@ -415,13 +415,24 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
} else if (representation.IsSmi()) { } else if (representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label); __ JumpIfNotSmi(value_reg, miss_label);
} else if (representation.IsHeapObject()) { } else if (representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label);
HeapType* field_type = descriptors->GetFieldType(descriptor); HeapType* field_type = descriptors->GetFieldType(descriptor);
if (field_type->IsClass()) { HeapType::Iterator<Map> it = field_type->Classes();
__ CheckMap(value_reg, scratch1, field_type->AsClass()->Map(), Handle<Map> current;
miss_label, DO_SMI_CHECK); if (!it.Done()) {
} else { __ lw(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset));
ASSERT(HeapType::Any()->Is(field_type)); Label do_store;
__ JumpIfSmi(value_reg, miss_label); while (true) {
// Do the CompareMap() directly within the Branch() functions.
current = it.Current();
it.Advance();
if (it.Done()) {
__ Branch(miss_label, ne, scratch1, Operand(current));
break;
}
__ Branch(&do_store, eq, scratch1, Operand(current));
}
__ bind(&do_store);
} }
} else if (representation.IsDouble()) { } else if (representation.IsDouble()) {
Label do_store, heap_number; Label do_store, heap_number;
...@@ -585,13 +596,24 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm, ...@@ -585,13 +596,24 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
if (representation.IsSmi()) { if (representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label); __ JumpIfNotSmi(value_reg, miss_label);
} else if (representation.IsHeapObject()) { } else if (representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label);
HeapType* field_type = lookup->GetFieldType(); HeapType* field_type = lookup->GetFieldType();
if (field_type->IsClass()) { HeapType::Iterator<Map> it = field_type->Classes();
__ CheckMap(value_reg, scratch1, field_type->AsClass()->Map(), if (!it.Done()) {
miss_label, DO_SMI_CHECK); __ lw(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset));
} else { Label do_store;
ASSERT(HeapType::Any()->Is(field_type)); Handle<Map> current;
__ JumpIfSmi(value_reg, miss_label); while (true) {
// Do the CompareMap() directly within the Branch() functions.
current = it.Current();
it.Advance();
if (it.Done()) {
__ Branch(miss_label, ne, scratch1, Operand(current));
break;
}
__ Branch(&do_store, eq, scratch1, Operand(current));
}
__ bind(&do_store);
} }
} else if (representation.IsDouble()) { } else if (representation.IsDouble()) {
// Load the double storage. // Load the double storage.
......
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