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

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

Issue 2622783002: [crankshaft] Remove dead Variable hole-checking code (Closed)
Patch Set: Update golden files Created 3 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-instructions.h ('k') | src/crankshaft/ia32/lithium-ia32.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/builtins/builtins-constructor.h" 10 #include "src/builtins/builtins-constructor.h"
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 } 2357 }
2358 2358
2359 EmitReturn(instr); 2359 EmitReturn(instr);
2360 } 2360 }
2361 2361
2362 2362
2363 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2363 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2364 Register context = ToRegister(instr->context()); 2364 Register context = ToRegister(instr->context());
2365 Register result = ToRegister(instr->result()); 2365 Register result = ToRegister(instr->result());
2366 __ mov(result, ContextOperand(context, instr->slot_index())); 2366 __ mov(result, ContextOperand(context, instr->slot_index()));
2367
2368 if (instr->hydrogen()->RequiresHoleCheck()) {
2369 __ cmp(result, factory()->the_hole_value());
2370 if (instr->hydrogen()->DeoptimizesOnHole()) {
2371 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
2372 } else {
2373 Label is_not_hole;
2374 __ j(not_equal, &is_not_hole, Label::kNear);
2375 __ mov(result, factory()->undefined_value());
2376 __ bind(&is_not_hole);
2377 }
2378 }
2379 } 2367 }
2380 2368
2381 2369
2382 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2370 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2383 Register context = ToRegister(instr->context()); 2371 Register context = ToRegister(instr->context());
2384 Register value = ToRegister(instr->value()); 2372 Register value = ToRegister(instr->value());
2385
2386 Label skip_assignment;
2387
2388 Operand target = ContextOperand(context, instr->slot_index()); 2373 Operand target = ContextOperand(context, instr->slot_index());
2389 if (instr->hydrogen()->RequiresHoleCheck()) {
2390 __ cmp(target, factory()->the_hole_value());
2391 if (instr->hydrogen()->DeoptimizesOnHole()) {
2392 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
2393 } else {
2394 __ j(not_equal, &skip_assignment, Label::kNear);
2395 }
2396 }
2397 2374
2398 __ mov(target, value); 2375 __ mov(target, value);
2399 if (instr->hydrogen()->NeedsWriteBarrier()) { 2376 if (instr->hydrogen()->NeedsWriteBarrier()) {
2400 SmiCheck check_needed = 2377 SmiCheck check_needed =
2401 instr->hydrogen()->value()->type().IsHeapObject() 2378 instr->hydrogen()->value()->type().IsHeapObject()
2402 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2379 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2403 Register temp = ToRegister(instr->temp()); 2380 Register temp = ToRegister(instr->temp());
2404 int offset = Context::SlotOffset(instr->slot_index()); 2381 int offset = Context::SlotOffset(instr->slot_index());
2405 __ RecordWriteContextSlot(context, 2382 __ RecordWriteContextSlot(context,
2406 offset, 2383 offset,
2407 value, 2384 value,
2408 temp, 2385 temp,
2409 kSaveFPRegs, 2386 kSaveFPRegs,
2410 EMIT_REMEMBERED_SET, 2387 EMIT_REMEMBERED_SET,
2411 check_needed); 2388 check_needed);
2412 } 2389 }
2413
2414 __ bind(&skip_assignment);
2415 } 2390 }
2416 2391
2417 2392
2418 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2393 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2419 HObjectAccess access = instr->hydrogen()->access(); 2394 HObjectAccess access = instr->hydrogen()->access();
2420 int offset = access.offset(); 2395 int offset = access.offset();
2421 2396
2422 if (access.IsExternalMemory()) { 2397 if (access.IsExternalMemory()) {
2423 Register result = ToRegister(instr->result()); 2398 Register result = ToRegister(instr->result());
2424 MemOperand operand = instr->object()->IsConstantOperand() 2399 MemOperand operand = instr->object()->IsConstantOperand()
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
5152 __ bind(deferred->exit()); 5127 __ bind(deferred->exit());
5153 __ bind(&done); 5128 __ bind(&done);
5154 } 5129 }
5155 5130
5156 #undef __ 5131 #undef __
5157 5132
5158 } // namespace internal 5133 } // namespace internal
5159 } // namespace v8 5134 } // namespace v8
5160 5135
5161 #endif // V8_TARGET_ARCH_IA32 5136 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698