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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 1619643004: PPC: [for-in] Sanitize for-in optimizations and fix bailout points. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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 | src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 5702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5713 // If the environment were already registered, we would have no way of 5713 // If the environment were already registered, we would have no way of
5714 // backpatching it with the spill slot operands. 5714 // backpatching it with the spill slot operands.
5715 DCHECK(!environment->HasBeenRegistered()); 5715 DCHECK(!environment->HasBeenRegistered());
5716 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 5716 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
5717 5717
5718 GenerateOsrPrologue(); 5718 GenerateOsrPrologue();
5719 } 5719 }
5720 5720
5721 5721
5722 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { 5722 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
5723 __ TestIfSmi(r3, r0);
5724 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0);
5725
5726 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
5727 __ CompareObjectType(r3, r4, r4, JS_PROXY_TYPE);
5728 DeoptimizeIf(le, instr, Deoptimizer::kWrongInstanceType);
5729
5730 Label use_cache, call_runtime; 5723 Label use_cache, call_runtime;
5731 Register null_value = r8; 5724 __ CheckEnumCache(&call_runtime);
5732 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
5733 __ CheckEnumCache(null_value, &call_runtime);
5734 5725
5735 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); 5726 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset));
5736 __ b(&use_cache); 5727 __ b(&use_cache);
5737 5728
5738 // Get the set of properties to enumerate. 5729 // Get the set of properties to enumerate.
5739 __ bind(&call_runtime); 5730 __ bind(&call_runtime);
5740 __ push(r3); 5731 __ push(r3);
5741 CallRuntime(Runtime::kGetPropertyNamesFast, instr); 5732 CallRuntime(Runtime::kGetPropertyNamesFast, instr);
5742
5743 __ LoadP(r4, FieldMemOperand(r3, HeapObject::kMapOffset));
5744 __ LoadRoot(ip, Heap::kMetaMapRootIndex);
5745 __ cmp(r4, ip);
5746 DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap);
5747 __ bind(&use_cache); 5733 __ bind(&use_cache);
5748 } 5734 }
5749 5735
5750 5736
5751 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5737 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5752 Register map = ToRegister(instr->map()); 5738 Register map = ToRegister(instr->map());
5753 Register result = ToRegister(instr->result()); 5739 Register result = ToRegister(instr->result());
5754 Label load_cache, done; 5740 Label load_cache, done;
5755 __ EnumLength(result, map); 5741 __ EnumLength(result, map);
5756 __ CmpSmiLiteral(result, Smi::FromInt(0), r0); 5742 __ CmpSmiLiteral(result, Smi::FromInt(0), r0);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
5860 __ Push(scope_info); 5846 __ Push(scope_info);
5861 __ push(ToRegister(instr->function())); 5847 __ push(ToRegister(instr->function()));
5862 CallRuntime(Runtime::kPushBlockContext, instr); 5848 CallRuntime(Runtime::kPushBlockContext, instr);
5863 RecordSafepoint(Safepoint::kNoLazyDeopt); 5849 RecordSafepoint(Safepoint::kNoLazyDeopt);
5864 } 5850 }
5865 5851
5866 5852
5867 #undef __ 5853 #undef __
5868 } // namespace internal 5854 } // namespace internal
5869 } // namespace v8 5855 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698