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

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

Issue 2419663005: Only guard the eager compile hint by whether the target literal was same-zone parsed (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/parsing/parser-base.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 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;
296 scope()->SetShouldEagerCompile(); 297 scope()->SetShouldEagerCompile();
297 } 298 }
298 299
299 bool FunctionLiteral::AllowsLazyCompilation() { 300 bool FunctionLiteral::AllowsLazyCompilation() {
300 return scope()->AllowsLazyCompilation(); 301 return scope()->AllowsLazyCompilation();
301 } 302 }
302 303
303 304
304 int FunctionLiteral::start_position() const { 305 int FunctionLiteral::start_position() const {
305 return scope()->start_position(); 306 return scope()->start_position();
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 // static 961 // static
961 bool Literal::Match(void* literal1, void* literal2) { 962 bool Literal::Match(void* literal1, void* literal2) {
962 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 963 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
963 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 964 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
964 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 965 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
965 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 966 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
966 } 967 }
967 968
968 } // namespace internal 969 } // namespace internal
969 } // namespace v8 970 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698