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

Side by Side Diff: src/arm/full-codegen-arm.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 | « no previous file | src/hydrogen.cc » ('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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 __ push(r0); // Map. 997 __ push(r0); // Map.
998 __ ldr(r1, FieldMemOperand(r2, FixedArray::kLengthOffset)); 998 __ ldr(r1, FieldMemOperand(r2, FixedArray::kLengthOffset));
999 __ mov(r0, Operand(Smi::FromInt(0))); 999 __ mov(r0, Operand(Smi::FromInt(0)));
1000 // Push enumeration cache, enumeration cache length (as smi) and zero. 1000 // Push enumeration cache, enumeration cache length (as smi) and zero.
1001 __ Push(r2, r1, r0); 1001 __ Push(r2, r1, r0);
1002 __ jmp(&loop); 1002 __ jmp(&loop);
1003 1003
1004 // We got a fixed array in register r0. Iterate through that. 1004 // We got a fixed array in register r0. Iterate through that.
1005 Label non_proxy; 1005 Label non_proxy;
1006 __ bind(&fixed_array); 1006 __ bind(&fixed_array);
1007
1008 Handle<JSGlobalPropertyCell> cell =
1009 isolate()->factory()->NewJSGlobalPropertyCell(
1010 Handle<Object>(
1011 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker)));
1012 RecordTypeFeedbackCell(stmt->PrepareId(), cell);
1013 __ LoadHeapObject(r1, cell);
1014 __ mov(r2, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
1015 __ str(r2, FieldMemOperand(r1, JSGlobalPropertyCell::kValueOffset));
1016
1007 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check 1017 __ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check
1008 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object 1018 __ ldr(r2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1009 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1019 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1010 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); 1020 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE);
1011 __ b(gt, &non_proxy); 1021 __ b(gt, &non_proxy);
1012 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy 1022 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy
1013 __ bind(&non_proxy); 1023 __ bind(&non_proxy);
1014 __ Push(r1, r0); // Smi and array 1024 __ Push(r1, r0); // Smi and array
1015 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); 1025 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset));
1016 __ mov(r0, Operand(Smi::FromInt(0))); 1026 __ mov(r0, Operand(Smi::FromInt(0)));
(...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after
4391 *context_length = 0; 4401 *context_length = 0;
4392 return previous_; 4402 return previous_;
4393 } 4403 }
4394 4404
4395 4405
4396 #undef __ 4406 #undef __
4397 4407
4398 } } // namespace v8::internal 4408 } } // namespace v8::internal
4399 4409
4400 #endif // V8_TARGET_ARCH_ARM 4410 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698