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(); |
} |