Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 9425045: Support fast case for-in in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: port to x64&arm, cleanup Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3646 matching lines...) Expand 10 before | Expand all | Expand 10 after
3657 Register descriptors) { 3657 Register descriptors) {
3658 ldr(descriptors, 3658 ldr(descriptors,
3659 FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset)); 3659 FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset));
3660 Label not_smi; 3660 Label not_smi;
3661 JumpIfNotSmi(descriptors, &not_smi); 3661 JumpIfNotSmi(descriptors, &not_smi);
3662 mov(descriptors, Operand(FACTORY->empty_descriptor_array())); 3662 mov(descriptors, Operand(FACTORY->empty_descriptor_array()));
3663 bind(&not_smi); 3663 bind(&not_smi);
3664 } 3664 }
3665 3665
3666 3666
3667 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
3668 Label next;
3669 // Preload a couple of values used in the loop.
3670 Register empty_fixed_array_value = r6;
3671 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex);
3672 Register empty_descriptor_array_value = r7;
3673 LoadRoot(empty_descriptor_array_value,
3674 Heap::kEmptyDescriptorArrayRootIndex);
3675 mov(r1, r0);
3676 bind(&next);
3677
3678 // Check that there are no elements. Register r1 contains the
3679 // current JS object we've reached through the prototype chain.
3680 ldr(r2, FieldMemOperand(r1, JSObject::kElementsOffset));
3681 cmp(r2, empty_fixed_array_value);
3682 b(ne, call_runtime);
3683
3684 // Check that instance descriptors are not empty so that we can
3685 // check for an enum cache. Leave the map in r2 for the subsequent
3686 // prototype load.
3687 ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
3688 ldr(r3, FieldMemOperand(r2, Map::kInstanceDescriptorsOrBitField3Offset));
3689 JumpIfSmi(r3, call_runtime);
3690
3691 // Check that there is an enum cache in the non-empty instance
3692 // descriptors (r3). This is the case if the next enumeration
3693 // index field does not contain a smi.
3694 ldr(r3, FieldMemOperand(r3, DescriptorArray::kEnumerationIndexOffset));
3695 JumpIfSmi(r3, call_runtime);
3696
3697 // For all objects but the receiver, check that the cache is empty.
3698 Label check_prototype;
3699 cmp(r1, r0);
3700 b(eq, &check_prototype);
3701 ldr(r3, FieldMemOperand(r3, DescriptorArray::kEnumCacheBridgeCacheOffset));
3702 cmp(r3, empty_fixed_array_value);
3703 b(ne, call_runtime);
3704
3705 // Load the prototype from the map and loop if non-null.
3706 bind(&check_prototype);
3707 ldr(r1, FieldMemOperand(r2, Map::kPrototypeOffset));
3708 cmp(r1, null_value);
3709 b(ne, &next);
3710 }
3711
3712
3667 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { 3713 bool AreAliased(Register r1, Register r2, Register r3, Register r4) {
3668 if (r1.is(r2)) return true; 3714 if (r1.is(r2)) return true;
3669 if (r1.is(r3)) return true; 3715 if (r1.is(r3)) return true;
3670 if (r1.is(r4)) return true; 3716 if (r1.is(r4)) return true;
3671 if (r2.is(r3)) return true; 3717 if (r2.is(r3)) return true;
3672 if (r2.is(r4)) return true; 3718 if (r2.is(r4)) return true;
3673 if (r3.is(r4)) return true; 3719 if (r3.is(r4)) return true;
3674 return false; 3720 return false;
3675 } 3721 }
3676 3722
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
3710 void CodePatcher::EmitCondition(Condition cond) { 3756 void CodePatcher::EmitCondition(Condition cond) {
3711 Instr instr = Assembler::instr_at(masm_.pc_); 3757 Instr instr = Assembler::instr_at(masm_.pc_);
3712 instr = (instr & ~kCondMask) | cond; 3758 instr = (instr & ~kCondMask) | cond;
3713 masm_.emit(instr); 3759 masm_.emit(instr);
3714 } 3760 }
3715 3761
3716 3762
3717 } } // namespace v8::internal 3763 } } // namespace v8::internal
3718 3764
3719 #endif // V8_TARGET_ARCH_ARM 3765 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698