Revision: 20331
Author: [email protected]
Date: Fri Mar 28 12:49:34 2014 UTC
Log: Make it clearer that PreParser doesn't depend on Isolate.
The Isolate* member of ParserBase::FunctionState was only used by
Parser. Removing it makes it clear that there are no isolates in
PreParser. (There's also no Zone, since PreParserTraits::Type::Zone is
void.)
[email protected]
BUG=
Review URL: https://codereview.chromium.org/216883003
http://code.google.com/p/v8/source/detail?r=20331
Modified:
/branches/bleeding_edge/src/parser.h
/branches/bleeding_edge/src/preparser.h
=======================================
--- /branches/bleeding_edge/src/parser.h Fri Mar 21 10:34:51 2014 UTC
+++ /branches/bleeding_edge/src/parser.h Fri Mar 28 12:49:34 2014 UTC
@@ -441,16 +441,14 @@
template<typename FunctionState>
static void SetUpFunctionState(FunctionState* function_state, Zone*
zone) {
Isolate* isolate = zone->isolate();
- function_state->isolate_ = isolate;
function_state->saved_ast_node_id_ = isolate->ast_node_id();
isolate->set_ast_node_id(BailoutId::FirstUsable().ToInt());
}
template<typename FunctionState>
- static void TearDownFunctionState(FunctionState* function_state) {
+ static void TearDownFunctionState(FunctionState* function_state, Zone*
zone) {
if (function_state->outer_function_state_ != NULL) {
- function_state->isolate_->set_ast_node_id(
- function_state->saved_ast_node_id_);
+ zone->isolate()->set_ast_node_id(function_state->saved_ast_node_id_);
}
}
=======================================
--- /branches/bleeding_edge/src/preparser.h Mon Mar 24 12:16:09 2014 UTC
+++ /branches/bleeding_edge/src/preparser.h Fri Mar 28 12:49:34 2014 UTC
@@ -228,8 +228,8 @@
FunctionState* outer_function_state_;
typename Traits::Type::Scope** scope_stack_;
typename Traits::Type::Scope* outer_scope_;
- Isolate* isolate_; // Only used by ParserTraits.
int saved_ast_node_id_; // Only used by ParserTraits.
+ typename Traits::Type::Zone* extra_param_;
typename Traits::Type::Factory factory_;
friend class ParserTraits;
@@ -829,7 +829,7 @@
template<typename FunctionState>
static void SetUpFunctionState(FunctionState* function_state, void*) {}
template<typename FunctionState>
- static void TearDownFunctionState(FunctionState* function_state) {}
+ static void TearDownFunctionState(FunctionState* function_state, void*)
{}
// Helper functions for recursive descent.
static bool IsEvalOrArguments(PreParserIdentifier identifier) {
@@ -1181,8 +1181,8 @@
outer_function_state_(*function_state_stack),
scope_stack_(scope_stack),
outer_scope_(*scope_stack),
- isolate_(NULL),
saved_ast_node_id_(0),
+ extra_param_(extra_param),
factory_(extra_param) {
*scope_stack_ = scope;
*function_state_stack = this;
@@ -1194,7 +1194,7 @@
ParserBase<Traits>::FunctionState::~FunctionState() {
*scope_stack_ = outer_scope_;
*function_state_stack_ = outer_function_state_;
- Traits::TearDownFunctionState(this);
+ Traits::TearDownFunctionState(this, extra_param_);
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.