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

Side by Side Diff: src/mips/full-codegen-mips.cc

Issue 9586004: MIPS: Introduce basic type feedback for for-in statements to avoid deopts. (Closed)
Patch Set: rebased on r10962. 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
« no previous file with comments | « no previous file | no next file » | 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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 __ push(v0); // Map. 1008 __ push(v0); // Map.
1009 __ lw(a1, FieldMemOperand(a2, FixedArray::kLengthOffset)); 1009 __ lw(a1, FieldMemOperand(a2, FixedArray::kLengthOffset));
1010 __ li(a0, Operand(Smi::FromInt(0))); 1010 __ li(a0, Operand(Smi::FromInt(0)));
1011 // Push enumeration cache, enumeration cache length (as smi) and zero. 1011 // Push enumeration cache, enumeration cache length (as smi) and zero.
1012 __ Push(a2, a1, a0); 1012 __ Push(a2, a1, a0);
1013 __ jmp(&loop); 1013 __ jmp(&loop);
1014 1014
1015 // We got a fixed array in register v0. Iterate through that. 1015 // We got a fixed array in register v0. Iterate through that.
1016 Label non_proxy; 1016 Label non_proxy;
1017 __ bind(&fixed_array); 1017 __ bind(&fixed_array);
1018
1019 Handle<JSGlobalPropertyCell> cell =
1020 isolate()->factory()->NewJSGlobalPropertyCell(
1021 Handle<Object>(
1022 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker)));
1023 RecordTypeFeedbackCell(stmt->PrepareId(), cell);
1024 __ LoadHeapObject(a1, cell);
1025 __ li(a2, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
1026 __ sw(a2, FieldMemOperand(a1, JSGlobalPropertyCell::kValueOffset));
1027
1018 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check 1028 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
1019 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object 1029 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object
1020 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1030 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1021 __ GetObjectType(a2, a3, a3); 1031 __ GetObjectType(a2, a3, a3);
1022 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); 1032 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE));
1023 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy 1033 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy
1024 __ bind(&non_proxy); 1034 __ bind(&non_proxy);
1025 __ Push(a1, v0); // Smi and array 1035 __ Push(a1, v0); // Smi and array
1026 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); 1036 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset));
1027 __ li(a0, Operand(Smi::FromInt(0))); 1037 __ li(a0, Operand(Smi::FromInt(0)));
(...skipping 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after
4434 *context_length = 0; 4444 *context_length = 0;
4435 return previous_; 4445 return previous_;
4436 } 4446 }
4437 4447
4438 4448
4439 #undef __ 4449 #undef __
4440 4450
4441 } } // namespace v8::internal 4451 } } // namespace v8::internal
4442 4452
4443 #endif // V8_TARGET_ARCH_MIPS 4453 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698