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

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: 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 // Check cache validity in generated code. This is a fast case for
2782 // the JSObject::IsSimpleEnum cache validity checks. If we cannot
2783 // guarantee cache validity, call the runtime system to check cache
2784 // validity or get the property names in a fixed array.
2785 Label next;
2786 mov(ecx, eax);
2787 bind(&next);
2788
2789 // Check that there are no elements. Register ecx contains the
2790 // current JS object we've reached through the prototype chain.
2791 cmp(FieldOperand(ecx, JSObject::kElementsOffset),
2792 isolate()->factory()->empty_fixed_array());
2793 j(not_equal, call_runtime);
2794
2795 // Check that instance descriptors are not empty so that we can
2796 // check for an enum cache. Leave the map in ebx for the subsequent
2797 // prototype load.
2798 mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset));
2799 mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOrBitField3Offset));
2800 JumpIfSmi(edx, call_runtime);
2801
2802 // Check that there is an enum cache in the non-empty instance
2803 // descriptors (edx). This is the case if the next enumeration
2804 // index field does not contain a smi.
2805 mov(edx, FieldOperand(edx, DescriptorArray::kEnumerationIndexOffset));
2806 JumpIfSmi(edx, call_runtime);
2807
2808 // For all objects but the receiver, check that the cache is empty.
2809 Label check_prototype;
2810 cmp(ecx, eax);
2811 j(equal, &check_prototype, Label::kNear);
2812 mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset));
2813 cmp(edx, isolate()->factory()->empty_fixed_array());
2814 j(not_equal, call_runtime);
2815
2816 // Load the prototype from the map and loop if non-null.
2817 bind(&check_prototype);
2818 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
2819 cmp(ecx, isolate()->factory()->null_value());
2820 j(not_equal, &next);
2821 }
2822
2779 } } // namespace v8::internal 2823 } } // namespace v8::internal
2780 2824
2781 #endif // V8_TARGET_ARCH_IA32 2825 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/ia32/lithium-ia32.cc ('K') | « src/ia32/macro-assembler-ia32.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698