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

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

Issue 929973002: Revert "Fix JSArrayBufferView visitor template to fix ARM build." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/serialize.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-weaktypedarrays.cc
diff --git a/test/cctest/test-weaktypedarrays.cc b/test/cctest/test-weaktypedarrays.cc
index c1f59de45aa3c669da0c8e1e1ff2578234c77312..d40b7e95a91be1ee3ad328fe51f841102ed1d819 100644
--- a/test/cctest/test-weaktypedarrays.cc
+++ b/test/cctest/test-weaktypedarrays.cc
@@ -62,20 +62,7 @@ static bool HasArrayBufferInWeakList(Heap* heap, JSArrayBuffer* ab) {
}
-static int CountViewsInNewSpaceList(Heap* heap, JSArrayBuffer* array_buffer) {
- int count = 0;
- for (Object* o = heap->new_array_buffer_views_list(); !o->IsUndefined();) {
- JSArrayBufferView* view = JSArrayBufferView::cast(o);
- if (array_buffer == view->buffer()) {
- count++;
- }
- o = view->weak_next();
- }
- return count;
-}
-
-
-static int CountViews(Heap* heap, JSArrayBuffer* array_buffer) {
+static int CountViews(JSArrayBuffer* array_buffer) {
int count = 0;
for (Object* o = array_buffer->weak_first_view();
!o->IsUndefined();
@@ -83,27 +70,17 @@ static int CountViews(Heap* heap, JSArrayBuffer* array_buffer) {
count++;
}
- return count + CountViewsInNewSpaceList(heap, array_buffer);
-}
-
-
-static bool HasViewInNewSpaceList(Heap* heap, JSArrayBufferView* ta) {
- for (Object* o = heap->new_array_buffer_views_list(); !o->IsUndefined();
- o = JSArrayBufferView::cast(o)->weak_next()) {
- if (ta == o) return true;
- }
- return false;
+ return count;
}
-
-static bool HasViewInWeakList(Heap* heap, JSArrayBuffer* array_buffer,
+static bool HasViewInWeakList(JSArrayBuffer* array_buffer,
JSArrayBufferView* ta) {
for (Object* o = array_buffer->weak_first_view();
!o->IsUndefined();
o = JSArrayBufferView::cast(o)->weak_next()) {
if (ta == o) return true;
}
- return HasViewInNewSpaceList(heap, ta);
+ return false;
}
@@ -223,18 +200,18 @@ void TestViewFromApi() {
Handle<JSArrayBufferView> ita1 = v8::Utils::OpenHandle(*ta1);
Handle<JSArrayBufferView> ita2 = v8::Utils::OpenHandle(*ta2);
- CHECK_EQ(2, CountViews(isolate->heap(), *iab));
- CHECK(HasViewInWeakList(isolate->heap(), *iab, *ita1));
- CHECK(HasViewInWeakList(isolate->heap(), *iab, *ita2));
+ CHECK_EQ(2, CountViews(*iab));
+ CHECK(HasViewInWeakList(*iab, *ita1));
+ CHECK(HasViewInWeakList(*iab, *ita2));
}
isolate->heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
- CHECK_EQ(1, CountViews(isolate->heap(), *iab));
+ CHECK_EQ(1, CountViews(*iab));
Handle<JSArrayBufferView> ita1 = v8::Utils::OpenHandle(*ta1);
- CHECK(HasViewInWeakList(isolate->heap(), *iab, *ita1));
+ CHECK(HasViewInWeakList(*iab, *ita1));
}
isolate->heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
- CHECK_EQ(0, CountViews(isolate->heap(), *iab));
+ CHECK_EQ(0, CountViews(*iab));
}
@@ -322,13 +299,10 @@ static void TestTypedArrayFromScript(const char* constructor) {
v8::Handle<TypedArray>::Cast(CompileRun("ta3"));
CHECK_EQ(1, CountArrayBuffersInWeakList(isolate->heap()) - start);
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
- CHECK_EQ(3, CountViews(isolate->heap(), *iab));
- CHECK(HasViewInWeakList(isolate->heap(), *iab,
- *v8::Utils::OpenHandle(*ta1)));
- CHECK(HasViewInWeakList(isolate->heap(), *iab,
- *v8::Utils::OpenHandle(*ta2)));
- CHECK(HasViewInWeakList(isolate->heap(), *iab,
- *v8::Utils::OpenHandle(*ta3)));
+ CHECK_EQ(3, CountViews(*iab));
+ CHECK(HasViewInWeakList(*iab, *v8::Utils::OpenHandle(*ta1)));
+ CHECK(HasViewInWeakList(*iab, *v8::Utils::OpenHandle(*ta2)));
+ CHECK(HasViewInWeakList(*iab, *v8::Utils::OpenHandle(*ta3)));
}
i::SNPrintF(source, "ta%d = null;", i);
@@ -342,14 +316,13 @@ static void TestTypedArrayFromScript(const char* constructor) {
v8::Handle<v8::ArrayBuffer> ab =
v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab"));
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
- CHECK_EQ(2, CountViews(isolate->heap(), *iab));
+ CHECK_EQ(2, CountViews(*iab));
for (int j = 1; j <= 3; j++) {
if (j == i) continue;
i::SNPrintF(source, "ta%d", j);
v8::Handle<TypedArray> ta =
v8::Handle<TypedArray>::Cast(CompileRun(source.start()));
- CHECK(HasViewInWeakList(isolate->heap(), *iab,
- *v8::Utils::OpenHandle(*ta)));
+ CHECK(HasViewInWeakList(*iab, *v8::Utils::OpenHandle(*ta)));
}
}
@@ -363,7 +336,7 @@ static void TestTypedArrayFromScript(const char* constructor) {
v8::Handle<v8::ArrayBuffer> ab =
v8::Handle<v8::ArrayBuffer>::Cast(CompileRun("ab"));
Handle<JSArrayBuffer> iab = v8::Utils::OpenHandle(*ab);
- CHECK_EQ(0, CountViews(isolate->heap(), *iab));
+ CHECK_EQ(0, CountViews(*iab));
}
}
}
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698