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

Side by Side Diff: src/ast/variables.h

Issue 2257493002: Better pack fields in Variable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merged master (again) Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #ifndef V8_AST_VARIABLES_H_ 5 #ifndef V8_AST_VARIABLES_H_
6 #define V8_AST_VARIABLES_H_ 6 #define V8_AST_VARIABLES_H_
7 7
8 #include "src/ast/ast-value-factory.h" 8 #include "src/ast/ast-value-factory.h"
9 #include "src/zone.h" 9 #include "src/zone.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // parameter initializers. 42 // parameter initializers.
43 void set_scope(Scope* scope) { scope_ = scope; } 43 void set_scope(Scope* scope) { scope_ = scope; }
44 44
45 Handle<String> name() const { return name_->string(); } 45 Handle<String> name() const { return name_->string(); }
46 const AstRawString* raw_name() const { return name_; } 46 const AstRawString* raw_name() const { return name_; }
47 VariableMode mode() const { return VariableModeField::decode(bit_field_); } 47 VariableMode mode() const { return VariableModeField::decode(bit_field_); }
48 bool has_forced_context_allocation() const { 48 bool has_forced_context_allocation() const {
49 return ForceContextAllocationField::decode(bit_field_); 49 return ForceContextAllocationField::decode(bit_field_);
50 } 50 }
51 void ForceContextAllocation() { 51 void ForceContextAllocation() {
52 DCHECK(IsUnallocated() || IsContextSlot());
52 bit_field_ = ForceContextAllocationField::update(bit_field_, true); 53 bit_field_ = ForceContextAllocationField::update(bit_field_, true);
53 } 54 }
54 bool is_used() { return IsUsedField::decode(bit_field_); } 55 bool is_used() { return IsUsedField::decode(bit_field_); }
55 void set_is_used() { bit_field_ = IsUsedField::update(bit_field_, true); } 56 void set_is_used() { bit_field_ = IsUsedField::update(bit_field_, true); }
56 MaybeAssignedFlag maybe_assigned() const { 57 MaybeAssignedFlag maybe_assigned() const {
57 return MaybeAssignedFlagField::decode(bit_field_); 58 return MaybeAssignedFlagField::decode(bit_field_);
58 } 59 }
59 void set_maybe_assigned() { 60 void set_maybe_assigned() {
60 bit_field_ = MaybeAssignedFlagField::update(bit_field_, kMaybeAssigned); 61 bit_field_ = MaybeAssignedFlagField::update(bit_field_, kMaybeAssigned);
61 } 62 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 class InitializationFlagField 142 class InitializationFlagField
142 : public BitField16<InitializationFlag, IsUsedField::kNext, 2> {}; 143 : public BitField16<InitializationFlag, IsUsedField::kNext, 2> {};
143 class MaybeAssignedFlagField 144 class MaybeAssignedFlagField
144 : public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext, 145 : public BitField16<MaybeAssignedFlag, InitializationFlagField::kNext,
145 2> {}; 146 2> {};
146 }; 147 };
147 } // namespace internal 148 } // namespace internal
148 } // namespace v8 149 } // namespace v8
149 150
150 #endif // V8_AST_VARIABLES_H_ 151 #endif // V8_AST_VARIABLES_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698