Index: test/cctest/cctest.h |
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h |
index b4e31f26df5e3a1fe7976a49f7c654b34e5c084c..589f933cfa5d5af6c19e624d897340f936095e51 100644 |
--- a/test/cctest/cctest.h |
+++ b/test/cctest/cctest.h |
@@ -80,6 +80,20 @@ typedef v8::internal::EnumSet<CcTestExtensionIds> CcTestExtensionFlags; |
#undef DEFINE_EXTENSION_FLAG |
+// Use this to expose protected methods in i::Heap. |
+class TestHeap : public i::Heap { |
Michael Starzinger
2014/04/29 13:15:09
At first this helper class worried me, but the mor
Yang
2014/04/29 13:55:13
:)
Apparently this is covered by the C++ spec, so
|
+ 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; |
+ using i::Heap::InternalizeString; |
+}; |
+ |
+ |
class CcTest { |
public: |
typedef void (TestFunction)(); |
@@ -107,6 +121,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(); |
} |