OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 ~InitializedHandleScope(); | 576 ~InitializedHandleScope(); |
577 | 577 |
578 // Prefixing the below with main_ reduces a lot of naming clashes. | 578 // Prefixing the below with main_ reduces a lot of naming clashes. |
579 i::Isolate* main_isolate() { return main_isolate_; } | 579 i::Isolate* main_isolate() { return main_isolate_; } |
580 | 580 |
581 private: | 581 private: |
582 i::Isolate* main_isolate_; | 582 i::Isolate* main_isolate_; |
583 std::unique_ptr<InitializedHandleScopeImpl> initialized_handle_scope_impl_; | 583 std::unique_ptr<InitializedHandleScopeImpl> initialized_handle_scope_impl_; |
584 }; | 584 }; |
585 | 585 |
586 | |
587 class HandleAndZoneScope : public InitializedHandleScope { | 586 class HandleAndZoneScope : public InitializedHandleScope { |
588 public: | 587 public: |
589 HandleAndZoneScope(); | 588 HandleAndZoneScope(); |
590 ~HandleAndZoneScope(); | 589 ~HandleAndZoneScope(); |
591 | 590 |
592 // Prefixing the below with main_ reduces a lot of naming clashes. | 591 // Prefixing the below with main_ reduces a lot of naming clashes. |
593 i::Zone* main_zone() { return main_zone_.get(); } | 592 i::Zone* main_zone() { return main_zone_.get(); } |
594 | 593 |
595 private: | 594 private: |
596 v8::internal::AccountingAllocator allocator_; | 595 v8::internal::AccountingAllocator allocator_; |
597 std::unique_ptr<i::Zone> main_zone_; | 596 std::unique_ptr<i::Zone> main_zone_; |
598 }; | 597 }; |
599 | 598 |
| 599 class StaticOneByteResource : public v8::String::ExternalOneByteStringResource { |
| 600 public: |
| 601 explicit StaticOneByteResource(const char* data) : data_(data) {} |
| 602 |
| 603 ~StaticOneByteResource() {} |
| 604 |
| 605 const char* data() const { return data_; } |
| 606 |
| 607 size_t length() const { return strlen(data_); } |
| 608 |
| 609 private: |
| 610 const char* data_; |
| 611 }; |
| 612 |
600 #endif // ifndef CCTEST_H_ | 613 #endif // ifndef CCTEST_H_ |
OLD | NEW |