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

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

Issue 12650005: Parallel recompilation: fix off-by-one in deferred handle scope iteration. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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
« src/compiler.cc ('K') | « src/compiler.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-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 97d6d059f2fb590d495de903a87514dddb8a6f67..b5565f4ec5b5d90f682f76cb6bc471237b554fa3 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -3015,3 +3015,31 @@ TEST(Regress173458) {
heap->CollectAllGarbage(Heap::kNoGCFlags);
heap->CollectAllGarbage(Heap::kNoGCFlags);
}
+
+
+class DummyVisitor : public ObjectVisitor {
+ public:
+ void VisitPointers(Object** start, Object** end) { }
+};
+
+
+TEST(DeferredHandles) {
+ InitializeVM();
+ Isolate* isolate = Isolate::Current();
+ Heap* heap = isolate->heap();
+ v8::HandleScope scope;
+ v8::ImplementationUtilities::HandleScopeData* data =
+ isolate->handle_scope_data();
+ Handle<Object> init(heap->empty_string(), isolate);
+ while (data->next < data->limit) {
+ Handle<Object> obj(heap->empty_string(), isolate);
+ }
+ // An entire block of handles has been filled.
+ // Next handle would require a new block.
+ ASSERT(data->next == data->limit);
+
+ DeferredHandleScope deferred(isolate);
+ DummyVisitor visitor;
+ isolate->handle_scope_implementer()->Iterate(&visitor);
+ deferred.Detach();
+}
« src/compiler.cc ('K') | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698