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

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

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (Closed)
Patch Set: rebase 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 | « src/ast/ast.h ('k') | src/ast/scopes.h » ('j') | no next file with comments »
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 case Token::ASSIGN_ADD: return Token::ADD; 281 case Token::ASSIGN_ADD: return Token::ADD;
282 case Token::ASSIGN_SUB: return Token::SUB; 282 case Token::ASSIGN_SUB: return Token::SUB;
283 case Token::ASSIGN_MUL: return Token::MUL; 283 case Token::ASSIGN_MUL: return Token::MUL;
284 case Token::ASSIGN_DIV: return Token::DIV; 284 case Token::ASSIGN_DIV: return Token::DIV;
285 case Token::ASSIGN_MOD: return Token::MOD; 285 case Token::ASSIGN_MOD: return Token::MOD;
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 {
292 return scope()->ShouldEagerCompile();
293 }
294
295 void FunctionLiteral::SetShouldEagerCompile() {
296 scope()->SetShouldEagerCompile();
297 }
291 298
292 bool FunctionLiteral::AllowsLazyCompilation() { 299 bool FunctionLiteral::AllowsLazyCompilation() {
293 return scope()->AllowsLazyCompilation(); 300 return scope()->AllowsLazyCompilation();
294 } 301 }
295 302
296 303
297 int FunctionLiteral::start_position() const { 304 int FunctionLiteral::start_position() const {
298 return scope()->start_position(); 305 return scope()->start_position();
299 } 306 }
300 307
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 // static 960 // static
954 bool Literal::Match(void* literal1, void* literal2) { 961 bool Literal::Match(void* literal1, void* literal2) {
955 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 962 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
956 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 963 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
957 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 964 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
958 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 965 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
959 } 966 }
960 967
961 } // namespace internal 968 } // namespace internal
962 } // namespace v8 969 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698