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

Side by Side Diff: src/crankshaft/mips/lithium-codegen-mips.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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 5452 matching lines...) Expand 10 before | Expand all | Expand 10 after
5463 DCHECK(!environment->HasBeenRegistered()); 5463 DCHECK(!environment->HasBeenRegistered());
5464 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 5464 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
5465 5465
5466 GenerateOsrPrologue(); 5466 GenerateOsrPrologue();
5467 } 5467 }
5468 5468
5469 5469
5470 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { 5470 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) {
5471 Register result = ToRegister(instr->result()); 5471 Register result = ToRegister(instr->result());
5472 Register object = ToRegister(instr->object()); 5472 Register object = ToRegister(instr->object());
5473 __ And(at, object, kSmiTagMask);
5474 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg));
5475
5476 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE);
5477 __ GetObjectType(object, a1, a1);
5478 DeoptimizeIf(le, instr, Deoptimizer::kNotAJavaScriptObject, a1,
5479 Operand(JS_PROXY_TYPE));
5480 5473
5481 Label use_cache, call_runtime; 5474 Label use_cache, call_runtime;
5482 DCHECK(object.is(a0)); 5475 DCHECK(object.is(a0));
5483 Register null_value = t1; 5476 __ CheckEnumCache(&call_runtime);
5484 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
5485 __ CheckEnumCache(null_value, &call_runtime);
5486 5477
5487 __ lw(result, FieldMemOperand(object, HeapObject::kMapOffset)); 5478 __ lw(result, FieldMemOperand(object, HeapObject::kMapOffset));
5488 __ Branch(&use_cache); 5479 __ Branch(&use_cache);
5489 5480
5490 // Get the set of properties to enumerate. 5481 // Get the set of properties to enumerate.
5491 __ bind(&call_runtime); 5482 __ bind(&call_runtime);
5492 __ push(object); 5483 __ push(object);
5493 CallRuntime(Runtime::kGetPropertyNamesFast, instr); 5484 CallRuntime(Runtime::kGetPropertyNamesFast, instr);
5494
5495 __ lw(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
5496 DCHECK(result.is(v0));
5497 __ LoadRoot(at, Heap::kMetaMapRootIndex);
5498 DeoptimizeIf(ne, instr, Deoptimizer::kWrongMap, a1, Operand(at));
5499 __ bind(&use_cache); 5485 __ bind(&use_cache);
5500 } 5486 }
5501 5487
5502 5488
5503 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5489 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5504 Register map = ToRegister(instr->map()); 5490 Register map = ToRegister(instr->map());
5505 Register result = ToRegister(instr->result()); 5491 Register result = ToRegister(instr->result());
5506 Label load_cache, done; 5492 Label load_cache, done;
5507 __ EnumLength(result, map); 5493 __ EnumLength(result, map);
5508 __ Branch(&load_cache, ne, result, Operand(Smi::FromInt(0))); 5494 __ Branch(&load_cache, ne, result, Operand(Smi::FromInt(0)));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 __ Push(at, ToRegister(instr->function())); 5602 __ Push(at, ToRegister(instr->function()));
5617 CallRuntime(Runtime::kPushBlockContext, instr); 5603 CallRuntime(Runtime::kPushBlockContext, instr);
5618 RecordSafepoint(Safepoint::kNoLazyDeopt); 5604 RecordSafepoint(Safepoint::kNoLazyDeopt);
5619 } 5605 }
5620 5606
5621 5607
5622 #undef __ 5608 #undef __
5623 5609
5624 } // namespace internal 5610 } // namespace internal
5625 } // namespace v8 5611 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698