Index: test/cctest/test-code-stub-assembler.cc |
diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc |
index d5991e6e10a7796d53520d9cc323a92b3123f4d5..5a1d90bb7a050d1046893072f3f82a159513f76e 100644 |
--- a/test/cctest/test-code-stub-assembler.cc |
+++ b/test/cctest/test-code-stub-assembler.cc |
@@ -12,18 +12,31 @@ namespace internal { |
using compiler::FunctionTester; |
using compiler::Node; |
-class CodeStubAssemblerTester : public CodeStubAssembler { |
+class ZoneHolder { |
+ public: |
+ explicit ZoneHolder(Isolate* isolate) : zone_(isolate->allocator()) {} |
+ Zone* zone() { return &zone_; } |
+ |
+ private: |
+ Zone zone_; |
+}; |
+ |
+// Inherit from ZoneHolder in order to create a zone that can be passed to |
+// CodeStubAssembler base class constructor. |
+class CodeStubAssemblerTester : private ZoneHolder, public CodeStubAssembler { |
public: |
// Test generating code for a stub. |
CodeStubAssemblerTester(Isolate* isolate, |
const CallInterfaceDescriptor& descriptor) |
- : CodeStubAssembler(isolate, isolate->runtime_zone(), descriptor, |
+ : ZoneHolder(isolate), |
+ CodeStubAssembler(isolate, ZoneHolder::zone(), descriptor, |
Code::ComputeFlags(Code::STUB), "test"), |
scope_(isolate) {} |
// Test generating code for a JS function (e.g. builtins). |
CodeStubAssemblerTester(Isolate* isolate, int parameter_count) |
- : CodeStubAssembler(isolate, isolate->runtime_zone(), parameter_count, |
+ : ZoneHolder(isolate), |
+ CodeStubAssembler(isolate, ZoneHolder::zone(), parameter_count, |
Code::ComputeFlags(Code::FUNCTION), "test"), |
scope_(isolate) {} |