static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) {
Isolate* isolate = info->isolate();
- ZoneScope zone_scope(info->zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(info->zone());
PostponeInterruptsScope postpone(isolate);
ASSERT(!isolate->native_context().is_null());
bool Compiler::CompileLazy(CompilationInfo* info) {
Isolate* isolate = info->isolate();
- ZoneScope zone_scope(info->zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(info->zone());
// The VM is in the COMPILER state until exiting this function.
VMState<COMPILER> state(isolate);
CompilationPhase::CompilationPhase(const char* name,
Isolate* isolate,
Zone* zone)
- : name_(name), isolate_(isolate), zone_scope_(zone, DELETE_ON_EXIT) {
+ : name_(name), isolate_(isolate), zone_scope_(zone) {
if (FLAG_hydrogen_stats) {
start_allocation_size_ = zone->allocation_size();
start_ticks_ = OS::Ticks();
explicit CompilationInfoWithZone(Handle<Script> script)
: CompilationInfo(script, &zone_, &phase_zone_),
zone_(script->GetIsolate()),
- zone_scope_(&zone_, DELETE_ON_EXIT),
+ zone_scope_(&zone_),
phase_zone_(script->GetIsolate()) {}
explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info)
: CompilationInfo(shared_info, &zone_, &phase_zone_),
zone_(shared_info->GetIsolate()),
- zone_scope_(&zone_, DELETE_ON_EXIT),
+ zone_scope_(&zone_),
phase_zone_(shared_info->GetIsolate()) {}
explicit CompilationInfoWithZone(Handle<JSFunction> closure)
: CompilationInfo(closure, &zone_, &phase_zone_),
zone_(closure->GetIsolate()),
- zone_scope_(&zone_, DELETE_ON_EXIT),
+ zone_scope_(&zone_),
phase_zone_(closure->GetIsolate()) {}
CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate)
: CompilationInfo(stub, isolate, &zone_, &phase_zone_),
zone_(isolate),
- zone_scope_(&zone_, DELETE_ON_EXIT),
+ zone_scope_(&zone_),
phase_zone_(isolate) {}
// Virtual destructor because a CompilationInfoWithZone has to exit the
void Deoptimizer::VisitAllOptimizedFunctionsForContext(
Context* context, OptimizedFunctionVisitor* visitor) {
Isolate* isolate = context->GetIsolate();
- ZoneScope zone_scope(isolate->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(isolate->runtime_zone());
DisallowHeapAllocation no_allocation;
ASSERT(context->IsNativeContext());
Isolate* isolate = context->GetIsolate();
Object* undefined = isolate->heap()->undefined_value();
Zone* zone = isolate->runtime_zone();
- ZoneScope zone_scope(zone, DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone);
ZoneList<Code*> codes(1, zone);
DeoptimizeWithMatchingCodeFilter filter(code);
PartitionOptimizedFunctions(context, &filter, &codes, zone, undefined);
Isolate* isolate = context->GetIsolate();
Object* undefined = isolate->heap()->undefined_value();
Zone* zone = isolate->runtime_zone();
- ZoneScope zone_scope(zone, DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone);
ZoneList<Code*> codes(1, zone);
PartitionOptimizedFunctions(context, filter, &codes, zone, undefined);
for (int i = 0; i < codes.length(); ++i) {
static JITCodeEntry* CreateELFObject(CodeDescription* desc, Zone* zone) {
- ZoneScope zone_scope(zone, DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone);
#ifdef __MACH_O
MachO mach_o;
Writer w(&mach_o);
HGraph* graph)
: graph_(graph),
zone_(graph->isolate()),
- zone_scope_(&zone_, DELETE_ON_EXIT),
+ zone_scope_(&zone_),
block_count_(graph->blocks()->length()),
maximum_environment_size_(graph->maximum_environment_size()),
collect_markers_(true),
info_(info),
removed_side_effects_(false),
phase_zone_(info->phase_zone()),
- phase_zone_scope_(phase_zone_, DELETE_ON_EXIT),
+ phase_zone_scope_(phase_zone_),
block_side_effects_(graph->blocks()->length(), phase_zone_),
loop_side_effects_(graph->blocks()->length(), phase_zone_),
visited_on_paths_(phase_zone_, graph->blocks()->length()) {
Handle<JSObject> json_object =
factory()->NewJSObject(object_constructor(), pretenure_);
Handle<Map> map(json_object->map());
- ZoneScope zone_scope(zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone());
ZoneList<Handle<Object> > properties(8, zone());
ASSERT_EQ(c0_, '{');
template <bool seq_ascii>
Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() {
HandleScope scope(isolate());
- ZoneScope zone_scope(zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone());
ZoneList<Handle<Object> > elements(4, zone());
ASSERT_EQ(c0_, '[');
Handle<String> pattern,
Handle<String> flag_str,
Zone* zone) {
- ZoneScope zone_scope(zone, DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone);
Isolate* isolate = re->GetIsolate();
JSRegExp::Flags flags = RegExpFlagsFromString(flag_str);
CompilationCache* compilation_cache = isolate->compilation_cache();
bool is_ascii) {
// Compile the RegExp.
Isolate* isolate = re->GetIsolate();
- ZoneScope zone_scope(isolate->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(isolate->runtime_zone());
PostponeInterruptsScope postpone(isolate);
// If we had a compilation error the last time this is saved at the
// saved code index.
TARGET& target, bool do_drop, Zone* zone) {
Isolate* isolate = Isolate::Current();
Debug* debug = isolate->debug();
- ZoneScope scope(zone, DELETE_ON_EXIT);
+ ZoneScope scope(zone);
Vector<StackFrame*> frames = CreateStackMap(isolate, zone);
ASSERT(replacement->IsFlat());
Zone* zone = isolate->runtime_zone();
- ZoneScope zone_space(zone, DELETE_ON_EXIT);
+ ZoneScope zone_space(zone);
ZoneList<int> indices(8, zone);
ASSERT_EQ(JSRegExp::ATOM, pattern_regexp->TypeTag());
String* pattern =
// CompiledReplacement uses zone allocation.
Zone* zone = isolate->runtime_zone();
- ZoneScope zonescope(zone, DELETE_ON_EXIT);
+ ZoneScope zonescope(zone);
CompiledReplacement compiled_replacement(zone);
bool simple_replace = compiled_replacement.Compile(replacement,
capture_count,
int capture_count = regexp->CaptureCount();
Zone* zone = isolate->runtime_zone();
- ZoneScope zone_space(zone, DELETE_ON_EXIT);
+ ZoneScope zone_space(zone);
ZoneList<int> offsets(8, zone);
while (true) {
static const int kMaxInitialListCapacity = 16;
Zone* zone = isolate->runtime_zone();
- ZoneScope scope(zone, DELETE_ON_EXIT);
+ ZoneScope scope(zone);
// Find (up to limit) indices of separator and end-of-string in subject
int initial_capacity = Min<uint32_t>(kMaxInitialListCapacity, limit);
}
-ZoneScope::ZoneScope(Zone* zone, ZoneScopeMode mode)
- : zone_(zone), mode_(mode) {
+ZoneScope::ZoneScope(Zone* zone)
+ : zone_(zone) {
zone_->scope_nesting_++;
}
bool ZoneScope::ShouldDeleteOnExit() {
- return zone_->scope_nesting_ == 1 && mode_ == DELETE_ON_EXIT;
+ return zone_->scope_nesting_ == 1;
}
namespace internal {
-// Zone scopes are in one of two modes. Either they delete the zone
-// on exit or they do not.
-enum ZoneScopeMode {
- DELETE_ON_EXIT,
- DONT_DELETE_ON_EXIT
-};
-
class Segment;
class Isolate;
// outer-most scope.
class ZoneScope BASE_EMBEDDED {
public:
- INLINE(ZoneScope(Zone* zone, ZoneScopeMode mode));
+ INLINE(ZoneScope(Zone* zone));
virtual ~ZoneScope();
inline bool ShouldDeleteOnExit();
- // For ZoneScopes that do not delete on exit by default, call this
- // method to request deletion on exit.
- void DeleteOnExit() {
- mode_ = DELETE_ON_EXIT;
- }
-
inline static int nesting();
private:
Zone* zone_;
- ZoneScopeMode mode_;
};
Isolate* isolate = Isolate::Current();
Zone* zone = isolate->runtime_zone();
- ZoneScope zone_scope(zone, DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone);
AstNodeFactory<AstNullVisitor> factory(isolate, zone);
AstNode* node = factory.NewEmptyStatement();
list->Add(node);
TEST(BitVector) {
v8::internal::V8::Initialize(NULL);
Zone* zone = Isolate::Current()->runtime_zone();
- ZoneScope zone_scope(zone, DELETE_ON_EXIT);
+ ZoneScope zone_scope(zone);
{
BitVector v(15, zone);
v.Add(1);
int expected_diff_parameter = -1) {
StringCompareInput input(s1, s2);
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
DiffChunkStruct* first_chunk;
ListDiffOutputWriter writer(&first_chunk);
static bool CheckParse(const char* input) {
V8::Initialize(NULL);
v8::HandleScope scope(v8::Isolate::GetCurrent());
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
FlatStringReader reader(Isolate::Current(), CStrVector(input));
RegExpCompileData result;
return v8::internal::RegExpParser::ParseRegExp(
static SmartArrayPointer<const char> Parse(const char* input) {
V8::Initialize(NULL);
v8::HandleScope scope(v8::Isolate::GetCurrent());
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
FlatStringReader reader(Isolate::Current(), CStrVector(input));
RegExpCompileData result;
CHECK(v8::internal::RegExpParser::ParseRegExp(
static bool CheckSimple(const char* input) {
V8::Initialize(NULL);
v8::HandleScope scope(v8::Isolate::GetCurrent());
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
FlatStringReader reader(Isolate::Current(), CStrVector(input));
RegExpCompileData result;
CHECK(v8::internal::RegExpParser::ParseRegExp(
static MinMaxPair CheckMinMaxMatch(const char* input) {
V8::Initialize(NULL);
v8::HandleScope scope(v8::Isolate::GetCurrent());
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
FlatStringReader reader(Isolate::Current(), CStrVector(input));
RegExpCompileData result;
CHECK(v8::internal::RegExpParser::ParseRegExp(
const char* expected) {
V8::Initialize(NULL);
v8::HandleScope scope(v8::Isolate::GetCurrent());
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
FlatStringReader reader(Isolate::Current(), CStrVector(input));
RegExpCompileData result;
CHECK(!v8::internal::RegExpParser::ParseRegExp(
static void TestCharacterClassEscapes(uc16 c, bool (pred)(uc16 c)) {
- ZoneScope scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope scope(Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
ZoneList<CharacterRange>* ranges =
new(zone) ZoneList<CharacterRange>(2, zone);
bool is_ascii,
bool dot_output = false) {
v8::HandleScope scope(v8::Isolate::GetCurrent());
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
RegExpNode* node = Compile(input, multiline, is_ascii);
USE(node);
#ifdef DEBUG
TEST(SplayTreeSimple) {
v8::internal::V8::Initialize(NULL);
static const unsigned kLimit = 1000;
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
ZoneSplayTree<TestConfig> tree(Isolate::Current()->runtime_zone());
bool seen[kLimit];
for (unsigned i = 0; i < kLimit; i++) seen[i] = false;
}
}
// Enter test data into dispatch table.
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
DispatchTable table(Isolate::Current()->runtime_zone());
for (int i = 0; i < kRangeCount; i++) {
uc16* range = ranges[i];
ContextInitializer()
: scope_(v8::Isolate::GetCurrent()),
env_(v8::Context::New(v8::Isolate::GetCurrent())),
- zone_(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT) {
+ zone_(Isolate::Current()->runtime_zone()) {
env_->Enter();
}
~ContextInitializer() {
static const int kLimit = 1000;
static const int kRangeCount = 16;
for (int t = 0; t < 10; t++) {
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
ZoneList<CharacterRange>* ranges =
new(zone)
CHECK_EQ(is_on, set->Get(0) == false);
}
}
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
ZoneList<CharacterRange>* ranges =
new(zone) ZoneList<CharacterRange>(1, zone);
static void TestRangeCaseIndependence(CharacterRange input,
Vector<CharacterRange> expected) {
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
int count = expected.length();
ZoneList<CharacterRange>* list =
TEST(CharClassDifference) {
v8::internal::V8::Initialize(NULL);
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
ZoneList<CharacterRange>* base =
new(zone) ZoneList<CharacterRange>(1, zone);
TEST(CanonicalizeCharacterSets) {
v8::internal::V8::Initialize(NULL);
- ZoneScope scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope scope(Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
ZoneList<CharacterRange>* list =
new(zone) ZoneList<CharacterRange>(4, zone);
TEST(CharacterRangeMerge) {
v8::internal::V8::Initialize(NULL);
- ZoneScope zone_scope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone_scope(Isolate::Current()->runtime_zone());
ZoneList<CharacterRange> l1(4, Isolate::Current()->runtime_zone());
ZoneList<CharacterRange> l2(4, Isolate::Current()->runtime_zone());
Zone* zone = Isolate::Current()->runtime_zone();
printf("TestTraverse\n");
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
- ZoneScope zone(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone(Isolate::Current()->runtime_zone());
ConsStringGenerationData data(false);
Handle<String> flat = ConstructBalanced(&data);
FlattenString(flat);
CcTest::InitializeVM();
Isolate* isolate = Isolate::Current();
HandleScope outer_scope(isolate);
- ZoneScope zone(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone(Isolate::Current()->runtime_zone());
ConsStringGenerationData data(true);
for (int i = 0; i < test_cases; i++) {
printf("%d\n", i);
TEST(ExternalShortStringAdd) {
- ZoneScope zonescope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zonescope(Isolate::Current()->runtime_zone());
CcTest::InitializeVM();
v8::HandleScope handle_scope(CcTest::isolate());
// values didn't fit in the hash field.
// See http://code.google.com/p/v8/issues/detail?id=728
Isolate* isolate = Isolate::Current();
- ZoneScope zone(isolate->runtime_zone(), DELETE_ON_EXIT);
+ ZoneScope zone(isolate->runtime_zone());
CcTest::InitializeVM();
v8::HandleScope handle_scope(CcTest::isolate());