Commit b1667fca authored by dcarney's avatar dcarney Committed by Commit bot

don't use to-be-deprecated Value::To* without isolate parameter

R=svenpanne@chromium.org

BUG=

Review URL: https://codereview.chromium.org/725293003

Cr-Commit-Position: refs/heads/master@{#25473}
parent c1bfc348
......@@ -25,7 +25,8 @@ static void AssertInlineCount(const v8::FunctionCallbackInfo<v8::Value>& args) {
frames_seen++;
it.Advance();
}
CHECK_EQ(args[0]->ToInt32()->Value(), topmost->GetInlineCount());
CHECK_EQ(args[0]->ToInt32(args.GetIsolate())->Value(),
topmost->GetInlineCount());
}
......
This diff is collapsed.
......@@ -621,7 +621,7 @@ static void DebugEventBreakPointHitCount(
last_function_hit[0] = '\0';
} else {
CHECK(result->IsString());
v8::Handle<v8::String> function_name(result->ToString());
v8::Handle<v8::String> function_name(result.As<v8::String>());
function_name->WriteUtf8(last_function_hit);
}
}
......@@ -656,7 +656,7 @@ static void DebugEventBreakPointHitCount(
last_script_name_hit[0] = '\0';
} else {
CHECK(result->IsString());
v8::Handle<v8::String> script_name(result->ToString());
v8::Handle<v8::String> script_name(result.As<v8::String>());
script_name->WriteUtf8(last_script_name_hit);
}
}
......@@ -775,7 +775,7 @@ static void DebugEventEvaluate(
v8::Handle<v8::Value> result =
evaluate_check_function->Call(exec_state, argc, argv);
if (!result->IsTrue()) {
v8::String::Utf8Value utf8(checks[i].expected->ToString());
v8::String::Utf8Value utf8(checks[i].expected);
V8_Fatal(__FILE__, __LINE__, "%s != %s", checks[i].expr, *utf8);
}
}
......@@ -849,7 +849,7 @@ static void DebugEventStepSequence(
v8::Handle<v8::Value> result = frame_function_name->Call(exec_state,
argc, argv);
CHECK(result->IsString());
v8::String::Utf8Value function_name(result->ToString());
v8::String::Utf8Value function_name(result->ToString(CcTest::isolate()));
CHECK_EQ(1, StrLength(*function_name));
CHECK_EQ((*function_name)[0],
expected_step_sequence[break_point_hit_count]);
......@@ -6159,7 +6159,8 @@ static void DebugEventDebugBreak(
last_function_hit[0] = '\0';
} else {
CHECK(result->IsString());
v8::Handle<v8::String> function_name(result->ToString());
v8::Handle<v8::String> function_name(
result->ToString(CcTest::isolate()));
function_name->WriteUtf8(last_function_hit);
}
}
......@@ -7042,7 +7043,8 @@ static void DebugEventBreakDeoptimize(
if (!result->IsUndefined()) {
char fn[80];
CHECK(result->IsString());
v8::Handle<v8::String> function_name(result->ToString());
v8::Handle<v8::String> function_name(
result->ToString(CcTest::isolate()));
function_name->WriteUtf8(fn);
if (strcmp(fn, "bar") == 0) {
i::Deoptimizer::DeoptimizeAll(CcTest::i_isolate());
......@@ -7107,12 +7109,12 @@ static void DebugEventBreakWithOptimizedStack(
v8::Handle<v8::Value> result =
frame_function_name->Call(exec_state, argc, argv);
CHECK(result->IsString());
v8::Handle<v8::String> function_name(result->ToString());
v8::Handle<v8::String> function_name(result->ToString(isolate));
CHECK(function_name->Equals(v8::String::NewFromUtf8(isolate, "loop")));
// Get the name of the first argument in frame i.
result = frame_argument_name->Call(exec_state, argc, argv);
CHECK(result->IsString());
v8::Handle<v8::String> argument_name(result->ToString());
v8::Handle<v8::String> argument_name(result->ToString(isolate));
CHECK(argument_name->Equals(v8::String::NewFromUtf8(isolate, "count")));
// Get the value of the first argument in frame i. If the
// funtion is optimized the value will be undefined, otherwise
......@@ -7125,7 +7127,7 @@ static void DebugEventBreakWithOptimizedStack(
// Get the name of the first local variable.
result = frame_local_name->Call(exec_state, argc, argv);
CHECK(result->IsString());
v8::Handle<v8::String> local_name(result->ToString());
v8::Handle<v8::String> local_name(result->ToString(isolate));
CHECK(local_name->Equals(v8::String::NewFromUtf8(isolate, "local")));
// Get the value of the first local variable. If the function
// is optimized the value will be undefined, otherwise it will
......
......@@ -890,9 +890,10 @@ class OneByteResource : public v8::String::ExternalOneByteStringResource {
} // namespace
TEST(HeapSnapshotJSONSerialization) {
v8::Isolate* isolate = CcTest::isolate();
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
v8::HandleScope scope(isolate);
v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler();
#define STRING_LITERAL_FOR_TEST \
"\"String \\n\\r\\u0008\\u0081\\u0101\\u0801\\u8001\""
......@@ -923,7 +924,7 @@ TEST(HeapSnapshotJSONSerialization) {
// Verify that snapshot object has required fields.
v8::Local<v8::Object> parsed_snapshot =
env->Global()->Get(v8_str("parsed"))->ToObject();
env->Global()->Get(v8_str("parsed"))->ToObject(isolate);
CHECK(parsed_snapshot->Has(v8_str("snapshot")));
CHECK(parsed_snapshot->Has(v8_str("nodes")));
CHECK(parsed_snapshot->Has(v8_str("edges")));
......@@ -979,17 +980,18 @@ TEST(HeapSnapshotJSONSerialization) {
" \"s\", property_type)");
CHECK(!string_obj_pos_val.IsEmpty());
int string_obj_pos =
static_cast<int>(string_obj_pos_val->ToNumber()->Value());
static_cast<int>(string_obj_pos_val->ToNumber(isolate)->Value());
v8::Local<v8::Object> nodes_array =
parsed_snapshot->Get(v8_str("nodes"))->ToObject();
parsed_snapshot->Get(v8_str("nodes"))->ToObject(isolate);
int string_index = static_cast<int>(
nodes_array->Get(string_obj_pos + 1)->ToNumber()->Value());
nodes_array->Get(string_obj_pos + 1)->ToNumber(isolate)->Value());
CHECK_GT(string_index, 0);
v8::Local<v8::Object> strings_array =
parsed_snapshot->Get(v8_str("strings"))->ToObject();
v8::Local<v8::String> string = strings_array->Get(string_index)->ToString();
parsed_snapshot->Get(v8_str("strings"))->ToObject(isolate);
v8::Local<v8::String> string =
strings_array->Get(string_index)->ToString(isolate);
v8::Local<v8::String> ref_string =
CompileRun(STRING_LITERAL_FOR_TEST)->ToString();
CompileRun(STRING_LITERAL_FOR_TEST)->ToString(isolate);
#undef STRING_LITERAL_FOR_TEST
CHECK_EQ(*v8::String::Utf8Value(ref_string),
*v8::String::Utf8Value(string));
......@@ -1949,9 +1951,10 @@ TEST(SlowCaseAccessors) {
TEST(HiddenPropertiesFastCase) {
v8::Isolate* isolate = CcTest::isolate();
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
v8::HandleScope scope(isolate);
v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler();
CompileRun(
"function C(x) { this.a = this; this.b = x; }\n"
......@@ -1970,7 +1973,7 @@ TEST(HiddenPropertiesFastCase) {
v8::Handle<v8::Value> cHandle =
env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "c"));
CHECK(!cHandle.IsEmpty() && cHandle->IsObject());
cHandle->ToObject()->SetHiddenValue(v8_str("key"), v8_str("val"));
cHandle->ToObject(isolate)->SetHiddenValue(v8_str("key"), v8_str("val"));
snapshot = heap_profiler->TakeHeapSnapshot(
v8_str("HiddenPropertiesFastCase2"));
......
......@@ -2338,7 +2338,8 @@ TEST(OptimizedAllocationAlwaysInNewSpace) {
"f(1); f(2); f(3);"
"%OptimizeFunctionOnNextCall(f);"
"f(4);");
CHECK_EQ(4, res->ToObject()->GetRealNamedProperty(v8_str("x"))->Int32Value());
CHECK_EQ(
4, res.As<v8::Object>()->GetRealNamedProperty(v8_str("x"))->Int32Value());
Handle<JSObject> o =
v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
......@@ -4297,7 +4298,7 @@ void CheckWeakness(const char* source) {
v8::Persistent<v8::Object> garbage;
{
v8::HandleScope scope(isolate);
garbage.Reset(isolate, CompileRun(source)->ToObject());
garbage.Reset(isolate, CompileRun(source)->ToObject(isolate));
}
weak_ic_cleared = false;
garbage.SetWeak(static_cast<void*>(&garbage), &ClearWeakIC);
......@@ -4542,7 +4543,7 @@ TEST(Regress357137) {
"eval('function f() {' + locals + 'return function() { return v0; }; }');"
"interrupt();" // This triggers a fake stack overflow in f.
"f()()");
CHECK_EQ(42.0, result->ToNumber()->Value());
CHECK_EQ(42.0, result->ToNumber(isolate)->Value());
}
......
......@@ -496,7 +496,7 @@ TEST(EquivalenceOfLoggingAndTraversal) {
}
// The result either be a "true" literal or problem description.
if (!result->IsTrue()) {
v8::Local<v8::String> s = result->ToString();
v8::Local<v8::String> s = result->ToString(isolate);
i::ScopedVector<char> data(s->Utf8Length() + 1);
CHECK_NE(NULL, data.start());
s->WriteUtf8(data.start());
......
......@@ -946,12 +946,15 @@ TEST(SerializeToplevelThreeBigStrings) {
CHECK_EQ(600000 + 700000, CompileRun("(a + b).length")->Int32Value());
CHECK_EQ(500000 + 600000, CompileRun("(b + c).length")->Int32Value());
Heap* heap = isolate->heap();
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("a")->ToString()),
OLD_DATA_SPACE));
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("b")->ToString()),
OLD_DATA_SPACE));
CHECK(heap->InSpace(*v8::Utils::OpenHandle(*CompileRun("c")->ToString()),
OLD_DATA_SPACE));
CHECK(heap->InSpace(
*v8::Utils::OpenHandle(*CompileRun("a")->ToString(CcTest::isolate())),
OLD_DATA_SPACE));
CHECK(heap->InSpace(
*v8::Utils::OpenHandle(*CompileRun("b")->ToString(CcTest::isolate())),
OLD_DATA_SPACE));
CHECK(heap->InSpace(
*v8::Utils::OpenHandle(*CompileRun("c")->ToString(CcTest::isolate())),
OLD_DATA_SPACE));
delete cache;
source_a.Dispose();
......@@ -1208,7 +1211,7 @@ TEST(SerializeToplevelIsolates) {
buffer, data->length, v8::ScriptCompiler::CachedData::BufferOwned);
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
CHECK(result->ToString()->Equals(v8_str("abcdef")));
CHECK(result->ToString(isolate1)->Equals(v8_str("abcdef")));
}
isolate1->Dispose();
......@@ -1233,7 +1236,7 @@ TEST(SerializeToplevelIsolates) {
}
CHECK(!cache->rejected);
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
CHECK(result->ToString()->Equals(v8_str("abcdef")));
CHECK(result->ToString(isolate2)->Equals(v8_str("abcdef")));
}
DCHECK(toplevel_test_code_event_found);
isolate2->Dispose();
......@@ -1274,7 +1277,7 @@ TEST(SerializeWithHarmonyScoping) {
buffer, data->length, v8::ScriptCompiler::CachedData::BufferOwned);
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
CHECK(result->ToString()->Equals(v8_str("XY")));
CHECK(result->ToString(isolate1)->Equals(v8_str("XY")));
}
isolate1->Dispose();
......@@ -1299,7 +1302,7 @@ TEST(SerializeWithHarmonyScoping) {
isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache);
}
v8::Local<v8::Value> result = script->BindToCurrentContext()->Run();
CHECK(result->ToString()->Equals(v8_str("XY")));
CHECK(result->ToString(isolate2)->Equals(v8_str("XY")));
}
isolate2->Dispose();
}
......@@ -1020,11 +1020,12 @@ TEST(JSONStringifySliceMadeExternal) {
// into a two-byte external string. Check that JSON.stringify works.
v8::HandleScope handle_scope(CcTest::isolate());
v8::Handle<v8::String> underlying =
CompileRun("var underlying = 'abcdefghijklmnopqrstuvwxyz';"
"underlying")->ToString();
v8::Handle<v8::String> slice =
CompileRun("var slice = underlying.slice(1);"
"slice")->ToString();
CompileRun(
"var underlying = 'abcdefghijklmnopqrstuvwxyz';"
"underlying")->ToString(CcTest::isolate());
v8::Handle<v8::String> slice = CompileRun(
"var slice = underlying.slice(1);"
"slice")->ToString(CcTest::isolate());
CHECK(v8::Utils::OpenHandle(*slice)->IsSlicedString());
CHECK(v8::Utils::OpenHandle(*underlying)->IsSeqOneByteString());
......@@ -1082,7 +1083,7 @@ TEST(CachedHashOverflow) {
CHECK_EQ(results[i]->IsNumber(), result->IsNumber());
if (result->IsNumber()) {
CHECK_EQ(Object::ToSmi(isolate, results[i]).ToHandleChecked()->value(),
result->ToInt32()->Value());
result->ToInt32(CcTest::isolate())->Value());
}
}
}
......@@ -1313,7 +1314,7 @@ TEST(CountBreakIterator) {
" return iterator.next();"
"})();");
CHECK(result->IsNumber());
int uses = result->ToInt32()->Value() == 0 ? 0 : 1;
int uses = result->ToInt32(CcTest::isolate())->Value() == 0 ? 0 : 1;
CHECK_EQ(uses, use_counts[v8::Isolate::kBreakIterator]);
// Make sure GC cleans up the break iterator, so we don't get a memory leak
// reported by ASAN.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment