Consistently use CompilationZoneScope instead of ZoneScope to ensure

that the FrameElement constants list gets cleared.
Review URL: http://codereview.chromium.org/115352

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2009-05-14 13:17:28 +00:00
parent 2a96ec599b
commit 57da353113
3 changed files with 8 additions and 6 deletions

View File

@ -28,6 +28,7 @@
#include "v8.h" #include "v8.h"
#include "ast.h" #include "ast.h"
#include "compiler.h"
#include "execution.h" #include "execution.h"
#include "factory.h" #include "factory.h"
#include "jsregexp-inl.h" #include "jsregexp-inl.h"
@ -153,7 +154,7 @@ Handle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
return re; return re;
} }
FlattenString(pattern); FlattenString(pattern);
ZoneScope zone_scope(DELETE_ON_EXIT); CompilationZoneScope zone_scope(DELETE_ON_EXIT);
RegExpCompileData parse_result; RegExpCompileData parse_result;
FlatStringReader reader(pattern); FlatStringReader reader(pattern);
if (!ParseRegExp(&reader, flags.is_multiline(), &parse_result)) { if (!ParseRegExp(&reader, flags.is_multiline(), &parse_result)) {
@ -285,7 +286,7 @@ bool RegExpImpl::EnsureCompiledIrregexp(Handle<JSRegExp> re, bool is_ascii) {
} }
// Compile the RegExp. // Compile the RegExp.
ZoneScope zone_scope(DELETE_ON_EXIT); CompilationZoneScope zone_scope(DELETE_ON_EXIT);
JSRegExp::Flags flags = re->GetFlags(); JSRegExp::Flags flags = re->GetFlags();

View File

@ -30,6 +30,7 @@
#include "api.h" #include "api.h"
#include "ast.h" #include "ast.h"
#include "bootstrapper.h" #include "bootstrapper.h"
#include "compiler.h"
#include "platform.h" #include "platform.h"
#include "runtime.h" #include "runtime.h"
#include "parser.h" #include "parser.h"
@ -1096,7 +1097,7 @@ bool Parser::PreParseProgram(unibrow::CharacterStream* stream) {
FunctionLiteral* Parser::ParseProgram(Handle<String> source, FunctionLiteral* Parser::ParseProgram(Handle<String> source,
unibrow::CharacterStream* stream, unibrow::CharacterStream* stream,
bool in_global_context) { bool in_global_context) {
ZoneScope zone_scope(DONT_DELETE_ON_EXIT); CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
HistogramTimerScope timer(&Counters::parse); HistogramTimerScope timer(&Counters::parse);
Counters::total_parse_size.Increment(source->length()); Counters::total_parse_size.Increment(source->length());
@ -1149,7 +1150,7 @@ FunctionLiteral* Parser::ParseLazy(Handle<String> source,
Handle<String> name, Handle<String> name,
int start_position, int start_position,
bool is_expression) { bool is_expression) {
ZoneScope zone_scope(DONT_DELETE_ON_EXIT); CompilationZoneScope zone_scope(DONT_DELETE_ON_EXIT);
HistogramTimerScope timer(&Counters::parse_lazy); HistogramTimerScope timer(&Counters::parse_lazy);
source->TryFlattenIfNotFlat(); source->TryFlattenIfNotFlat();
Counters::total_parse_size.Increment(source->length()); Counters::total_parse_size.Increment(source->length());

View File

@ -1723,7 +1723,7 @@ static Object* StringReplaceRegExpWithString(String* subject,
int capture_count = regexp_handle->CaptureCount(); int capture_count = regexp_handle->CaptureCount();
// CompiledReplacement uses zone allocation. // CompiledReplacement uses zone allocation.
ZoneScope zone(DELETE_ON_EXIT); CompilationZoneScope zone(DELETE_ON_EXIT);
CompiledReplacement compiled_replacement; CompiledReplacement compiled_replacement;
compiled_replacement.Compile(replacement_handle, compiled_replacement.Compile(replacement_handle,
capture_count, capture_count,
@ -2376,7 +2376,7 @@ static Object* Runtime_StringMatch(Arguments args) {
} }
int length = subject->length(); int length = subject->length();
ZoneScope zone_space(DELETE_ON_EXIT); CompilationZoneScope zone_space(DELETE_ON_EXIT);
ZoneList<int> offsets(8); ZoneList<int> offsets(8);
do { do {
int start; int start;