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/full-codegen-ia32.cc

Issue 9571001: Introduce basic type feedback for for-in statements to avoid deopts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 __ push(eax); // Map. 1026 __ push(eax); // Map.
1027 __ push(edx); // Enumeration cache. 1027 __ push(edx); // Enumeration cache.
1028 __ mov(eax, FieldOperand(edx, FixedArray::kLengthOffset)); 1028 __ mov(eax, FieldOperand(edx, FixedArray::kLengthOffset));
1029 __ push(eax); // Enumeration cache length (as smi). 1029 __ push(eax); // Enumeration cache length (as smi).
1030 __ push(Immediate(Smi::FromInt(0))); // Initial index. 1030 __ push(Immediate(Smi::FromInt(0))); // Initial index.
1031 __ jmp(&loop); 1031 __ jmp(&loop);
1032 1032
1033 // We got a fixed array in register eax. Iterate through that. 1033 // We got a fixed array in register eax. Iterate through that.
1034 Label non_proxy; 1034 Label non_proxy;
1035 __ bind(&fixed_array); 1035 __ bind(&fixed_array);
1036
1037 Handle<JSGlobalPropertyCell> cell =
1038 isolate()->factory()->NewJSGlobalPropertyCell(
1039 Handle<Object>(
1040 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker)));
1041 RecordTypeFeedbackCell(stmt->PrepareId(), cell);
1042 __ LoadHeapObject(ebx, cell);
1043 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
1044 Immediate(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
1045
1036 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check 1046 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check
1037 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object 1047 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object
1038 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1048 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1039 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx); 1049 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx);
1040 __ j(above, &non_proxy); 1050 __ j(above, &non_proxy);
1041 __ mov(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy 1051 __ mov(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy
1042 __ bind(&non_proxy); 1052 __ bind(&non_proxy);
1043 __ push(ebx); // Smi 1053 __ push(ebx); // Smi
1044 __ push(eax); // Array 1054 __ push(eax); // Array
1045 __ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset)); 1055 __ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset));
(...skipping 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after
4453 *context_length = 0; 4463 *context_length = 0;
4454 return previous_; 4464 return previous_;
4455 } 4465 }
4456 4466
4457 4467
4458 #undef __ 4468 #undef __
4459 4469
4460 } } // namespace v8::internal 4470 } } // namespace v8::internal
4461 4471
4462 #endif // V8_TARGET_ARCH_IA32 4472 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698