Commit d51b6826 authored by verwaest@chromium.org's avatar verwaest@chromium.org

MIPS: Ensure that all descriptors have a valid enumeration index, and replace...

MIPS: Ensure that all descriptors have a valid enumeration index, and replace NextEnumIndex with LastAdded.

Port r12042 (ce65764e)

Original commit message:
The LastAdded points to the descriptor that was last added to the array. From the descriptor we can deduce the NextEnumerationIndex. This allows us to quickly find the property that we are transitioning to, which is necessary for transition-intensive code, eg JSON parsing.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10690178
Patch from Akos Palfi <palfia@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12076 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e8753060
......@@ -1149,7 +1149,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// We got a map in register v0. Get the enumeration cache from it.
__ bind(&use_cache);
__ LoadInstanceDescriptors(v0, a1, a2);
__ lw(a1, FieldMemOperand(a1, DescriptorArray::kEnumerationIndexOffset));
__ lw(a1, FieldMemOperand(a1, DescriptorArray::kLastAddedOffset));
__ lw(a2, FieldMemOperand(a1, DescriptorArray::kEnumCacheBridgeCacheOffset));
// Set up the four remaining stack slots.
......
......@@ -5168,7 +5168,7 @@ void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
Register scratch = ToRegister(instr->scratch());
__ LoadInstanceDescriptors(map, result, scratch);
__ lw(result,
FieldMemOperand(result, DescriptorArray::kEnumerationIndexOffset));
FieldMemOperand(result, DescriptorArray::kLastAddedOffset));
__ lw(result,
FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
DeoptimizeIf(eq, instr->environment(), result, Operand(zero_reg));
......
......@@ -5339,7 +5339,7 @@ void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
// Check that there is an enum cache in the non-empty instance
// descriptors (a3). This is the case if the next enumeration
// index field does not contain a smi.
lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumerationIndexOffset));
lw(a3, FieldMemOperand(a3, DescriptorArray::kLastAddedOffset));
JumpIfSmi(a3, call_runtime);
// For all objects but the receiver, check that the cache is empty.
......
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