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

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

Issue 1618613002: [for-in] Sanitize for-in optimizations and fix bailout points. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « src/ast/ast.h ('k') | src/crankshaft/arm64/lithium-codegen-arm64.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 // 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/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 5433 matching lines...) Expand 10 before | Expand all | Expand 10 after
5444 // If the environment were already registered, we would have no way of 5444 // If the environment were already registered, we would have no way of
5445 // backpatching it with the spill slot operands. 5445 // backpatching it with the spill slot operands.
5446 DCHECK(!environment->HasBeenRegistered()); 5446 DCHECK(!environment->HasBeenRegistered());
5447 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 5447 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
5448 5448
5449 GenerateOsrPrologue(); 5449 GenerateOsrPrologue();
5450 } 5450 }
5451 5451
5452 5452
5453 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { 5453 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
5454 __ SmiTst(r0);
5455 DeoptimizeIf(eq, instr, Deoptimizer::kSmi);
5456
5457 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
5458 __ CompareObjectType(r0, r1, r1, JS_PROXY_TYPE);
5459 DeoptimizeIf(le, instr, Deoptimizer::kWrongInstanceType);
5460
5461 Label use_cache, call_runtime; 5454 Label use_cache, call_runtime;
5462 Register null_value = r5; 5455 __ CheckEnumCache(&call_runtime);
5463 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
5464 __ CheckEnumCache(null_value, &call_runtime);
5465 5456
5466 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); 5457 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
5467 __ b(&use_cache); 5458 __ b(&use_cache);
5468 5459
5469 // Get the set of properties to enumerate. 5460 // Get the set of properties to enumerate.
5470 __ bind(&call_runtime); 5461 __ bind(&call_runtime);
5471 __ push(r0); 5462 __ push(r0);
5472 CallRuntime(Runtime::kGetPropertyNamesFast, instr); 5463 CallRuntime(Runtime::kGetPropertyNamesFast, instr);
5473
5474 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
5475 __ LoadRoot(ip, Heap::kMetaMapRootIndex);
5476 __ cmp(r1, ip);
5477 DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap);
5478 __ bind(&use_cache); 5464 __ bind(&use_cache);
5479 } 5465 }
5480 5466
5481 5467
5482 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5468 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5483 Register map = ToRegister(instr->map()); 5469 Register map = ToRegister(instr->map());
5484 Register result = ToRegister(instr->result()); 5470 Register result = ToRegister(instr->result());
5485 Label load_cache, done; 5471 Label load_cache, done;
5486 __ EnumLength(result, map); 5472 __ EnumLength(result, map);
5487 __ cmp(result, Operand(Smi::FromInt(0))); 5473 __ cmp(result, Operand(Smi::FromInt(0)));
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
5599 __ push(ToRegister(instr->function())); 5585 __ push(ToRegister(instr->function()));
5600 CallRuntime(Runtime::kPushBlockContext, instr); 5586 CallRuntime(Runtime::kPushBlockContext, instr);
5601 RecordSafepoint(Safepoint::kNoLazyDeopt); 5587 RecordSafepoint(Safepoint::kNoLazyDeopt);
5602 } 5588 }
5603 5589
5604 5590
5605 #undef __ 5591 #undef __
5606 5592
5607 } // namespace internal 5593 } // namespace internal
5608 } // namespace v8 5594 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698