From d51b6826dc2a01c628f3672f31d51a3a2f75debe Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Fri, 13 Jul 2012 09:14:43 +0000 Subject: [PATCH] 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 . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12076 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/full-codegen-mips.cc | 2 +- src/mips/lithium-codegen-mips.cc | 2 +- src/mips/macro-assembler-mips.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 9ae025d7b2..246fe2a13f 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -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. diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 737aafcc9b..a090242f06 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -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)); diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 6233b830e0..a0fea77053 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -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.