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

Side by Side Diff: src/ast/ast.cc

Issue 2428533002: Simplify should-eager-compile handling (Closed)
Patch Set: Created 4 years, 2 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 | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698