| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/handles.h" | 5 #include "src/handles.h" |
| 6 #include "src/interface-descriptors.h" | 6 #include "src/interface-descriptors.h" |
| 7 #include "src/isolate.h" | 7 #include "src/isolate.h" |
| 8 #include "test/cctest/compiler/function-tester.h" | 8 #include "test/cctest/compiler/function-tester.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 namespace compiler { | 12 namespace compiler { |
| 13 | 13 |
| 14 class ZoneHolder { | 14 class ZoneHolder { |
| 15 public: | 15 public: |
| 16 explicit ZoneHolder(Isolate* isolate) : zone_(isolate->allocator()) {} | 16 explicit ZoneHolder(Isolate* isolate) |
| 17 : zone_(isolate->allocator(), ZONE_NAME) {} |
| 17 Zone* zone() { return &zone_; } | 18 Zone* zone() { return &zone_; } |
| 18 | 19 |
| 19 private: | 20 private: |
| 20 Zone zone_; | 21 Zone zone_; |
| 21 }; | 22 }; |
| 22 | 23 |
| 23 // Inherit from ZoneHolder in order to create a zone that can be passed to | 24 // Inherit from ZoneHolder in order to create a zone that can be passed to |
| 24 // CodeAssembler base class constructor. | 25 // CodeAssembler base class constructor. |
| 25 template <typename CodeAssemblerT> | 26 template <typename CodeAssemblerT> |
| 26 class CodeAssemblerTesterImpl : private ZoneHolder, public CodeAssemblerT { | 27 class CodeAssemblerTesterImpl : private ZoneHolder, public CodeAssemblerT { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 } | 53 } |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 HandleScope scope_; | 56 HandleScope scope_; |
| 56 LocalContext context_; | 57 LocalContext context_; |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace compiler | 60 } // namespace compiler |
| 60 } // namespace internal | 61 } // namespace internal |
| 61 } // namespace v8 | 62 } // namespace v8 |
| OLD | NEW |