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

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

Issue 17162002: Version 3.19.17. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | « src/x64/stub-cache-x64.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 8f96a4a9d1637784c0cc1175bfb72a6af7a993f3..5d38c211884ccbf82f00d085835caa01dca3e156 100755
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -804,7 +804,7 @@ THREADED_TEST(GlobalProperties) {
template<typename T>
-static void CheckReturnValue(const T& t, i::Address callback) {
+static void CheckReturnValue(const T& t) {
v8::ReturnValue<v8::Value> rv = t.GetReturnValue();
i::Object** o = *reinterpret_cast<i::Object***>(&rv);
CHECK_EQ(v8::Isolate::GetCurrent(), t.GetIsolate());
@@ -817,70 +817,45 @@ static void CheckReturnValue(const T& t, i::Address callback) {
rv.Set(v8::Handle<v8::Object>());
CHECK((*o)->IsTheHole() || (*o)->IsUndefined());
CHECK_EQ(is_runtime, (*o)->IsTheHole());
-
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(t.GetIsolate());
- // If CPU profiler is active check that when API callback is invoked
- // VMState is set to EXTERNAL.
- if (isolate->cpu_profiler()->is_profiling()) {
- CHECK_EQ(i::EXTERNAL, isolate->current_vm_state());
- CHECK(isolate->external_callback());
- CHECK_EQ(callback, isolate->external_callback());
- }
}
-static v8::Handle<Value> handle_call_impl(
- const v8::Arguments& args,
- i::Address callback) {
+static v8::Handle<Value> handle_call(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, callback);
+ CheckReturnValue(args);
args.GetReturnValue().Set(v8_str("bad value"));
return v8_num(102);
}
-static v8::Handle<Value> handle_call(const v8::Arguments& args) {
- return handle_call_impl(args, FUNCTION_ADDR(handle_call));
-}
-
static v8::Handle<Value> handle_call_2(const v8::Arguments& args) {
- return handle_call_impl(args, FUNCTION_ADDR(handle_call_2));
+ return handle_call(args);
}
-static v8::Handle<Value> handle_call_indirect_impl(const v8::Arguments& args,
- i::Address callback) {
+static v8::Handle<Value> handle_call_indirect(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, callback);
+ CheckReturnValue(args);
args.GetReturnValue().Set(v8_str("bad value"));
args.GetReturnValue().Set(v8_num(102));
return v8::Handle<Value>();
}
-static v8::Handle<Value> handle_call_indirect(const v8::Arguments& args) {
- return handle_call_indirect_impl(args, FUNCTION_ADDR(handle_call_indirect));
-}
-
static v8::Handle<Value> handle_call_indirect_2(const v8::Arguments& args) {
- return handle_call_indirect_impl(args, FUNCTION_ADDR(handle_call_indirect_2));
+ return handle_call_indirect(args);
}
-static void handle_callback_impl(const v8::FunctionCallbackInfo<Value>& info,
- i::Address callback) {
+static void handle_callback(const v8::FunctionCallbackInfo<Value>& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, callback);
+ CheckReturnValue(info);
info.GetReturnValue().Set(v8_str("bad value"));
info.GetReturnValue().Set(v8_num(102));
}
-static void handle_callback(const v8::FunctionCallbackInfo<Value>& info) {
- return handle_callback_impl(info, FUNCTION_ADDR(handle_callback));
-}
-
static void handle_callback_2(const v8::FunctionCallbackInfo<Value>& info) {
- return handle_callback_impl(info, FUNCTION_ADDR(handle_callback_2));
+ return handle_callback(info);
}
static v8::Handle<Value> construct_call(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, FUNCTION_ADDR(construct_call));
+ CheckReturnValue(args);
args.This()->Set(v8_str("x"), v8_num(1));
args.This()->Set(v8_str("y"), v8_num(2));
args.GetReturnValue().Set(v8_str("bad value"));
@@ -889,7 +864,7 @@ static v8::Handle<Value> construct_call(const v8::Arguments& args) {
static v8::Handle<Value> construct_call_indirect(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, FUNCTION_ADDR(construct_call_indirect));
+ CheckReturnValue(args);
args.This()->Set(v8_str("x"), v8_num(1));
args.This()->Set(v8_str("y"), v8_num(2));
args.GetReturnValue().Set(v8_str("bad value"));
@@ -900,7 +875,7 @@ static v8::Handle<Value> construct_call_indirect(const v8::Arguments& args) {
static void construct_callback(
const v8::FunctionCallbackInfo<Value>& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, FUNCTION_ADDR(construct_callback));
+ CheckReturnValue(info);
info.This()->Set(v8_str("x"), v8_num(1));
info.This()->Set(v8_str("y"), v8_num(2));
info.GetReturnValue().Set(v8_str("bad value"));
@@ -911,7 +886,7 @@ static void construct_callback(
static v8::Handle<Value> Return239(
Local<String> name, const AccessorInfo& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, FUNCTION_ADDR(Return239));
+ CheckReturnValue(info);
info.GetReturnValue().Set(v8_str("bad value"));
return v8_num(239);
}
@@ -919,7 +894,7 @@ static v8::Handle<Value> Return239(
static v8::Handle<Value> Return239Indirect(
Local<String> name, const AccessorInfo& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, FUNCTION_ADDR(Return239Indirect));
+ CheckReturnValue(info);
Handle<Value> value = v8_num(239);
info.GetReturnValue().Set(v8_str("bad value"));
info.GetReturnValue().Set(value);
@@ -929,7 +904,7 @@ static v8::Handle<Value> Return239Indirect(
static void Return239Callback(
Local<String> name, const v8::PropertyCallbackInfo<Value>& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, FUNCTION_ADDR(Return239Callback));
+ CheckReturnValue(info);
info.GetReturnValue().Set(v8_str("bad value"));
info.GetReturnValue().Set(v8_num(239));
}
@@ -938,97 +913,58 @@ static void Return239Callback(
template<typename Handler>
static void TestFunctionTemplateInitializer(Handler handler,
Handler handler_2) {
- for (int i = 0; i < 2; i++) {
- bool is_profiling = (i > 0);
- // Test constructor calls.
- {
- LocalContext env;
- v8::HandleScope scope(env->GetIsolate());
-
- v8::Local<v8::String> profile_name = v8::String::New("my_profile1");
- v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler();
- if (is_profiling) {
- cpu_profiler->StartCpuProfiling(profile_name);
- }
-
- Local<v8::FunctionTemplate> fun_templ =
- v8::FunctionTemplate::New(handler);
- Local<Function> fun = fun_templ->GetFunction();
- env->Global()->Set(v8_str("obj"), fun);
- Local<Script> script = v8_compile("obj()");
- for (int i = 0; i < 30; i++) {
- CHECK_EQ(102, script->Run()->Int32Value());
- }
-
- if (is_profiling) {
- cpu_profiler->StopCpuProfiling(profile_name);
- }
- }
- // Use SetCallHandler to initialize a function template, should work like
- // the previous one.
- {
- LocalContext env;
- v8::HandleScope scope(env->GetIsolate());
-
- v8::Local<v8::String> profile_name = v8::String::New("my_profile2");
- v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler();
- if (is_profiling) {
- cpu_profiler->StartCpuProfiling(profile_name);
- }
-
- Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
- fun_templ->SetCallHandler(handler_2);
- Local<Function> fun = fun_templ->GetFunction();
- env->Global()->Set(v8_str("obj"), fun);
- Local<Script> script = v8_compile("obj()");
- for (int i = 0; i < 30; i++) {
- CHECK_EQ(102, script->Run()->Int32Value());
- }
-
- if (is_profiling) {
- cpu_profiler->DeleteAllCpuProfiles();
- }
- }
- }
-}
-
-
-template<typename Constructor, typename Accessor>
-static void TestFunctionTemplateAccessor(Constructor constructor,
- Accessor accessor) {
- for (int i = 0; i < 2; i++) {
- bool is_profiling = (i > 0);
+ // Test constructor calls.
+ {
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
-
- v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler();
- if (is_profiling) {
- v8::Local<v8::String> profile_name = v8::String::New("my_profile1");
- cpu_profiler->StartCpuProfiling(profile_name);
- }
-
Local<v8::FunctionTemplate> fun_templ =
- v8::FunctionTemplate::New(constructor);
- fun_templ->SetClassName(v8_str("funky"));
- fun_templ->InstanceTemplate()->SetAccessor(v8_str("m"), accessor);
+ v8::FunctionTemplate::New(handler);
Local<Function> fun = fun_templ->GetFunction();
env->Global()->Set(v8_str("obj"), fun);
- Local<Value> result = v8_compile("(new obj()).toString()")->Run();
- CHECK_EQ(v8_str("[object funky]"), result);
- CompileRun("var obj_instance = new obj();");
- Local<Script> script;
- script = v8_compile("obj_instance.x");
+ Local<Script> script = v8_compile("obj()");
for (int i = 0; i < 30; i++) {
- CHECK_EQ(1, script->Run()->Int32Value());
+ CHECK_EQ(102, script->Run()->Int32Value());
}
- script = v8_compile("obj_instance.m");
+ }
+ // Use SetCallHandler to initialize a function template, should work like the
+ // previous one.
+ {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
+ fun_templ->SetCallHandler(handler_2);
+ Local<Function> fun = fun_templ->GetFunction();
+ env->Global()->Set(v8_str("obj"), fun);
+ Local<Script> script = v8_compile("obj()");
for (int i = 0; i < 30; i++) {
- CHECK_EQ(239, script->Run()->Int32Value());
+ CHECK_EQ(102, script->Run()->Int32Value());
}
+ }
+}
- if (is_profiling) {
- cpu_profiler->DeleteAllCpuProfiles();
- }
+
+template<typename Constructor, typename Accessor>
+static void TestFunctionTemplateAccessor(Constructor constructor,
+ Accessor accessor) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ Local<v8::FunctionTemplate> fun_templ =
+ v8::FunctionTemplate::New(constructor);
+ fun_templ->SetClassName(v8_str("funky"));
+ fun_templ->InstanceTemplate()->SetAccessor(v8_str("m"), accessor);
+ Local<Function> fun = fun_templ->GetFunction();
+ env->Global()->Set(v8_str("obj"), fun);
+ Local<Value> result = v8_compile("(new obj()).toString()")->Run();
+ CHECK_EQ(v8_str("[object funky]"), result);
+ CompileRun("var obj_instance = new obj();");
+ Local<Script> script;
+ script = v8_compile("obj_instance.x");
+ for (int i = 0; i < 30; i++) {
+ CHECK_EQ(1, script->Run()->Int32Value());
+ }
+ script = v8_compile("obj_instance.m");
+ for (int i = 0; i < 30; i++) {
+ CHECK_EQ(239, script->Run()->Int32Value());
}
}
@@ -1046,55 +982,41 @@ THREADED_TEST(FunctionTemplate) {
static v8::Handle<v8::Value> SimpleDirectCallback(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, FUNCTION_ADDR(SimpleDirectCallback));
+ CheckReturnValue(args);
args.GetReturnValue().Set(v8_str("bad value"));
return v8_num(51423 + args.Length());
}
static v8::Handle<v8::Value> SimpleIndirectCallback(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, FUNCTION_ADDR(SimpleIndirectCallback));
+ CheckReturnValue(args);
args.GetReturnValue().Set(v8_num(51423 + args.Length()));
return v8::Handle<v8::Value>();
}
static void SimpleCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, FUNCTION_ADDR(SimpleCallback));
+ CheckReturnValue(info);
info.GetReturnValue().Set(v8_num(51423 + info.Length()));
}
template<typename Callback>
static void TestSimpleCallback(Callback callback) {
- for (int i = 0; i < 2; i++) {
- bool is_profiling = i;
- LocalContext env;
- v8::HandleScope scope(env->GetIsolate());
-
- v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler();
- if (is_profiling) {
- v8::Local<v8::String> profile_name = v8::String::New("my_profile1");
- cpu_profiler->StartCpuProfiling(profile_name);
- }
-
- v8::Handle<v8::ObjectTemplate> object_template = v8::ObjectTemplate::New();
- object_template->Set("callback", v8::FunctionTemplate::New(callback));
- v8::Local<v8::Object> object = object_template->NewInstance();
- (*env)->Global()->Set(v8_str("callback_object"), object);
- v8::Handle<v8::Script> script;
- script = v8_compile("callback_object.callback(17)");
- for (int i = 0; i < 30; i++) {
- CHECK_EQ(51424, script->Run()->Int32Value());
- }
- script = v8_compile("callback_object.callback(17, 24)");
- for (int i = 0; i < 30; i++) {
- CHECK_EQ(51425, script->Run()->Int32Value());
- }
-
- if (is_profiling) {
- cpu_profiler->DeleteAllCpuProfiles();
- }
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::Handle<v8::ObjectTemplate> object_template = v8::ObjectTemplate::New();
+ object_template->Set("callback", v8::FunctionTemplate::New(callback));
+ v8::Local<v8::Object> object = object_template->NewInstance();
+ (*env)->Global()->Set(v8_str("callback_object"), object);
+ v8::Handle<v8::Script> script;
+ script = v8_compile("callback_object.callback(17)");
+ for (int i = 0; i < 30; i++) {
+ CHECK_EQ(51424, script->Run()->Int32Value());
+ }
+ script = v8_compile("callback_object.callback(17, 24)");
+ for (int i = 0; i < 30; i++) {
+ CHECK_EQ(51425, script->Run()->Int32Value());
}
}
@@ -1123,44 +1045,38 @@ enum ReturnValueOddball {
static ReturnValueOddball fast_return_value_void;
static bool fast_return_value_object_is_empty = false;
-// Helper function to avoid compiler error: insufficient contextual information
-// to determine type when applying FUNCTION_ADDR to a template function.
-static i::Address address_of(v8::FunctionCallback callback) {
- return FUNCTION_ADDR(callback);
-}
-
template<>
void FastReturnValueCallback<int32_t>(
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, address_of(FastReturnValueCallback<int32_t>));
+ CheckReturnValue(info);
info.GetReturnValue().Set(fast_return_value_int32);
}
template<>
void FastReturnValueCallback<uint32_t>(
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, address_of(FastReturnValueCallback<uint32_t>));
+ CheckReturnValue(info);
info.GetReturnValue().Set(fast_return_value_uint32);
}
template<>
void FastReturnValueCallback<double>(
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, address_of(FastReturnValueCallback<double>));
+ CheckReturnValue(info);
info.GetReturnValue().Set(kFastReturnValueDouble);
}
template<>
void FastReturnValueCallback<bool>(
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, address_of(FastReturnValueCallback<bool>));
+ CheckReturnValue(info);
info.GetReturnValue().Set(fast_return_value_bool);
}
template<>
void FastReturnValueCallback<void>(
const v8::FunctionCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, address_of(FastReturnValueCallback<void>));
+ CheckReturnValue(info);
switch (fast_return_value_void) {
case kNullReturnValue:
info.GetReturnValue().SetNull();
@@ -2137,7 +2053,7 @@ v8::Handle<v8::Object> bottom;
static void CheckThisIndexedPropertyHandler(
uint32_t index,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisIndexedPropertyHandler));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2145,7 +2061,7 @@ static void CheckThisIndexedPropertyHandler(
static void CheckThisNamedPropertyHandler(
Local<String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisNamedPropertyHandler));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2154,7 +2070,7 @@ void CheckThisIndexedPropertySetter(
uint32_t index,
Local<Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisIndexedPropertySetter));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2164,7 +2080,7 @@ void CheckThisNamedPropertySetter(
Local<String> property,
Local<Value> value,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisNamedPropertySetter));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2172,7 +2088,7 @@ void CheckThisNamedPropertySetter(
void CheckThisIndexedPropertyQuery(
uint32_t index,
const v8::PropertyCallbackInfo<v8::Integer>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisIndexedPropertyQuery));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2181,7 +2097,7 @@ void CheckThisIndexedPropertyQuery(
void CheckThisNamedPropertyQuery(
Local<String> property,
const v8::PropertyCallbackInfo<v8::Integer>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisNamedPropertyQuery));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2190,7 +2106,7 @@ void CheckThisNamedPropertyQuery(
void CheckThisIndexedPropertyDeleter(
uint32_t index,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisIndexedPropertyDeleter));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2199,7 +2115,7 @@ void CheckThisIndexedPropertyDeleter(
void CheckThisNamedPropertyDeleter(
Local<String> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisNamedPropertyDeleter));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2207,7 +2123,7 @@ void CheckThisNamedPropertyDeleter(
void CheckThisIndexedPropertyEnumerator(
const v8::PropertyCallbackInfo<v8::Array>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisIndexedPropertyEnumerator));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -2215,7 +2131,7 @@ void CheckThisIndexedPropertyEnumerator(
void CheckThisNamedPropertyEnumerator(
const v8::PropertyCallbackInfo<v8::Array>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(CheckThisNamedPropertyEnumerator));
+ CheckReturnValue(info);
ApiTestFuzzer::Fuzz();
CHECK(info.This()->Equals(bottom));
}
@@ -3133,7 +3049,9 @@ THREADED_TEST(ClearAndLeakGlobal) {
String* str = global.ClearAndLeak();
CHECK(global.IsEmpty());
CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1);
- global_handles->Destroy(reinterpret_cast<i::Object**>(str));
+ v8::Persistent<String>* new_global =
+ reinterpret_cast<v8::Persistent<String>*>(&str);
+ new_global->Dispose();
CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count);
}
@@ -10719,7 +10637,7 @@ THREADED_TEST(InterceptorCallICCachedFromGlobal) {
static v8::Handle<Value> InterceptorCallICFastApi(Local<String> name,
const AccessorInfo& info) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(info, FUNCTION_ADDR(InterceptorCallICFastApi));
+ CheckReturnValue(info);
int* call_count =
reinterpret_cast<int*>(v8::External::Cast(*info.Data())->Value());
++(*call_count);
@@ -10732,7 +10650,7 @@ static v8::Handle<Value> InterceptorCallICFastApi(Local<String> name,
static v8::Handle<Value> FastApiCallback_TrivialSignature(
const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, FUNCTION_ADDR(FastApiCallback_TrivialSignature));
+ CheckReturnValue(args);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
CHECK_EQ(isolate, args.GetIsolate());
CHECK_EQ(args.This(), args.Holder());
@@ -10743,7 +10661,7 @@ static v8::Handle<Value> FastApiCallback_TrivialSignature(
static v8::Handle<Value> FastApiCallback_SimpleSignature(
const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
- CheckReturnValue(args, FUNCTION_ADDR(FastApiCallback_SimpleSignature));
+ CheckReturnValue(args);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
CHECK_EQ(isolate, args.GetIsolate());
CHECK_EQ(args.This()->GetPrototype(), args.Holder());
@@ -10831,7 +10749,7 @@ static Handle<Value> DoDirectGetter() {
static v8::Handle<v8::Value> DirectGetter(Local<String> name,
const v8::AccessorInfo& info) {
- CheckReturnValue(info, FUNCTION_ADDR(DirectGetter));
+ CheckReturnValue(info);
info.GetReturnValue().Set(v8_str("Garbage"));
return DoDirectGetter();
}
@@ -10839,7 +10757,7 @@ static v8::Handle<v8::Value> DirectGetter(Local<String> name,
static v8::Handle<v8::Value> DirectGetterIndirect(
Local<String> name,
const v8::AccessorInfo& info) {
- CheckReturnValue(info, FUNCTION_ADDR(DirectGetterIndirect));
+ CheckReturnValue(info);
info.GetReturnValue().Set(DoDirectGetter());
return v8::Handle<v8::Value>();
}
@@ -10847,7 +10765,7 @@ static v8::Handle<v8::Value> DirectGetterIndirect(
static void DirectGetterCallback(
Local<String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
- CheckReturnValue(info, FUNCTION_ADDR(DirectGetterCallback));
+ CheckReturnValue(info);
info.GetReturnValue().Set(DoDirectGetter());
}
@@ -12763,8 +12681,7 @@ THREADED_TEST(DisposeEnteredContext) {
{
// Don't want a handle here, so do this unsafely
v8::Handle<v8::Context> inner_local =
- v8::Utils::Convert<i::Object, v8::Context>(
- v8::Utils::OpenPersistent(inner));
+ *reinterpret_cast<v8::Handle<v8::Context>*>(&inner);
inner_local->Enter();
inner.Dispose();
inner.Clear();
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698