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
This commit is contained in:
verwaest@chromium.org 2012-07-13 09:14:43 +00:00
parent e875306037
commit d51b6826dc
3 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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));

View File

@ -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.