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

Unified Diff: src/parser.h

Issue 490173002: Take ast node id counting away from Isolate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« src/ast.h ('K') | « src/isolate.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 4aa6f719f3b9361d7cf6a1622f4cc7cc8dd0f908..2111a733117ae2cb1b45f30b53cd968f5f3aed16 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -378,17 +378,18 @@ class ParserTraits {
explicit ParserTraits(Parser* parser) : parser_(parser) {}
// Custom operations executed when FunctionStates are created and destructed.
- template<typename FunctionState>
- static void SetUpFunctionState(FunctionState* function_state, Zone* zone) {
- Isolate* isolate = zone->isolate();
- function_state->saved_ast_node_id_ = isolate->ast_node_id();
- isolate->set_ast_node_id(BailoutId::FirstUsable().ToInt());
+ template <typename FunctionState>
+ static void SetUpFunctionState(FunctionState* function_state) {
+ function_state->saved_ast_node_id_ =
+ *(function_state->ast_node_id_counter_);
+ *(function_state->ast_node_id_counter_) = BailoutId::FirstUsable().ToInt();
}
- template<typename FunctionState>
- static void TearDownFunctionState(FunctionState* function_state, Zone* zone) {
+ template <typename FunctionState>
+ static void TearDownFunctionState(FunctionState* function_state) {
if (function_state->outer_function_state_ != NULL) {
- zone->isolate()->set_ast_node_id(function_state->saved_ast_node_id_);
+ *(function_state->ast_node_id_counter_) =
+ function_state->saved_ast_node_id_;
}
}
« src/ast.h ('K') | « src/isolate.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698