| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "include/libplatform/libplatform.h" | 7 #include "include/libplatform/libplatform.h" |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 | 9 |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #if defined(V8_USE_SNAPSHOT) && !defined(DEBUG) | 30 #if defined(V8_USE_SNAPSHOT) && !defined(DEBUG) |
| 31 static const char* kBuild = "shipping"; | 31 static const char* kBuild = "shipping"; |
| 32 #else | 32 #else |
| 33 static const char* kBuild = "non-shipping"; | 33 static const char* kBuild = "non-shipping"; |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 class MockArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 36 class MockArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 37 public: | 37 public: |
| 38 void* Allocate(size_t length) override { return nullptr; } | 38 void* Allocate(size_t length) override { return nullptr; } |
| 39 void* AllocateUninitialized(size_t length) override { return nullptr; } | 39 void* AllocateUninitialized(size_t length) override { return nullptr; } |
| 40 void* Reserve(size_t length) override { return nullptr; } |
| 41 void Free(void* data, size_t length, AllocationMode mode) override {} |
| 40 void Free(void* p, size_t) override {} | 42 void Free(void* p, size_t) override {} |
| 43 void SetProtection(void* data, size_t length, |
| 44 Protection protection) override {} |
| 41 }; | 45 }; |
| 42 | 46 |
| 43 static int DumpHeapConstants(const char* argv0) { | 47 static int DumpHeapConstants(const char* argv0) { |
| 44 // Start up V8. | 48 // Start up V8. |
| 45 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 49 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
| 46 v8::V8::InitializePlatform(platform); | 50 v8::V8::InitializePlatform(platform); |
| 47 v8::V8::Initialize(); | 51 v8::V8::Initialize(); |
| 48 v8::V8::InitializeExternalStartupData(argv0); | 52 v8::V8::InitializeExternalStartupData(argv0); |
| 49 Isolate::CreateParams create_params; | 53 Isolate::CreateParams create_params; |
| 50 MockArrayBufferAllocator mock_arraybuffer_allocator; | 54 MockArrayBufferAllocator mock_arraybuffer_allocator; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // Teardown. | 128 // Teardown. |
| 125 isolate->Dispose(); | 129 isolate->Dispose(); |
| 126 v8::V8::ShutdownPlatform(); | 130 v8::V8::ShutdownPlatform(); |
| 127 delete platform; | 131 delete platform; |
| 128 return 0; | 132 return 0; |
| 129 } | 133 } |
| 130 | 134 |
| 131 } // namespace v8 | 135 } // namespace v8 |
| 132 | 136 |
| 133 int main(int argc, char* argv[]) { return v8::DumpHeapConstants(argv[0]); } | 137 int main(int argc, char* argv[]) { return v8::DumpHeapConstants(argv[0]); } |
| OLD | NEW |