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

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

Issue 2640793004: Revert remove dead hole check logic (Closed)
Patch Set: Revert "[crankshaft] Fix mips/mips64 build: remove unused variable" and "[crankshaft] Remove dead Variable hole-checking code" 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/x64/lithium-x64.cc ('k') | src/crankshaft/x87/lithium-x87.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_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2641 } 2641 }
2642 2642
2643 EmitReturn(instr); 2643 EmitReturn(instr);
2644 } 2644 }
2645 2645
2646 2646
2647 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2647 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2648 Register context = ToRegister(instr->context()); 2648 Register context = ToRegister(instr->context());
2649 Register result = ToRegister(instr->result()); 2649 Register result = ToRegister(instr->result());
2650 __ mov(result, ContextOperand(context, instr->slot_index())); 2650 __ mov(result, ContextOperand(context, instr->slot_index()));
2651
2652 if (instr->hydrogen()->RequiresHoleCheck()) {
2653 __ cmp(result, factory()->the_hole_value());
2654 if (instr->hydrogen()->DeoptimizesOnHole()) {
2655 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
2656 } else {
2657 Label is_not_hole;
2658 __ j(not_equal, &is_not_hole, Label::kNear);
2659 __ mov(result, factory()->undefined_value());
2660 __ bind(&is_not_hole);
2661 }
2662 }
2651 } 2663 }
2652 2664
2653 2665
2654 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2666 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2655 Register context = ToRegister(instr->context()); 2667 Register context = ToRegister(instr->context());
2656 Register value = ToRegister(instr->value()); 2668 Register value = ToRegister(instr->value());
2669
2670 Label skip_assignment;
2671
2657 Operand target = ContextOperand(context, instr->slot_index()); 2672 Operand target = ContextOperand(context, instr->slot_index());
2673 if (instr->hydrogen()->RequiresHoleCheck()) {
2674 __ cmp(target, factory()->the_hole_value());
2675 if (instr->hydrogen()->DeoptimizesOnHole()) {
2676 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
2677 } else {
2678 __ j(not_equal, &skip_assignment, Label::kNear);
2679 }
2680 }
2658 2681
2659 __ mov(target, value); 2682 __ mov(target, value);
2660 if (instr->hydrogen()->NeedsWriteBarrier()) { 2683 if (instr->hydrogen()->NeedsWriteBarrier()) {
2661 SmiCheck check_needed = 2684 SmiCheck check_needed =
2662 instr->hydrogen()->value()->type().IsHeapObject() 2685 instr->hydrogen()->value()->type().IsHeapObject()
2663 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2686 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2664 Register temp = ToRegister(instr->temp()); 2687 Register temp = ToRegister(instr->temp());
2665 int offset = Context::SlotOffset(instr->slot_index()); 2688 int offset = Context::SlotOffset(instr->slot_index());
2666 __ RecordWriteContextSlot(context, offset, value, temp, kSaveFPRegs, 2689 __ RecordWriteContextSlot(context, offset, value, temp, kSaveFPRegs,
2667 EMIT_REMEMBERED_SET, check_needed); 2690 EMIT_REMEMBERED_SET, check_needed);
2668 } 2691 }
2692
2693 __ bind(&skip_assignment);
2669 } 2694 }
2670 2695
2671 2696
2672 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2697 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2673 HObjectAccess access = instr->hydrogen()->access(); 2698 HObjectAccess access = instr->hydrogen()->access();
2674 int offset = access.offset(); 2699 int offset = access.offset();
2675 2700
2676 if (access.IsExternalMemory()) { 2701 if (access.IsExternalMemory()) {
2677 Register result = ToRegister(instr->result()); 2702 Register result = ToRegister(instr->result());
2678 MemOperand operand = instr->object()->IsConstantOperand() 2703 MemOperand operand = instr->object()->IsConstantOperand()
(...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after
5627 __ bind(deferred->exit()); 5652 __ bind(deferred->exit());
5628 __ bind(&done); 5653 __ bind(&done);
5629 } 5654 }
5630 5655
5631 #undef __ 5656 #undef __
5632 5657
5633 } // namespace internal 5658 } // namespace internal
5634 } // namespace v8 5659 } // namespace v8
5635 5660
5636 #endif // V8_TARGET_ARCH_X87 5661 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/crankshaft/x64/lithium-x64.cc ('k') | src/crankshaft/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698