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

Side by Side Diff: src/full-codegen/s390/full-codegen-s390.cc

Issue 1964993002: [cleanup] Global variable declarations are never hole initialized (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x64/full-codegen-x64.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_S390 5 #if V8_TARGET_ARCH_S390
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.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/codegen.h" 10 #include "src/codegen.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 // If it was not possible to allocate the variable at compile time, we 701 // If it was not possible to allocate the variable at compile time, we
702 // need to "declare" it at runtime to make sure it actually exists in the 702 // need to "declare" it at runtime to make sure it actually exists in the
703 // local context. 703 // local context.
704 VariableProxy* proxy = declaration->proxy(); 704 VariableProxy* proxy = declaration->proxy();
705 VariableMode mode = declaration->mode(); 705 VariableMode mode = declaration->mode();
706 Variable* variable = proxy->var(); 706 Variable* variable = proxy->var();
707 bool hole_init = mode == LET || mode == CONST; 707 bool hole_init = mode == LET || mode == CONST;
708 switch (variable->location()) { 708 switch (variable->location()) {
709 case VariableLocation::GLOBAL: 709 case VariableLocation::GLOBAL:
710 case VariableLocation::UNALLOCATED: 710 case VariableLocation::UNALLOCATED:
711 DCHECK(!variable->binding_needs_init());
711 globals_->Add(variable->name(), zone()); 712 globals_->Add(variable->name(), zone());
712 globals_->Add(variable->binding_needs_init() 713 globals_->Add(isolate()->factory()->undefined_value(), zone());
713 ? isolate()->factory()->the_hole_value()
714 : isolate()->factory()->undefined_value(),
715 zone());
716 break; 714 break;
717 715
718 case VariableLocation::PARAMETER: 716 case VariableLocation::PARAMETER:
719 case VariableLocation::LOCAL: 717 case VariableLocation::LOCAL:
720 if (hole_init) { 718 if (hole_init) {
721 Comment cmnt(masm_, "[ VariableDeclaration"); 719 Comment cmnt(masm_, "[ VariableDeclaration");
722 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 720 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
723 __ StoreP(ip, StackOperand(variable)); 721 __ StoreP(ip, StackOperand(variable));
724 } 722 }
725 break; 723 break;
(...skipping 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after
3808 DCHECK(kOSRBranchInstruction == br_instr); 3806 DCHECK(kOSRBranchInstruction == br_instr);
3809 3807
3810 DCHECK(interrupt_address == 3808 DCHECK(interrupt_address ==
3811 isolate->builtins()->OnStackReplacement()->entry()); 3809 isolate->builtins()->OnStackReplacement()->entry());
3812 return ON_STACK_REPLACEMENT; 3810 return ON_STACK_REPLACEMENT;
3813 } 3811 }
3814 3812
3815 } // namespace internal 3813 } // namespace internal
3816 } // namespace v8 3814 } // namespace v8
3817 #endif // V8_TARGET_ARCH_S390 3815 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698