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

Unified Diff: test/cctest/test-strings.cc

Issue 12716010: Added a version of the v8::HandleScope constructor with an Isolate and use that consistently. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Feedback. Rebased Created 7 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 | « test/cctest/test-serialize.cc ('k') | test/cctest/test-symbols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 22a830295a70e19bdf5cc5c1af2931f1b98d3a98..f240e931488d66a8fab12cf4eb89ea79097d1cba 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -100,7 +100,6 @@ static v8::Persistent<v8::Context> env;
static void InitializeVM() {
if (env.IsEmpty()) {
- v8::HandleScope scope;
const char* extensions[] = { "v8/print" };
v8::ExtensionConfiguration config(1, extensions);
env = v8::Context::New(&config);
@@ -576,7 +575,7 @@ static void TraverseFirst(Handle<String> s1, Handle<String> s2, int chars) {
TEST(Traverse) {
printf("TestTraverse\n");
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
ZoneScope zone(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
ConsStringGenerationData data(false);
Handle<String> flat = ConstructBalanced(&data);
@@ -865,7 +864,7 @@ static const int DEEP_ASCII_DEPTH = 100000;
TEST(DeepAscii) {
printf("TestDeepAscii\n");
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
char* foo = NewArray<char>(DEEP_ASCII_DEPTH);
for (int i = 0; i < DEEP_ASCII_DEPTH; i++) {
@@ -890,7 +889,7 @@ TEST(DeepAscii) {
TEST(Utf8Conversion) {
// Smoke test for converting strings to utf-8.
InitializeVM();
- v8::HandleScope handle_scope;
+ v8::HandleScope handle_scope(env->GetIsolate());
// A simple ascii string
const char* ascii_string = "abcdef12345";
int len =
@@ -937,7 +936,7 @@ TEST(ExternalShortStringAdd) {
ZoneScope zonescope(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
InitializeVM();
- v8::HandleScope handle_scope;
+ v8::HandleScope handle_scope(env->GetIsolate());
Zone* zone = Isolate::Current()->runtime_zone();
// Make sure we cover all always-flat lengths and at least one above.
@@ -1029,7 +1028,7 @@ TEST(CachedHashOverflow) {
ZoneScope zone(isolate->runtime_zone(), DELETE_ON_EXIT);
InitializeVM();
- v8::HandleScope handle_scope;
+ v8::HandleScope handle_scope(env->GetIsolate());
// Lines must be executed sequentially. Combining them into one script
// makes the bug go away.
const char* lines[] = {
@@ -1072,7 +1071,7 @@ TEST(CachedHashOverflow) {
TEST(SliceFromCons) {
FLAG_string_slices = true;
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
Handle<String> string =
FACTORY->NewStringFromAscii(CStrVector("parentparentparent"));
Handle<String> parent = FACTORY->NewConsString(string, string);
@@ -1104,7 +1103,7 @@ class AsciiVectorResource : public v8::String::ExternalAsciiStringResource {
TEST(SliceFromExternal) {
FLAG_string_slices = true;
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
AsciiVectorResource resource(
i::Vector<const char>("abcdefghijklmnopqrstuvwxyz", 26));
Handle<String> string = FACTORY->NewExternalStringFromAscii(&resource);
@@ -1123,7 +1122,7 @@ TEST(TrivialSlice) {
// actually creates a new string (it should not).
FLAG_string_slices = true;
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
v8::Local<v8::Value> result;
Handle<String> string;
const char* init = "var str = 'abcdefghijklmnopqrstuvwxyz';";
@@ -1152,7 +1151,7 @@ TEST(SliceFromSlice) {
// actually creates a new string (it should not).
FLAG_string_slices = true;
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
v8::Local<v8::Value> result;
Handle<String> string;
const char* init = "var str = 'abcdefghijklmnopqrstuvwxyz';";
@@ -1196,7 +1195,7 @@ TEST(AsciiArrayJoin) {
"for (var i = 1; i <= two_14; i++) a.push(s);"
"a.join("");";
- v8::HandleScope scope;
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
LocalContext context;
v8::V8::IgnoreOutOfMemoryException();
v8::Local<v8::Script> script =
@@ -1220,7 +1219,7 @@ TEST(RobustSubStringStub) {
// If not recognized, those unsafe arguments lead to out-of-bounds reads.
FLAG_allow_natives_syntax = true;
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
v8::Local<v8::Value> result;
Handle<String> string;
CompileRun("var short = 'abcdef';");
@@ -1264,7 +1263,7 @@ TEST(RobustSubStringStub) {
TEST(RegExpOverflow) {
// Result string has the length 2^32, causing a 32-bit integer overflow.
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
LocalContext context;
v8::V8::IgnoreOutOfMemoryException();
v8::Local<v8::Value> result = CompileRun(
@@ -1280,7 +1279,7 @@ TEST(RegExpOverflow) {
TEST(StringReplaceAtomTwoByteResult) {
InitializeVM();
- v8::HandleScope scope;
+ v8::HandleScope scope(env->GetIsolate());
LocalContext context;
v8::Local<v8::Value> result = CompileRun(
"var subject = 'ascii~only~string~'; "
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/cctest/test-symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698