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

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

Issue 2399833002: Teach Scopes whether they will end up being lazily compiled or not (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/ast.cc » ('j') | src/ast/ast.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 #ifndef V8_AST_AST_H_ 5 #ifndef V8_AST_AST_H_
6 #define V8_AST_AST_H_ 6 #define V8_AST_AST_H_
7 7
8 #include "src/ast/ast-types.h" 8 #include "src/ast/ast-types.h"
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/modules.h" 10 #include "src/ast/modules.h"
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2645 bool is_function() const { return IsFunction::decode(bit_field_); } 2645 bool is_function() const { return IsFunction::decode(bit_field_); }
2646 2646
2647 // This is used as a heuristic on when to eagerly compile a function 2647 // This is used as a heuristic on when to eagerly compile a function
2648 // literal. We consider the following constructs as hints that the 2648 // literal. We consider the following constructs as hints that the
2649 // function will be called immediately: 2649 // function will be called immediately:
2650 // - (function() { ... })(); 2650 // - (function() { ... })();
2651 // - var x = function() { ... }(); 2651 // - var x = function() { ... }();
2652 bool should_eager_compile() const { 2652 bool should_eager_compile() const {
2653 return ShouldEagerCompile::decode(bit_field_); 2653 return ShouldEagerCompile::decode(bit_field_);
2654 } 2654 }
2655 void set_should_eager_compile() { 2655 void set_should_eager_compile();
2656 bit_field_ = ShouldEagerCompile::update(bit_field_, true);
2657 }
2658 2656
2659 // A hint that we expect this function to be called (exactly) once, 2657 // A hint that we expect this function to be called (exactly) once,
2660 // i.e. we suspect it's an initialization function. 2658 // i.e. we suspect it's an initialization function.
2661 bool should_be_used_once_hint() const { 2659 bool should_be_used_once_hint() const {
2662 return ShouldNotBeUsedOnceHintField::decode(bit_field_); 2660 return ShouldNotBeUsedOnceHintField::decode(bit_field_);
2663 } 2661 }
2664 void set_should_be_used_once_hint() { 2662 void set_should_be_used_once_hint() {
2665 bit_field_ = ShouldNotBeUsedOnceHintField::update(bit_field_, true); 2663 bit_field_ = ShouldNotBeUsedOnceHintField::update(bit_field_, true);
2666 } 2664 }
2667 2665
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
3601 : NULL; \ 3599 : NULL; \
3602 } 3600 }
3603 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) 3601 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
3604 #undef DECLARE_NODE_FUNCTIONS 3602 #undef DECLARE_NODE_FUNCTIONS
3605 3603
3606 3604
3607 } // namespace internal 3605 } // namespace internal
3608 } // namespace v8 3606 } // namespace v8
3609 3607
3610 #endif // V8_AST_AST_H_ 3608 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | src/ast/ast.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698