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

Unified Diff: test/cctest/test-code-stub-assembler.cc

Issue 2034463003: Make CodeStubAssemblerTester use its own zone instead of Isolate::runtime_zone(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@move-csa-test
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698