| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 default: UNREACHABLE(); | 286 default: UNREACHABLE(); |
| 287 } | 287 } |
| 288 return Token::ILLEGAL; | 288 return Token::ILLEGAL; |
| 289 } | 289 } |
| 290 | 290 |
| 291 bool FunctionLiteral::ShouldEagerCompile() const { | 291 bool FunctionLiteral::ShouldEagerCompile() const { |
| 292 return scope()->ShouldEagerCompile(); | 292 return scope()->ShouldEagerCompile(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void FunctionLiteral::SetShouldEagerCompile() { | 295 void FunctionLiteral::SetShouldEagerCompile() { |
| 296 if (body_ == nullptr) return; | |
| 297 scope()->set_should_eager_compile(); | 296 scope()->set_should_eager_compile(); |
| 298 } | 297 } |
| 299 | 298 |
| 300 bool FunctionLiteral::AllowsLazyCompilation() { | 299 bool FunctionLiteral::AllowsLazyCompilation() { |
| 301 return scope()->AllowsLazyCompilation(); | 300 return scope()->AllowsLazyCompilation(); |
| 302 } | 301 } |
| 303 | 302 |
| 304 | 303 |
| 305 int FunctionLiteral::start_position() const { | 304 int FunctionLiteral::start_position() const { |
| 306 return scope()->start_position(); | 305 return scope()->start_position(); |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 // static | 960 // static |
| 962 bool Literal::Match(void* literal1, void* literal2) { | 961 bool Literal::Match(void* literal1, void* literal2) { |
| 963 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 962 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
| 964 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 963 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
| 965 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 964 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
| 966 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 965 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
| 967 } | 966 } |
| 968 | 967 |
| 969 } // namespace internal | 968 } // namespace internal |
| 970 } // namespace v8 | 969 } // namespace v8 |
| OLD | NEW |