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 Free(void* data, size_t length, AllocationMode mode) override {} | |
Eric Holk
2017/05/22 16:24:58
Could you go ahead and add empty implementations o
| |
40 void Free(void* p, size_t) override {} | 41 void Free(void* p, size_t) override {} |
41 }; | 42 }; |
42 | 43 |
43 static int DumpHeapConstants(const char* argv0) { | 44 static int DumpHeapConstants(const char* argv0) { |
44 // Start up V8. | 45 // Start up V8. |
45 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 46 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
46 v8::V8::InitializePlatform(platform); | 47 v8::V8::InitializePlatform(platform); |
47 v8::V8::Initialize(); | 48 v8::V8::Initialize(); |
48 v8::V8::InitializeExternalStartupData(argv0); | 49 v8::V8::InitializeExternalStartupData(argv0); |
49 Isolate::CreateParams create_params; | 50 Isolate::CreateParams create_params; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 // Teardown. | 125 // Teardown. |
125 isolate->Dispose(); | 126 isolate->Dispose(); |
126 v8::V8::ShutdownPlatform(); | 127 v8::V8::ShutdownPlatform(); |
127 delete platform; | 128 delete platform; |
128 return 0; | 129 return 0; |
129 } | 130 } |
130 | 131 |
131 } // namespace v8 | 132 } // namespace v8 |
132 | 133 |
133 int main(int argc, char* argv[]) { return v8::DumpHeapConstants(argv[0]); } | 134 int main(int argc, char* argv[]) { return v8::DumpHeapConstants(argv[0]); } |
OLD | NEW |