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

Unified Diff: test/cctest/cctest.h

Issue 247263003: Hide heap methods where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 8 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/heap.cc ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index b4e31f26df5e3a1fe7976a49f7c654b34e5c084c..e0f359898ff58f4aa9d4c746325549a4a2c76604 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -80,6 +80,19 @@ typedef v8::internal::EnumSet<CcTestExtensionIds> CcTestExtensionFlags;
#undef DEFINE_EXTENSION_FLAG
+// Use this to expose protected methods in i::Heap.
+class TestHeap : public i::Heap {
+ public:
+ using i::Heap::AllocateHeapNumber;
+ using i::Heap::AllocateMap;
+ using i::Heap::AllocateJSObject;
+ using i::Heap::AllocateJSObjectFromMap;
+ using i::Heap::AllocateByteArray;
+ using i::Heap::AllocateArgumentsObject;
+ using i::Heap::CopyCode;
+};
+
+
class CcTest {
public:
typedef void (TestFunction)();
@@ -107,6 +120,10 @@ class CcTest {
return i_isolate()->heap();
}
+ static TestHeap* test_heap() {
+ return reinterpret_cast<TestHeap*>(i_isolate()->heap());
+ }
+
static v8::Local<v8::Object> global() {
return isolate()->GetCurrentContext()->Global();
}
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698