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

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

Issue 10828048: Avoid GC when printing shared function info. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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/objects-printer.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 9229a97125e681b69a502a967a5e52c5f9d429af..2263de5e26ad925b9729489879ac86d8397058fd 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1966,3 +1966,23 @@ TEST(Regress2237) {
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
CHECK(SlicedString::cast(*slice)->parent()->IsSeqAsciiString());
}
+
+
+#ifdef OBJECT_PRINT
+TEST(PrintSharedFunctionInfo) {
+ InitializeVM();
+ v8::HandleScope scope;
+ const char* source = "f = function() { return 987654321; }\n"
+ "g = function() { return 123456789; }\n";
+ CompileRun(source);
+ Handle<String> g_symbol = FACTORY->LookupAsciiSymbol("g");
+ JSFunction* g_func;
+ MaybeObject* maybe_obj =
+ Isolate::Current()->context()->global()->GetProperty(*g_symbol);
+ CHECK(!maybe_obj->IsFailure());
+ CHECK(maybe_obj->To<JSFunction>(&g_func));
Michael Starzinger 2012/07/27 09:50:27 Consider using the following to get to the "g" fun
+
+ AssertNoAllocation no_alloc;
+ g_func->shared()->PrintLn();
+}
+#endif // OBJECT_PRINT
« no previous file with comments | « src/objects-printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698