Make LeakSanitizer happy, part 1.

Bumped an assembler buffer on the way, it is necessary for some combinations of debugging flags.

Note that the allocation profiler still leaks, this is handled in a separate CL.

R=bmeurer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19128 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2014-02-06 07:16:41 +00:00
parent 25df21cca1
commit f0bf110448
7 changed files with 29 additions and 26 deletions

View File

@ -1855,10 +1855,9 @@ TEST(WeakGlobalHandle) {
CHECK(!HasWeakGlobalHandle());
v8::Persistent<v8::Object>* handle =
new v8::Persistent<v8::Object>(env->GetIsolate(),
v8::Object::New(env->GetIsolate()));
handle->SetWeak(handle, PersistentHandleCallback);
v8::Persistent<v8::Object> handle(env->GetIsolate(),
v8::Object::New(env->GetIsolate()));
handle.SetWeak(&handle, PersistentHandleCallback);
CHECK(HasWeakGlobalHandle());
}

View File

@ -363,6 +363,7 @@ TEST(LogCallbacks) {
ObjMethod1);
CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length()));
log.Dispose();
}
@ -420,6 +421,7 @@ TEST(LogAccessorCallbacks) {
Prop2Getter);
CHECK_NE(NULL,
StrNStr(log.start(), prop2_getter_record.start(), log.length()));
log.Dispose();
}

View File

@ -1555,7 +1555,7 @@ TEST(SmiIndex) {
// Allocate an executable page of memory.
size_t actual_size;
byte* buffer =
static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 4,
static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize * 5,
&actual_size,
true));
CHECK(buffer);

View File

@ -244,8 +244,11 @@ TEST(Preparsing) {
CHECK_EQ(11, error_location.end_pos);
// Should not crash.
const char* message = pre_impl->BuildMessage();
pre_impl->BuildArgs();
i::Vector<const char*> args = pre_impl->BuildArgs();
CHECK_GT(strlen(message), 0);
args.Dispose();
i::DeleteArray(message);
delete error_preparse;
}
@ -1019,7 +1022,7 @@ TEST(ScopePositions) {
int kSuffixByteLen = i::StrLength(source_data[i].outer_suffix);
int kProgramSize = kPrefixLen + kInnerLen + kSuffixLen;
int kProgramByteSize = kPrefixByteLen + kInnerByteLen + kSuffixByteLen;
i::Vector<char> program = i::Vector<char>::New(kProgramByteSize + 1);
i::ScopedVector<char> program(kProgramByteSize + 1);
i::OS::SNPrintF(program, "%s%s%s",
source_data[i].outer_prefix,
source_data[i].inner_source,

View File

@ -48,42 +48,42 @@ using i::Vector;
TEST(ProfileNodeFindOrAddChild) {
ProfileTree tree;
ProfileNode node(&tree, NULL);
ProfileNode* node = tree.root();
CodeEntry entry1(i::Logger::FUNCTION_TAG, "aaa");
ProfileNode* childNode1 = node.FindOrAddChild(&entry1);
ProfileNode* childNode1 = node->FindOrAddChild(&entry1);
CHECK_NE(NULL, childNode1);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
CodeEntry entry2(i::Logger::FUNCTION_TAG, "bbb");
ProfileNode* childNode2 = node.FindOrAddChild(&entry2);
ProfileNode* childNode2 = node->FindOrAddChild(&entry2);
CHECK_NE(NULL, childNode2);
CHECK_NE(childNode1, childNode2);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
CHECK_EQ(childNode2, node.FindOrAddChild(&entry2));
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
CHECK_EQ(childNode2, node->FindOrAddChild(&entry2));
CodeEntry entry3(i::Logger::FUNCTION_TAG, "ccc");
ProfileNode* childNode3 = node.FindOrAddChild(&entry3);
ProfileNode* childNode3 = node->FindOrAddChild(&entry3);
CHECK_NE(NULL, childNode3);
CHECK_NE(childNode1, childNode3);
CHECK_NE(childNode2, childNode3);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
CHECK_EQ(childNode2, node.FindOrAddChild(&entry2));
CHECK_EQ(childNode3, node.FindOrAddChild(&entry3));
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
CHECK_EQ(childNode2, node->FindOrAddChild(&entry2));
CHECK_EQ(childNode3, node->FindOrAddChild(&entry3));
}
TEST(ProfileNodeFindOrAddChildForSameFunction) {
const char* aaa = "aaa";
ProfileTree tree;
ProfileNode node(&tree, NULL);
ProfileNode* node = tree.root();
CodeEntry entry1(i::Logger::FUNCTION_TAG, aaa);
ProfileNode* childNode1 = node.FindOrAddChild(&entry1);
ProfileNode* childNode1 = node->FindOrAddChild(&entry1);
CHECK_NE(NULL, childNode1);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
CHECK_EQ(childNode1, node->FindOrAddChild(&entry1));
// The same function again.
CodeEntry entry2(i::Logger::FUNCTION_TAG, aaa);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry2));
CHECK_EQ(childNode1, node->FindOrAddChild(&entry2));
// Now with a different security token.
CodeEntry entry3(i::Logger::FUNCTION_TAG, aaa);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry3));
CHECK_EQ(childNode1, node->FindOrAddChild(&entry3));
}

View File

@ -539,7 +539,6 @@ static void Execute(const char* input,
#ifdef DEBUG
if (dot_output) {
RegExpEngine::DotPrint(input, node, false);
exit(0);
}
#endif // DEBUG
}

View File

@ -159,18 +159,18 @@ TEST(ThreadIdValidation) {
const int kNThreads = 100;
i::List<ThreadIdValidationThread*> threads(kNThreads);
i::List<i::ThreadId> refs(kNThreads);
i::Semaphore* semaphore = new i::Semaphore(0);
i::Semaphore semaphore(0);
ThreadIdValidationThread* prev = NULL;
for (int i = kNThreads - 1; i >= 0; i--) {
ThreadIdValidationThread* newThread =
new ThreadIdValidationThread(prev, &refs, i, semaphore);
new ThreadIdValidationThread(prev, &refs, i, &semaphore);
threads.Add(newThread);
prev = newThread;
refs.Add(i::ThreadId::Invalid());
}
prev->Start();
for (int i = 0; i < kNThreads; i++) {
semaphore->Wait();
semaphore.Wait();
}
for (int i = 0; i < kNThreads; i++) {
delete threads[i];