Commit c1da40c0 authored by jochen@chromium.org's avatar jochen@chromium.org

Mark deprecated APIs with relatively little use as deprecated

BUG=none
R=svenpanne@chromium.org
LOG=n

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18114 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e943623b
......@@ -1240,8 +1240,8 @@ class V8_EXPORT Message {
// TODO(1245381): Print to a string instead of on a FILE.
static void PrintCurrentStackTrace(Isolate* isolate, FILE* out);
// Will be deprecated soon.
static void PrintCurrentStackTrace(FILE* out);
V8_DEPRECATED("Will be removed",
static void PrintCurrentStackTrace(FILE* out));
static const int kNoLineNumberInfo = 0;
static const int kNoColumnInfo = 0;
......@@ -1299,10 +1299,9 @@ class V8_EXPORT StackTrace {
Isolate* isolate,
int frame_limit,
StackTraceOptions options = kOverview);
// Will be deprecated soon.
static Local<StackTrace> CurrentStackTrace(
int frame_limit,
StackTraceOptions options = kOverview);
V8_DEPRECATED("Will be removed",
static Local<StackTrace> CurrentStackTrace(
int frame_limit, StackTraceOptions options = kOverview));
};
......@@ -1634,8 +1633,8 @@ class V8_EXPORT Boolean : public Primitive {
public:
bool Value() const;
V8_INLINE static Handle<Boolean> New(Isolate* isolate, bool value);
// Will be deprecated soon.
V8_INLINE static Handle<Boolean> New(bool value);
V8_DEPRECATED("Will be removed",
V8_INLINE static Handle<Boolean> New(bool value));
};
......@@ -1905,8 +1904,8 @@ class V8_EXPORT String : public Primitive {
*/
static Local<String> NewExternal(Isolate* isolate,
ExternalStringResource* resource);
// Will be deprecated soon.
static Local<String> NewExternal(ExternalStringResource* resource);
V8_DEPRECATED("Will be removed", static Local<String> NewExternal(
ExternalStringResource* resource));
/**
* Associate an external string resource with this string by transforming it
......@@ -1929,8 +1928,8 @@ class V8_EXPORT String : public Primitive {
*/
static Local<String> NewExternal(Isolate* isolate,
ExternalAsciiStringResource* resource);
// Will be deprecated soon.
static Local<String> NewExternal(ExternalAsciiStringResource* resource);
V8_DEPRECATED("Will be removed", static Local<String> NewExternal(
ExternalAsciiStringResource* resource));
/**
* Associate an external string resource with this string by transforming it
......@@ -2488,8 +2487,7 @@ class V8_EXPORT Array : public Object {
* is negative the returned array will have length 0.
*/
static Local<Array> New(Isolate* isolate, int length = 0);
// Will be deprecated soon.
static Local<Array> New(int length = 0);
V8_DEPRECATED("Will be removed", static Local<Array> New(int length = 0));
V8_INLINE static Array* Cast(Value* obj);
private:
......@@ -2753,8 +2751,8 @@ class V8_EXPORT ArrayBuffer : public Object {
* unless the object is externalized.
*/
static Local<ArrayBuffer> New(Isolate* isolate, size_t byte_length);
// Will be deprecated soon.
static Local<ArrayBuffer> New(size_t byte_length);
V8_DEPRECATED("Will be removed",
static Local<ArrayBuffer> New(size_t byte_length));
/**
* Create a new ArrayBuffer over an existing memory block.
......@@ -2764,8 +2762,8 @@ class V8_EXPORT ArrayBuffer : public Object {
*/
static Local<ArrayBuffer> New(Isolate* isolate, void* data,
size_t byte_length);
// Will be deprecated soon.
static Local<ArrayBuffer> New(void* data, size_t byte_length);
V8_DEPRECATED("Will be removed",
static Local<ArrayBuffer> New(void* data, size_t byte_length));
/**
* Returns true if ArrayBuffer is extrenalized, that is, does not
......@@ -3026,8 +3024,7 @@ class V8_EXPORT DataView : public ArrayBufferView {
class V8_EXPORT Date : public Object {
public:
static Local<Value> New(Isolate* isolate, double time);
// Will be deprecated soon.
static Local<Value> New(double time);
V8_DEPRECATED("Will be removed", static Local<Value> New(double time));
V8_DEPRECATED(
"Use ValueOf instead",
......@@ -3054,8 +3051,8 @@ class V8_EXPORT Date : public Object {
* negatively impact the performance of date operations.
*/
static void DateTimeConfigurationChangeNotification(Isolate* isolate);
// Will be deprecated soon.
static void DateTimeConfigurationChangeNotification();
V8_DEPRECATED("Will be removed",
static void DateTimeConfigurationChangeNotification());
private:
static void CheckCast(v8::Value* obj);
......@@ -3068,8 +3065,7 @@ class V8_EXPORT Date : public Object {
class V8_EXPORT NumberObject : public Object {
public:
static Local<Value> New(Isolate* isolate, double value);
// Will be deprecated soon.
static Local<Value> New(double value);
V8_DEPRECATED("Will be removed", static Local<Value> New(double value));
V8_DEPRECATED(
"Use ValueOf instead",
......@@ -3231,8 +3227,8 @@ class V8_EXPORT Template : public Data {
void Set(Handle<String> name, Handle<Data> value,
PropertyAttribute attributes = None);
V8_INLINE void Set(Isolate* isolate, const char* name, Handle<Data> value);
// Will be deprecated soon.
V8_INLINE void Set(const char* name, Handle<Data> value);
V8_DEPRECATED("Will be removed",
V8_INLINE void Set(const char* name, Handle<Data> value));
void SetAccessorProperty(
Local<String> name,
......@@ -3768,11 +3764,13 @@ class V8_EXPORT Signature : public Data {
Handle<FunctionTemplate>(),
int argc = 0,
Handle<FunctionTemplate> argv[] = 0);
// Will be deprecated soon.
static Local<Signature> New(Handle<FunctionTemplate> receiver =
Handle<FunctionTemplate>(),
int argc = 0,
Handle<FunctionTemplate> argv[] = 0);
V8_DEPRECATED("Will be removed",
static Local<Signature> New(Handle<FunctionTemplate> receiver =
Handle<FunctionTemplate>(),
int argc = 0,
Handle<FunctionTemplate> argv[] =
0));
private:
Signature();
};
......@@ -3787,9 +3785,9 @@ class V8_EXPORT AccessorSignature : public Data {
static Local<AccessorSignature> New(Isolate* isolate,
Handle<FunctionTemplate> receiver =
Handle<FunctionTemplate>());
// Will be deprecated soon.
static Local<AccessorSignature> New(Handle<FunctionTemplate> receiver =
Handle<FunctionTemplate>());
V8_DEPRECATED("Will be removed", static Local<AccessorSignature> New(
Handle<FunctionTemplate> receiver =
Handle<FunctionTemplate>()));
private:
AccessorSignature();
......@@ -3896,11 +3894,16 @@ class V8_EXPORT Extension { // NOLINT
virtual ~Extension() { }
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Handle<v8::String> name) {
#if defined(V8_DEPRECATION_WARNINGS)
return v8::Handle<v8::FunctionTemplate>();
#else
return GetNativeFunction(name);
#endif
}
// Will be deprecated soon.
virtual v8::Handle<v8::FunctionTemplate>
GetNativeFunction(v8::Handle<v8::String> name) {
V8_DEPRECATED("Will be removed",
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
v8::Handle<v8::String> name)) {
return v8::Handle<v8::FunctionTemplate>();
}
......@@ -3948,11 +3951,10 @@ V8_INLINE Handle<Primitive> Null(Isolate* isolate);
V8_INLINE Handle<Boolean> True(Isolate* isolate);
V8_INLINE Handle<Boolean> False(Isolate* isolate);
// Will be removed soon.
Handle<Primitive> V8_EXPORT Undefined();
Handle<Primitive> V8_EXPORT Null();
Handle<Boolean> V8_EXPORT True();
Handle<Boolean> V8_EXPORT False();
V8_DEPRECATED("Will be removed", Handle<Primitive> V8_EXPORT Undefined());
V8_DEPRECATED("Will be removed", Handle<Primitive> V8_EXPORT Null());
V8_DEPRECATED("Will be removed", Handle<Boolean> V8_EXPORT True());
V8_DEPRECATED("Will be removed", Handle<Boolean> V8_EXPORT False());
/**
......
......@@ -2627,7 +2627,8 @@ Genesis::Genesis(Isolate* isolate,
isolate->random_number_generator()->NextBytes(state, num_bytes);
} while (state[0] == 0 || state[1] == 0);
v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(state, num_bytes);
v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(
reinterpret_cast<v8::Isolate*>(isolate), state, num_bytes);
Utils::OpenHandle(*buffer)->set_should_be_freed(true);
v8::Local<v8::Uint32Array> ta = v8::Uint32Array::New(buffer, 0, num_elems);
Handle<JSBuiltinsObject> builtins(native_context()->builtins());
......@@ -2640,8 +2641,10 @@ Genesis::Genesis(Isolate* isolate,
// Initialize trigonometric lookup tables and constants.
const int table_num_bytes = TrigonometricLookupTable::table_num_bytes();
v8::Local<v8::ArrayBuffer> sin_buffer = v8::ArrayBuffer::New(
reinterpret_cast<v8::Isolate*>(isolate),
TrigonometricLookupTable::sin_table(), table_num_bytes);
v8::Local<v8::ArrayBuffer> cos_buffer = v8::ArrayBuffer::New(
reinterpret_cast<v8::Isolate*>(isolate),
TrigonometricLookupTable::cos_x_interval_table(), table_num_bytes);
v8::Local<v8::Float64Array> sin_table = v8::Float64Array::New(
sin_buffer, 0, TrigonometricLookupTable::table_size());
......
......@@ -470,7 +470,7 @@ void Shell::System(const v8::FunctionCallbackInfo<v8::Value>& args) {
}
command_args = Handle<Array>::Cast(args[1]);
} else {
command_args = Array::New(0);
command_args = Array::New(args.GetIsolate(), 0);
}
if (command_args->Length() > ExecArgs::kMaxArgs) {
args.GetIsolate()->ThrowException(String::NewFromUtf8(
......
......@@ -1126,7 +1126,7 @@ void Shell::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args) {
Throw(args.GetIsolate(), "Error reading file");
return;
}
Handle<v8::ArrayBuffer> buffer = ArrayBuffer::New(data, length);
Handle<v8::ArrayBuffer> buffer = ArrayBuffer::New(isolate, data, length);
v8::Persistent<v8::ArrayBuffer> weak_handle(isolate, buffer);
weak_handle.MakeWeak(data, ReadBufferWeakCallback);
weak_handle.MarkIndependent();
......
......@@ -60,9 +60,9 @@ const char* const ExternalizeStringExtension::kSource =
"native function externalizeString();"
"native function isAsciiString();";
v8::Handle<v8::FunctionTemplate> ExternalizeStringExtension::GetNativeFunction(
v8::Handle<v8::String> str) {
v8::Handle<v8::FunctionTemplate>
ExternalizeStringExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Handle<v8::String> str) {
if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) {
return v8::FunctionTemplate::New(ExternalizeStringExtension::Externalize);
} else {
......
......@@ -36,7 +36,8 @@ namespace internal {
class ExternalizeStringExtension : public v8::Extension {
public:
ExternalizeStringExtension() : v8::Extension("v8/externalize", kSource) {}
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void Externalize(const v8::FunctionCallbackInfo<v8::Value>& args);
static void IsAscii(const v8::FunctionCallbackInfo<v8::Value>& args);
......
......@@ -33,7 +33,8 @@ namespace v8 {
namespace internal {
v8::Handle<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunction(
v8::Handle<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> str) {
return v8::FunctionTemplate::New(FreeBufferExtension::FreeBuffer);
}
......
......@@ -37,7 +37,8 @@ class FreeBufferExtension : public v8::Extension {
public:
explicit FreeBufferExtension(const char* source)
: v8::Extension("v8/free-buffer", source) {}
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void FreeBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Register();
......
......@@ -32,7 +32,8 @@ namespace v8 {
namespace internal {
v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunction(
v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> str) {
return v8::FunctionTemplate::New(GCExtension::GC);
}
......
......@@ -36,7 +36,8 @@ namespace internal {
class GCExtension : public v8::Extension {
public:
explicit GCExtension(const char* source) : v8::Extension("v8/gc", source) {}
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void GC(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Register();
......
......@@ -34,7 +34,8 @@ const char* const StatisticsExtension::kSource =
"native function getV8Statistics();";
v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunction(
v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> str) {
ASSERT(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0);
return v8::FunctionTemplate::New(StatisticsExtension::GetCounters);
......
......@@ -36,7 +36,8 @@ namespace internal {
class StatisticsExtension : public v8::Extension {
public:
StatisticsExtension() : v8::Extension("v8/statistics", kSource) {}
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void GetCounters(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Register();
......
......@@ -460,7 +460,7 @@ THREADED_TEST(Regress1054726) {
static void AllocGetter(Local<String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
ApiTestFuzzer::Fuzz();
info.GetReturnValue().Set(v8::Array::New(1000));
info.GetReturnValue().Set(v8::Array::New(info.GetIsolate(), 1000));
}
......@@ -543,7 +543,7 @@ THREADED_TEST(HandleScopeSegment) {
void JSONStringifyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) {
v8::Handle<v8::Array> array = v8::Array::New(1);
v8::Handle<v8::Array> array = v8::Array::New(info.GetIsolate(), 1);
array->Set(0, v8_str("regress"));
info.GetReturnValue().Set(array);
}
......
This diff is collapsed.
......@@ -548,7 +548,7 @@ TEST(StackAlignmentForSSE2) {
v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
v8::Local<v8::Array> v8_vec = v8::Array::New(ELEMENT_COUNT);
v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
for (int i = 0; i < ELEMENT_COUNT; i++) {
v8_vec->Set(i, v8_num(vec[i]));
}
......
......@@ -628,7 +628,7 @@ TEST(StackAlignmentForSSE2) {
v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
v8::Local<v8::Array> v8_vec = v8::Array::New(ELEMENT_COUNT);
v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
for (int i = 0; i < ELEMENT_COUNT; i++) {
v8_vec->Set(i, v8_num(vec[i]));
}
......
......@@ -45,7 +45,8 @@ using namespace v8::internal;
class PrintExtension : public v8::Extension {
public:
PrintExtension() : v8::Extension("v8/print", kSource) { }
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
private:
......@@ -56,7 +57,8 @@ class PrintExtension : public v8::Extension {
const char* PrintExtension::kSource = "native function print();";
v8::Handle<v8::FunctionTemplate> PrintExtension::GetNativeFunction(
v8::Handle<v8::FunctionTemplate> PrintExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> str) {
return v8::FunctionTemplate::New(PrintExtension::Print);
}
......
......@@ -843,7 +843,8 @@ TEST(NativeMethodUninitializedIC) {
v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor"));
v8::Local<v8::ObjectTemplate> proto_template =
func_template->PrototypeTemplate();
v8::Local<v8::Signature> signature = v8::Signature::New(func_template);
v8::Local<v8::Signature> signature =
v8::Signature::New(env->GetIsolate(), func_template);
proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"),
v8::FunctionTemplate::New(&TestApiCallbacks::Callback,
data, signature, 0));
......@@ -886,7 +887,8 @@ TEST(NativeMethodMonomorphicIC) {
v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor"));
v8::Local<v8::ObjectTemplate> proto_template =
func_template->PrototypeTemplate();
v8::Local<v8::Signature> signature = v8::Signature::New(func_template);
v8::Local<v8::Signature> signature =
v8::Signature::New(env->GetIsolate(), func_template);
proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"),
v8::FunctionTemplate::New(&TestApiCallbacks::Callback,
data, signature, 0));
......
......@@ -2922,7 +2922,7 @@ TEST(DebugStepKeyedLoadLoop) {
"foo");
// Create array [0,1,2,3,4,5,6,7,8,9]
v8::Local<v8::Array> a = v8::Array::New(10);
v8::Local<v8::Array> a = v8::Array::New(env->GetIsolate(), 10);
for (int i = 0; i < 10; i++) {
a->Set(v8::Number::New(i), v8::Number::New(i));
}
......@@ -2969,7 +2969,7 @@ TEST(DebugStepKeyedStoreLoop) {
"foo");
// Create array [0,1,2,3,4,5,6,7,8,9]
v8::Local<v8::Array> a = v8::Array::New(10);
v8::Local<v8::Array> a = v8::Array::New(env->GetIsolate(), 10);
for (int i = 0; i < 10; i++) {
a->Set(v8::Number::New(i), v8::Number::New(i));
}
......@@ -4356,7 +4356,7 @@ TEST(NoBreakWhenBootstrapping) {
static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
v8::Handle<v8::Array> result = v8::Array::New(3);
v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 3);
result->Set(v8::Integer::New(0),
v8::String::NewFromUtf8(info.GetIsolate(), "a"));
result->Set(v8::Integer::New(1),
......@@ -4368,7 +4368,7 @@ static void NamedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) {
v8::Handle<v8::Array> result = v8::Array::New(2);
v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2);
result->Set(v8::Integer::New(0), v8::Number::New(1));
result->Set(v8::Integer::New(1), v8::Number::New(10));
info.GetReturnValue().Set(result);
......@@ -6251,7 +6251,8 @@ TEST(DebugGetLoadedScripts) {
env.ExposeDebug();
EmptyExternalStringResource source_ext_str;
v8::Local<v8::String> source = v8::String::NewExternal(&source_ext_str);
v8::Local<v8::String> source =
v8::String::NewExternal(env->GetIsolate(), &source_ext_str);
v8::Handle<v8::Script> evil_script(v8::Script::Compile(source));
// "use" evil_script to make the compiler happy.
(void) evil_script;
......
......@@ -736,7 +736,8 @@ TEST(HeapSnapshotJSONSerialization) {
// Verify that snapshot string is valid JSON.
AsciiResource json_res(json);
v8::Local<v8::String> json_string = v8::String::NewExternal(&json_res);
v8::Local<v8::String> json_string =
v8::String::NewExternal(env->GetIsolate(), &json_res);
env->Global()->Set(v8_str("json_snapshot"), json_string);
v8::Local<v8::Value> snapshot_parse_result = CompileRun(
"var parsed = JSON.parse(json_snapshot); true;");
......@@ -1004,7 +1005,7 @@ TEST(HeapSnapshotObjectsStats) {
CHECK_EQ(2, stats_update.first_interval_index());
}
v8::Local<v8::Array> array = v8::Array::New();
v8::Local<v8::Array> array = v8::Array::New(env->GetIsolate());
CHECK_EQ(0, array->Length());
// Force array's buffer allocation.
array->Set(2, v8_num(7));
......@@ -2021,7 +2022,8 @@ class HeapProfilerExtension : public v8::Extension {
public:
static const char* kName;
HeapProfilerExtension() : v8::Extension(kName, kSource) { }
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void FindUntrackedObjects(
const v8::FunctionCallbackInfo<v8::Value>& args);
......@@ -2036,10 +2038,10 @@ const char* HeapProfilerExtension::kSource =
"native function findUntrackedObjects();";
v8::Handle<v8::FunctionTemplate> HeapProfilerExtension::GetNativeFunction(
v8::Handle<v8::String> name) {
if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
"findUntrackedObjects"))) {
v8::Handle<v8::FunctionTemplate>
HeapProfilerExtension::GetNativeFunctionTemplate(v8::Isolate* isolate,
v8::Handle<v8::String> name) {
if (name->Equals(v8::String::NewFromUtf8(isolate, "findUntrackedObjects"))) {
return v8::FunctionTemplate::New(
HeapProfilerExtension::FindUntrackedObjects);
} else {
......
......@@ -2977,7 +2977,8 @@ void ReleaseStackTraceDataTest(const char* source, const char* accessor) {
SourceResource* resource = new SourceResource(i::StrDup(source));
{
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::String> source_string = v8::String::NewExternal(resource);
v8::Handle<v8::String> source_string =
v8::String::NewExternal(CcTest::isolate(), resource);
CcTest::heap()->CollectAllAvailableGarbage();
v8::Script::Compile(source_string)->Run();
CHECK(!resource->IsDisposed());
......
......@@ -93,7 +93,8 @@ static void DoTraceHideCEntryFPAddress(Address fp) {
class TraceExtension : public v8::Extension {
public:
TraceExtension() : v8::Extension("v8/trace", kSource) { }
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<String> name);
static void Trace(const v8::FunctionCallbackInfo<v8::Value>& args);
static void JSTrace(const v8::FunctionCallbackInfo<v8::Value>& args);
......@@ -111,18 +112,16 @@ const char* TraceExtension::kSource =
"native function js_entry_sp();"
"native function js_entry_sp_level2();";
v8::Handle<v8::FunctionTemplate> TraceExtension::GetNativeFunction(
v8::Handle<String> name) {
if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(), "trace"))) {
v8::Handle<v8::FunctionTemplate> TraceExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Handle<String> name) {
if (name->Equals(String::NewFromUtf8(isolate, "trace"))) {
return v8::FunctionTemplate::New(TraceExtension::Trace);
} else if (name->Equals(
String::NewFromUtf8(v8::Isolate::GetCurrent(), "js_trace"))) {
String::NewFromUtf8(isolate, "js_trace"))) {
return v8::FunctionTemplate::New(TraceExtension::JSTrace);
} else if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(),
"js_entry_sp"))) {
} else if (name->Equals(String::NewFromUtf8(isolate, "js_entry_sp"))) {
return v8::FunctionTemplate::New(TraceExtension::JSEntrySP);
} else if (name->Equals(String::NewFromUtf8(v8::Isolate::GetCurrent(),
"js_entry_sp_level2"))) {
} else if (name->Equals(String::NewFromUtf8(isolate, "js_entry_sp_level2"))) {
return v8::FunctionTemplate::New(TraceExtension::JSEntrySPLevel2);
} else {
CHECK(false);
......
......@@ -305,7 +305,8 @@ TEST(Issue23768) {
env->Enter();
SimpleExternalString source_ext_str("(function ext() {})();");
v8::Local<v8::String> source = v8::String::NewExternal(&source_ext_str);
v8::Local<v8::String> source =
v8::String::NewExternal(CcTest::isolate(), &source_ext_str);
// Script needs to have a name in order to trigger InitLineEnds execution.
v8::Handle<v8::String> origin =
v8::String::NewFromUtf8(CcTest::isolate(), "issue-23768-test");
......@@ -336,7 +337,8 @@ TEST(LogCallbacks) {
v8::FunctionTemplate::New());
obj->SetClassName(v8_str("Obj"));
v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate();
v8::Local<v8::Signature> signature = v8::Signature::New(obj);
v8::Local<v8::Signature> signature =
v8::Signature::New(CcTest::isolate(), obj);
proto->Set(v8_str("method1"),
v8::FunctionTemplate::New(ObjMethod1,
v8::Handle<v8::Value>(),
......
......@@ -526,7 +526,7 @@ static Handle<Object> CreateAccessCheckedObject(
Handle<Object> instance = tmpl->NewInstance();
Handle<Object> global = instance->CreationContext()->Global();
global->Set(String::NewFromUtf8(isolate, "obj"), instance);
global->Set(kBlockedContextIndex, v8::True());
global->Set(kBlockedContextIndex, v8::True(isolate));
return instance;
}
......@@ -761,8 +761,9 @@ TEST(HiddenPropertiesLeakage) {
"Object.observe(obj, observer);");
Handle<Value> obj =
context->Global()->Get(String::NewFromUtf8(isolate.GetIsolate(), "obj"));
Handle<Object>::Cast(obj)->SetHiddenValue(
String::NewFromUtf8(isolate.GetIsolate(), "foo"), Null());
Handle<Object>::Cast(obj)
->SetHiddenValue(String::NewFromUtf8(isolate.GetIsolate(), "foo"),
Null(isolate.GetIsolate()));
CompileRun(""); // trigger delivery
CHECK(CompileRun("records")->IsNull());
}
......@@ -206,7 +206,8 @@ TEST(Preparsing) {
{
i::FLAG_lazy = true;
ScriptResource* resource = new ScriptResource(source, source_length);
v8::Local<v8::String> script_source = v8::String::NewExternal(resource);
v8::Local<v8::String> script_source =
v8::String::NewExternal(isolate, resource);
v8::Script::Compile(script_source, NULL, preparse);
}
......@@ -214,7 +215,8 @@ TEST(Preparsing) {
i::FLAG_lazy = false;
ScriptResource* resource = new ScriptResource(source, source_length);
v8::Local<v8::String> script_source = v8::String::NewExternal(resource);
v8::Local<v8::String> script_source =
v8::String::NewExternal(isolate, resource);
v8::Script::New(script_source, NULL, preparse, v8::Local<v8::String>());
}
delete preparse;
......
......@@ -541,7 +541,8 @@ TEST(NoSamples) {
class ProfilerExtension : public v8::Extension {
public:
ProfilerExtension() : v8::Extension("v8/profiler", kSource) { }
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void StartProfiling(const v8::FunctionCallbackInfo<v8::Value>& args);
static void StopProfiling(const v8::FunctionCallbackInfo<v8::Value>& args);
......@@ -554,13 +555,11 @@ const char* ProfilerExtension::kSource =
"native function startProfiling();"
"native function stopProfiling();";
v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunction(
v8::Handle<v8::String> name) {
if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
"startProfiling"))) {
v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Handle<v8::String> name) {
if (name->Equals(v8::String::NewFromUtf8(isolate, "startProfiling"))) {
return v8::FunctionTemplate::New(ProfilerExtension::StartProfiling);
} else if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
"stopProfiling"))) {
} else if (name->Equals(v8::String::NewFromUtf8(isolate, "stopProfiling"))) {
return v8::FunctionTemplate::New(ProfilerExtension::StopProfiling);
} else {
CHECK(false);
......
......@@ -943,9 +943,9 @@ TEST(ExternalShortStringAdd) {
// Allocate two JavaScript arrays for holding short strings.
v8::Handle<v8::Array> ascii_external_strings =
v8::Array::New(kMaxLength + 1);
v8::Array::New(CcTest::isolate(), kMaxLength + 1);
v8::Handle<v8::Array> non_ascii_external_strings =
v8::Array::New(kMaxLength + 1);
v8::Array::New(CcTest::isolate(), kMaxLength + 1);
// Generate short ascii and non-ascii external strings.
for (int i = 0; i <= kMaxLength; i++) {
......@@ -958,7 +958,7 @@ TEST(ExternalShortStringAdd) {
AsciiResource* ascii_resource =
new(&zone) AsciiResource(Vector<const char>(ascii, i));
v8::Local<v8::String> ascii_external_string =
v8::String::NewExternal(ascii_resource);
v8::String::NewExternal(CcTest::isolate(), ascii_resource);
ascii_external_strings->Set(v8::Integer::New(i), ascii_external_string);
uc16* non_ascii = zone.NewArray<uc16>(i + 1);
......@@ -969,7 +969,7 @@ TEST(ExternalShortStringAdd) {
// string data.
Resource* resource = new(&zone) Resource(Vector<const uc16>(non_ascii, i));
v8::Local<v8::String> non_ascii_external_string =
v8::String::NewExternal(resource);
v8::String::NewExternal(CcTest::isolate(), resource);
non_ascii_external_strings->Set(v8::Integer::New(i),
non_ascii_external_string);
}
......
......@@ -92,10 +92,12 @@ TEST(WeakArrayBuffersFromApi) {
int start = CountArrayBuffersInWeakList(isolate->heap());
{
v8::HandleScope s1(context->GetIsolate());
v8::Handle<v8::ArrayBuffer> ab1 = v8::ArrayBuffer::New(256);
v8::Handle<v8::ArrayBuffer> ab1 =
v8::ArrayBuffer::New(context->GetIsolate(), 256);
{
v8::HandleScope s2(context->GetIsolate());
v8::Handle<v8::ArrayBuffer> ab2 = v8::ArrayBuffer::New(128);
v8::Handle<v8::ArrayBuffer> ab2 =
v8::ArrayBuffer::New(context->GetIsolate(), 128);
Handle<JSArrayBuffer> iab1 = v8::Utils::OpenHandle(*ab1);
Handle<JSArrayBuffer> iab2 = v8::Utils::OpenHandle(*ab2);
......@@ -186,7 +188,8 @@ void TestViewFromApi() {
Isolate* isolate = GetIsolateFrom(&context);
v8::HandleScope s1(context->GetIsolate());
v8::Handle<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(2048);
v8::Handle<v8::ArrayBuffer> ab =
v8::ArrayBuffer::New(context->GetIsolate(), 2048);
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
{
v8::HandleScope s2(context->GetIsolate());
......
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