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

Unified Diff: src/parser.cc

Issue 6681034: Merge r7110 from bleeding_edge to the 3.1 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.1/
Patch Set: Created 9 years, 9 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
« no previous file with comments | « src/parser.h ('k') | src/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
===================================================================
--- src/parser.cc (revision 7161)
+++ src/parser.cc (working copy)
@@ -703,38 +703,40 @@
return result;
}
-FunctionLiteral* Parser::ParseLazy(Handle<SharedFunctionInfo> info) {
+FunctionLiteral* Parser::ParseLazy(CompilationInfo* info) {
CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
HistogramTimerScope timer(&Counters::parse_lazy);
Handle<String> source(String::cast(script_->source()));
Counters::total_parse_size.Increment(source->length());
+ Handle<SharedFunctionInfo> shared_info = info->shared_info();
// Initialize parser state.
source->TryFlatten();
if (source->IsExternalTwoByteString()) {
ExternalTwoByteStringUC16CharacterStream stream(
Handle<ExternalTwoByteString>::cast(source),
- info->start_position(),
- info->end_position());
+ shared_info->start_position(),
+ shared_info->end_position());
FunctionLiteral* result = ParseLazy(info, &stream, &zone_scope);
return result;
} else {
GenericStringUC16CharacterStream stream(source,
- info->start_position(),
- info->end_position());
+ shared_info->start_position(),
+ shared_info->end_position());
FunctionLiteral* result = ParseLazy(info, &stream, &zone_scope);
return result;
}
}
-FunctionLiteral* Parser::ParseLazy(Handle<SharedFunctionInfo> info,
+FunctionLiteral* Parser::ParseLazy(CompilationInfo* info,
UC16CharacterStream* source,
ZoneScope* zone_scope) {
+ Handle<SharedFunctionInfo> shared_info = info->shared_info();
scanner_.Initialize(source);
ASSERT(target_stack_ == NULL);
- Handle<String> name(String::cast(info->name()));
+ Handle<String> name(String::cast(shared_info->name()));
fni_ = new FuncNameInferrer();
fni_->PushEnclosingName(name);
@@ -746,18 +748,20 @@
{
// Parse the function literal.
Handle<String> no_name = Factory::empty_symbol();
- Scope* scope =
- NewScope(top_scope_, Scope::GLOBAL_SCOPE, inside_with());
+ Scope* scope = NewScope(top_scope_, Scope::GLOBAL_SCOPE, inside_with());
+ if (!info->closure().is_null()) {
+ scope = Scope::DeserializeScopeChain(info, scope);
+ }
LexicalScope lexical_scope(&this->top_scope_, &this->with_nesting_level_,
scope);
TemporaryScope temp_scope(&this->temp_scope_);
- if (info->strict_mode()) {
+ if (shared_info->strict_mode()) {
temp_scope.EnableStrictMode();
}
FunctionLiteralType type =
- info->is_expression() ? EXPRESSION : DECLARATION;
+ shared_info->is_expression() ? EXPRESSION : DECLARATION;
bool ok = true;
result = ParseFunctionLiteral(name,
false, // Strict mode name already checked.
@@ -775,7 +779,7 @@
zone_scope->DeleteOnExit();
if (stack_overflow_) Top::StackOverflow();
} else {
- Handle<String> inferred_name(info->inferred_name());
+ Handle<String> inferred_name(shared_info->inferred_name());
result->set_inferred_name(inferred_name);
}
return result;
@@ -5133,7 +5137,7 @@
Handle<Script> script = info->script();
if (info->is_lazy()) {
Parser parser(script, true, NULL, NULL);
- result = parser.ParseLazy(info->shared_info());
+ result = parser.ParseLazy(info);
} else {
bool allow_natives_syntax =
FLAG_allow_natives_syntax || Bootstrapper::IsActive();
« no previous file with comments | « src/parser.h ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698