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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 1086333002: Reland "Add basic crankshaft support for slow-mode for-in to avoid disabling optimizations" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Just give up if null or undefined. Created 5 years, 8 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 | « src/mips64/lithium-codegen-mips64.cc ('k') | test/mjsunit/for-in-opt.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 5754 matching lines...) Expand 10 before | Expand all | Expand 10 after
5765 // backpatching it with the spill slot operands. 5765 // backpatching it with the spill slot operands.
5766 DCHECK(!environment->HasBeenRegistered()); 5766 DCHECK(!environment->HasBeenRegistered());
5767 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 5767 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
5768 5768
5769 GenerateOsrPrologue(); 5769 GenerateOsrPrologue();
5770 } 5770 }
5771 5771
5772 5772
5773 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { 5773 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
5774 DCHECK(ToRegister(instr->context()).is(rsi)); 5774 DCHECK(ToRegister(instr->context()).is(rsi));
5775 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex);
5776 DeoptimizeIf(equal, instr, Deoptimizer::kUndefined);
5777 5775
5778 Register null_value = rdi;
5779 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
5780 __ cmpp(rax, null_value);
5781 DeoptimizeIf(equal, instr, Deoptimizer::kNull); 5776 DeoptimizeIf(equal, instr, Deoptimizer::kNull);
5782 5777
5783 Condition cc = masm()->CheckSmi(rax); 5778 Condition cc = masm()->CheckSmi(rax);
5784 DeoptimizeIf(cc, instr, Deoptimizer::kSmi); 5779 DeoptimizeIf(cc, instr, Deoptimizer::kSmi);
5785 5780
5786 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 5781 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
5787 __ CmpObjectType(rax, LAST_JS_PROXY_TYPE, rcx); 5782 __ CmpObjectType(rax, LAST_JS_PROXY_TYPE, rcx);
5788 DeoptimizeIf(below_equal, instr, Deoptimizer::kWrongInstanceType); 5783 DeoptimizeIf(below_equal, instr, Deoptimizer::kWrongInstanceType);
5789 5784
5790 Label use_cache, call_runtime; 5785 Label use_cache, call_runtime;
5786 Register null_value = rdi;
5787 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
5791 __ CheckEnumCache(null_value, &call_runtime); 5788 __ CheckEnumCache(null_value, &call_runtime);
5792 5789
5793 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); 5790 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset));
5794 __ jmp(&use_cache, Label::kNear); 5791 __ jmp(&use_cache, Label::kNear);
5795 5792
5796 // Get the set of properties to enumerate. 5793 // Get the set of properties to enumerate.
5797 __ bind(&call_runtime); 5794 __ bind(&call_runtime);
5798 __ Push(rax); 5795 __ Push(rax);
5799 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); 5796 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr);
5800 5797
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5919 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5916 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5920 RecordSafepoint(Safepoint::kNoLazyDeopt); 5917 RecordSafepoint(Safepoint::kNoLazyDeopt);
5921 } 5918 }
5922 5919
5923 5920
5924 #undef __ 5921 #undef __
5925 5922
5926 } } // namespace v8::internal 5923 } } // namespace v8::internal
5927 5924
5928 #endif // V8_TARGET_ARCH_X64 5925 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | test/mjsunit/for-in-opt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698