| 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 | 5 |
| 6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
| 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
| 8 #define V8_SHARED | 8 #define V8_SHARED |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 void* data = AllocateUninitialized(length); | 1532 void* data = AllocateUninitialized(length); |
| 1533 return data == NULL ? data : memset(data, 0, length); | 1533 return data == NULL ? data : memset(data, 0, length); |
| 1534 } | 1534 } |
| 1535 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } | 1535 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } |
| 1536 virtual void Free(void* data, size_t) { free(data); } | 1536 virtual void Free(void* data, size_t) { free(data); } |
| 1537 }; | 1537 }; |
| 1538 | 1538 |
| 1539 | 1539 |
| 1540 class MockArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 1540 class MockArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| 1541 public: | 1541 public: |
| 1542 virtual void* Allocate(size_t) OVERRIDE { | 1542 void* Allocate(size_t) OVERRIDE { return malloc(0); } |
| 1543 return malloc(0); | 1543 void* AllocateUninitialized(size_t length) OVERRIDE { return malloc(0); } |
| 1544 } | 1544 void Free(void* p, size_t) OVERRIDE { free(p); } |
| 1545 virtual void* AllocateUninitialized(size_t length) OVERRIDE { | |
| 1546 return malloc(0); | |
| 1547 } | |
| 1548 virtual void Free(void* p, size_t) OVERRIDE { | |
| 1549 free(p); | |
| 1550 } | |
| 1551 }; | 1545 }; |
| 1552 | 1546 |
| 1553 | 1547 |
| 1554 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 1548 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 1555 class StartupDataHandler { | 1549 class StartupDataHandler { |
| 1556 public: | 1550 public: |
| 1557 StartupDataHandler(const char* exec_path, const char* natives_blob, | 1551 StartupDataHandler(const char* exec_path, const char* natives_blob, |
| 1558 const char* snapshot_blob) { | 1552 const char* snapshot_blob) { |
| 1559 // If we have (at least one) explicitly given blob, use those. | 1553 // If we have (at least one) explicitly given blob, use those. |
| 1560 // If not, use the default blob locations next to the d8 binary. | 1554 // If not, use the default blob locations next to the d8 binary. |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 } | 1746 } |
| 1753 | 1747 |
| 1754 } // namespace v8 | 1748 } // namespace v8 |
| 1755 | 1749 |
| 1756 | 1750 |
| 1757 #ifndef GOOGLE3 | 1751 #ifndef GOOGLE3 |
| 1758 int main(int argc, char* argv[]) { | 1752 int main(int argc, char* argv[]) { |
| 1759 return v8::Shell::Main(argc, argv); | 1753 return v8::Shell::Main(argc, argv); |
| 1760 } | 1754 } |
| 1761 #endif | 1755 #endif |
| OLD | NEW |