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

Side by Side Diff: src/ia32/macro-assembler-ia32.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 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 length); 2769 length);
2770 if (FLAG_debug_code) { 2770 if (FLAG_debug_code) {
2771 mov(length, Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); 2771 mov(length, Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset));
2772 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); 2772 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset));
2773 Check(less_equal, "Live Bytes Count overflow chunk size"); 2773 Check(less_equal, "Live Bytes Count overflow chunk size");
2774 } 2774 }
2775 2775
2776 bind(&done); 2776 bind(&done);
2777 } 2777 }
2778 2778
2779
2780 void MacroAssembler::CheckEnumCache(Label* call_runtime) {
2781 Label next;
2782 mov(ecx, eax);
2783 bind(&next);
2784
2785 // Check that there are no elements. Register ecx contains the
2786 // current JS object we've reached through the prototype chain.
2787 cmp(FieldOperand(ecx, JSObject::kElementsOffset),
2788 isolate()->factory()->empty_fixed_array());
2789 j(not_equal, call_runtime);
2790
2791 // Check that instance descriptors are not empty so that we can
2792 // check for an enum cache. Leave the map in ebx for the subsequent
2793 // prototype load.
2794 mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset));
2795 mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOrBitField3Offset));
2796 JumpIfSmi(edx, call_runtime);
2797
2798 // Check that there is an enum cache in the non-empty instance
2799 // descriptors (edx). This is the case if the next enumeration
2800 // index field does not contain a smi.
2801 mov(edx, FieldOperand(edx, DescriptorArray::kEnumerationIndexOffset));
2802 JumpIfSmi(edx, call_runtime);
2803
2804 // For all objects but the receiver, check that the cache is empty.
2805 Label check_prototype;
2806 cmp(ecx, eax);
2807 j(equal, &check_prototype, Label::kNear);
2808 mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset));
2809 cmp(edx, isolate()->factory()->empty_fixed_array());
2810 j(not_equal, call_runtime);
2811
2812 // Load the prototype from the map and loop if non-null.
2813 bind(&check_prototype);
2814 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
2815 cmp(ecx, isolate()->factory()->null_value());
2816 j(not_equal, &next);
2817 }
2818
2779 } } // namespace v8::internal 2819 } } // namespace v8::internal
2780 2820
2781 #endif // V8_TARGET_ARCH_IA32 2821 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698