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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 bit_field_(IsThisField::encode(var->is_this()) | | 165 bit_field_(IsThisField::encode(var->is_this()) | |
166 IsAssignedField::encode(false) | | 166 IsAssignedField::encode(false) | |
167 IsResolvedField::encode(false)), | 167 IsResolvedField::encode(false)), |
168 end_position_(end_position), | 168 end_position_(end_position), |
169 raw_name_(var->raw_name()), | 169 raw_name_(var->raw_name()), |
170 next_unresolved_(nullptr) { | 170 next_unresolved_(nullptr) { |
171 BindTo(var); | 171 BindTo(var); |
172 } | 172 } |
173 | 173 |
174 VariableProxy::VariableProxy(const AstRawString* name, | 174 VariableProxy::VariableProxy(const AstRawString* name, |
175 Variable::Kind variable_kind, int start_position, | 175 VariableKind variable_kind, int start_position, |
176 int end_position) | 176 int end_position) |
177 : Expression(start_position, kVariableProxy), | 177 : Expression(start_position, kVariableProxy), |
178 bit_field_(IsThisField::encode(variable_kind == Variable::THIS) | | 178 bit_field_(IsThisField::encode(variable_kind == THIS_VARIABLE) | |
179 IsAssignedField::encode(false) | | 179 IsAssignedField::encode(false) | |
180 IsResolvedField::encode(false)), | 180 IsResolvedField::encode(false)), |
181 end_position_(end_position), | 181 end_position_(end_position), |
182 raw_name_(name), | 182 raw_name_(name), |
183 next_unresolved_(nullptr) {} | 183 next_unresolved_(nullptr) {} |
184 | 184 |
185 VariableProxy::VariableProxy(const VariableProxy* copy_from) | 185 VariableProxy::VariableProxy(const VariableProxy* copy_from) |
186 : Expression(copy_from->position(), kVariableProxy), | 186 : Expression(copy_from->position(), kVariableProxy), |
187 bit_field_(copy_from->bit_field_), | 187 bit_field_(copy_from->bit_field_), |
188 end_position_(copy_from->end_position_), | 188 end_position_(copy_from->end_position_), |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 // static | 959 // static |
960 bool Literal::Match(void* literal1, void* literal2) { | 960 bool Literal::Match(void* literal1, void* literal2) { |
961 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 961 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
962 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 962 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
963 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 963 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
964 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 964 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
965 } | 965 } |
966 | 966 |
967 } // namespace internal | 967 } // namespace internal |
968 } // namespace v8 | 968 } // namespace v8 |
OLD | NEW |