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

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

Issue 15791005: fix thread safety issue in FunctionTemplate test (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | 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 01f23a612ba3c324d79abcdddcf5ed1decf34218..2e5cce6b2f1e25c497813f35e5b3706e85ef2246 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -821,6 +821,10 @@ static v8::Handle<Value> handle_call(const v8::Arguments& args) {
return v8_num(102);
}
+static v8::Handle<Value> handle_call_2(const v8::Arguments& args) {
+ return handle_call(args);
+}
+
static v8::Handle<Value> handle_call_indirect(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
CheckReturnValue(args);
@@ -829,6 +833,10 @@ static v8::Handle<Value> handle_call_indirect(const v8::Arguments& args) {
return v8::Handle<Value>();
}
+static v8::Handle<Value> handle_call_indirect_2(const v8::Arguments& args) {
+ return handle_call_indirect(args);
+}
+
static void handle_callback(const v8::FunctionCallbackInfo<Value>& info) {
ApiTestFuzzer::Fuzz();
CheckReturnValue(info);
@@ -836,6 +844,9 @@ static void handle_callback(const v8::FunctionCallbackInfo<Value>& info) {
info.GetReturnValue().Set(v8_num(102));
}
+static void handle_callback_2(const v8::FunctionCallbackInfo<Value>& info) {
+ return handle_callback(info);
+}
static v8::Handle<Value> construct_call(const v8::Arguments& args) {
ApiTestFuzzer::Fuzz();
@@ -895,7 +906,8 @@ static void Return239Callback(
template<typename Handler>
-static void TestFunctionTemplateInitializer(Handler handler) {
+static void TestFunctionTemplateInitializer(Handler handler,
+ Handler handler_2) {
// Test constructor calls.
{
LocalContext env;
@@ -909,12 +921,6 @@ static void TestFunctionTemplateInitializer(Handler handler) {
CHECK_EQ(102, script->Run()->Int32Value());
}
}
- // Blow away handler database
- i::Isolate* isolate = i::Isolate::Current();
- if (isolate->callback_table() != NULL) {
- delete isolate->callback_table();
- isolate->set_callback_table(NULL);
- }
// Use SetCallHandler to initialize a function template, should work like the
// previous one.
{
@@ -959,9 +965,9 @@ static void TestFunctionTemplateAccessor(Constructor constructor,
THREADED_TEST(FunctionTemplate) {
- TestFunctionTemplateInitializer(handle_call);
- TestFunctionTemplateInitializer(handle_call_indirect);
- TestFunctionTemplateInitializer(handle_callback);
+ TestFunctionTemplateInitializer(handle_call, handle_call_2);
+ TestFunctionTemplateInitializer(handle_call_indirect, handle_call_indirect_2);
+ TestFunctionTemplateInitializer(handle_callback, handle_callback_2);
TestFunctionTemplateAccessor(construct_call, Return239);
TestFunctionTemplateAccessor(construct_call_indirect, Return239Indirect);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698