Revision: 15330
Author: [email protected]
Date: Wed Jun 26 01:05:41 2013
Log: Remove useless ZoneScopes from Parser.
[email protected]
BUG=
Review URL: https://codereview.chromium.org/17817003
http://code.google.com/p/v8/source/detail?r=15330
Modified:
/branches/bleeding_edge/src/parser.cc
/branches/bleeding_edge/src/parser.h
=======================================
--- /branches/bleeding_edge/src/parser.cc Mon Jun 24 07:26:32 2013
+++ /branches/bleeding_edge/src/parser.cc Wed Jun 26 01:05:41 2013
@@ -566,7 +566,6 @@
FunctionLiteral* Parser::ParseProgram() {
- ZoneScope zone_scope(zone(), DONT_DELETE_ON_EXIT);
HistogramTimerScope timer(isolate()->counters()->parse());
Handle<String> source(String::cast(script_->source()));
isolate()->counters()->total_parse_size()->Increment(source->length());
@@ -583,11 +582,11 @@
ExternalTwoByteStringUtf16CharacterStream stream(
Handle<ExternalTwoByteString>::cast(source), 0, source->length());
scanner_.Initialize(&stream);
- result = DoParseProgram(info(), source, &zone_scope);
+ result = DoParseProgram(info(), source);
} else {
GenericStringUtf16CharacterStream stream(source, 0, source->length());
scanner_.Initialize(&stream);
- result = DoParseProgram(info(), source, &zone_scope);
+ result = DoParseProgram(info(), source);
}
if (FLAG_trace_parse && result != NULL) {
@@ -608,8 +607,7 @@
FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info,
- Handle<String> source,
- ZoneScope* zone_scope) {
+ Handle<String> source) {
ASSERT(top_scope_ == NULL);
ASSERT(target_stack_ == NULL);
if (pre_parse_data_ != NULL) pre_parse_data_->Initialize();
@@ -690,15 +688,11 @@
// Make sure the target stack is empty.
ASSERT(target_stack_ == NULL);
- // If there was a syntax error we have to get rid of the AST
- // and it is not safe to do so before the scope has been deleted.
- if (result == NULL) zone_scope->DeleteOnExit();
return result;
}
FunctionLiteral* Parser::ParseLazy() {
- ZoneScope zone_scope(zone(), DONT_DELETE_ON_EXIT);
HistogramTimerScope timer(isolate()->counters()->parse_lazy());
Handle<String> source(String::cast(script_->source()));
isolate()->counters()->total_parse_size()->Increment(source->length());
@@ -713,12 +707,12 @@
Handle<ExternalTwoByteString>::cast(source),
shared_info->start_position(),
shared_info->end_position());
- result = ParseLazy(&stream, &zone_scope);
+ result = ParseLazy(&stream);
} else {
GenericStringUtf16CharacterStream stream(source,
shared_info->start_position(),
shared_info->end_position());
- result = ParseLazy(&stream, &zone_scope);
+ result = ParseLazy(&stream);
}
if (FLAG_trace_parse && result != NULL) {
@@ -730,8 +724,7 @@
}
-FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source,
- ZoneScope* zone_scope) {
+FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
Handle<SharedFunctionInfo> shared_info = info()->shared_info();
scanner_.Initialize(source);
ASSERT(top_scope_ == NULL);
@@ -779,10 +772,7 @@
// Make sure the target stack is empty.
ASSERT(target_stack_ == NULL);
- // If there was a stack overflow we have to get rid of AST and it is
- // not safe to do before scope has been deleted.
if (result == NULL) {
- zone_scope->DeleteOnExit();
if (stack_overflow_) isolate()->StackOverflow();
} else {
Handle<String> inferred_name(shared_info->inferred_name());
=======================================
--- /branches/bleeding_edge/src/parser.h Mon Jun 24 07:26:32 2013
+++ /branches/bleeding_edge/src/parser.h Wed Jun 26 01:05:41 2013
@@ -562,8 +562,7 @@
};
FunctionLiteral* ParseLazy();
- FunctionLiteral* ParseLazy(Utf16CharacterStream* source,
- ZoneScope* zone_scope);
+ FunctionLiteral* ParseLazy(Utf16CharacterStream* source);
Isolate* isolate() { return isolate_; }
Zone* zone() const { return zone_; }
@@ -571,8 +570,7 @@
// Called by ParseProgram after setting up the scanner.
FunctionLiteral* DoParseProgram(CompilationInfo* info,
- Handle<String> source,
- ZoneScope* zone_scope);
+ Handle<String> source);
// Report syntax error
void ReportUnexpectedToken(Token::Value token);
--
--
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/groups/opt_out.