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

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.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/crankshaft/hydrogen.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h"
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 5311 matching lines...) Expand 10 before | Expand all | Expand 10 after
5322 // backpatching it with the spill slot operands. 5322 // backpatching it with the spill slot operands.
5323 DCHECK(!environment->HasBeenRegistered()); 5323 DCHECK(!environment->HasBeenRegistered());
5324 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 5324 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
5325 5325
5326 GenerateOsrPrologue(); 5326 GenerateOsrPrologue();
5327 } 5327 }
5328 5328
5329 5329
5330 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { 5330 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
5331 DCHECK(ToRegister(instr->context()).is(esi)); 5331 DCHECK(ToRegister(instr->context()).is(esi));
5332 __ test(eax, Immediate(kSmiTagMask));
5333 DeoptimizeIf(zero, instr, Deoptimizer::kSmi);
5334
5335 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
5336 __ CmpObjectType(eax, JS_PROXY_TYPE, ecx);
5337 DeoptimizeIf(below_equal, instr, Deoptimizer::kWrongInstanceType);
5338 5332
5339 Label use_cache, call_runtime; 5333 Label use_cache, call_runtime;
5340 __ CheckEnumCache(&call_runtime); 5334 __ CheckEnumCache(&call_runtime);
5341 5335
5342 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); 5336 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset));
5343 __ jmp(&use_cache, Label::kNear); 5337 __ jmp(&use_cache, Label::kNear);
5344 5338
5345 // Get the set of properties to enumerate. 5339 // Get the set of properties to enumerate.
5346 __ bind(&call_runtime); 5340 __ bind(&call_runtime);
5347 __ push(eax); 5341 __ push(eax);
5348 CallRuntime(Runtime::kGetPropertyNamesFast, instr); 5342 CallRuntime(Runtime::kGetPropertyNamesFast, instr);
5349
5350 __ cmp(FieldOperand(eax, HeapObject::kMapOffset),
5351 isolate()->factory()->meta_map());
5352 DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap);
5353 __ bind(&use_cache); 5343 __ bind(&use_cache);
5354 } 5344 }
5355 5345
5356 5346
5357 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5347 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5358 Register map = ToRegister(instr->map()); 5348 Register map = ToRegister(instr->map());
5359 Register result = ToRegister(instr->result()); 5349 Register result = ToRegister(instr->result());
5360 Label load_cache, done; 5350 Label load_cache, done;
5361 __ EnumLength(result, map); 5351 __ EnumLength(result, map);
5362 __ cmp(result, Immediate(Smi::FromInt(0))); 5352 __ cmp(result, Immediate(Smi::FromInt(0)));
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
5469 RecordSafepoint(Safepoint::kNoLazyDeopt); 5459 RecordSafepoint(Safepoint::kNoLazyDeopt);
5470 } 5460 }
5471 5461
5472 5462
5473 #undef __ 5463 #undef __
5474 5464
5475 } // namespace internal 5465 } // namespace internal
5476 } // namespace v8 5466 } // namespace v8
5477 5467
5478 #endif // V8_TARGET_ARCH_IA32 5468 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698