OLD | NEW |
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 #include "src/ast/ast.h" | 5 #include "src/ast/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 | 8 |
9 #include "src/ast/compile-time-value.h" | 9 #include "src/ast/compile-time-value.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 : Expression(start_position, kVariableProxy), | 193 : Expression(start_position, kVariableProxy), |
194 raw_name_(var->raw_name()), | 194 raw_name_(var->raw_name()), |
195 next_unresolved_(nullptr) { | 195 next_unresolved_(nullptr) { |
196 bit_field_ |= IsThisField::encode(var->is_this()) | | 196 bit_field_ |= IsThisField::encode(var->is_this()) | |
197 IsAssignedField::encode(false) | | 197 IsAssignedField::encode(false) | |
198 IsResolvedField::encode(false) | | 198 IsResolvedField::encode(false) | |
199 HoleCheckModeField::encode(HoleCheckMode::kElided); | 199 HoleCheckModeField::encode(HoleCheckMode::kElided); |
200 BindTo(var); | 200 BindTo(var); |
201 } | 201 } |
202 | 202 |
203 VariableProxy::VariableProxy(const AstRawString* name, | |
204 VariableKind variable_kind, int start_position) | |
205 : Expression(start_position, kVariableProxy), | |
206 raw_name_(name), | |
207 next_unresolved_(nullptr) { | |
208 bit_field_ |= IsThisField::encode(variable_kind == THIS_VARIABLE) | | |
209 IsAssignedField::encode(false) | | |
210 IsResolvedField::encode(false) | | |
211 HoleCheckModeField::encode(HoleCheckMode::kElided); | |
212 } | |
213 | |
214 VariableProxy::VariableProxy(const VariableProxy* copy_from) | 203 VariableProxy::VariableProxy(const VariableProxy* copy_from) |
215 : Expression(copy_from->position(), kVariableProxy), | 204 : Expression(copy_from->position(), kVariableProxy), |
216 next_unresolved_(nullptr) { | 205 next_unresolved_(nullptr) { |
217 bit_field_ = copy_from->bit_field_; | 206 bit_field_ = copy_from->bit_field_; |
218 DCHECK(!copy_from->is_resolved()); | 207 DCHECK(!copy_from->is_resolved()); |
219 raw_name_ = copy_from->raw_name_; | 208 raw_name_ = copy_from->raw_name_; |
220 } | 209 } |
221 | 210 |
222 void VariableProxy::BindTo(Variable* var) { | 211 void VariableProxy::BindTo(Variable* var) { |
223 DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); | 212 DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 #ifdef DEBUG | 1112 #ifdef DEBUG |
1124 return is_jsruntime() ? NameForNativeContextIntrinsicIndex(context_index_) | 1113 return is_jsruntime() ? NameForNativeContextIntrinsicIndex(context_index_) |
1125 : function_->name; | 1114 : function_->name; |
1126 #else | 1115 #else |
1127 return is_jsruntime() ? "(context function)" : function_->name; | 1116 return is_jsruntime() ? "(context function)" : function_->name; |
1128 #endif // DEBUG | 1117 #endif // DEBUG |
1129 } | 1118 } |
1130 | 1119 |
1131 } // namespace internal | 1120 } // namespace internal |
1132 } // namespace v8 | 1121 } // namespace v8 |
OLD | NEW |