| 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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1531 ArrayBuffer::Contents& contents = array_buffer_contents[i]; | 1531 ArrayBuffer::Contents& contents = array_buffer_contents[i]; |
| 1532 Shell::array_buffer_allocator->Free(contents.Data(), contents.ByteLength()); | 1532 Shell::array_buffer_allocator->Free(contents.Data(), contents.ByteLength()); |
| 1533 } | 1533 } |
| 1534 } | 1534 } |
| 1535 | 1535 |
| 1536 | 1536 |
| 1537 void SerializationData::WriteTag(SerializationTag tag) { data.Add(tag); } | 1537 void SerializationData::WriteTag(SerializationTag tag) { data.Add(tag); } |
| 1538 | 1538 |
| 1539 | 1539 |
| 1540 void SerializationData::WriteMemory(const void* p, int length) { | 1540 void SerializationData::WriteMemory(const void* p, int length) { |
| 1541 i::Vector<uint8_t> block = data.AddBlock(0, length); | 1541 if (length > 0) { |
| 1542 memcpy(&block[0], p, length); | 1542 i::Vector<uint8_t> block = data.AddBlock(0, length); |
| 1543 memcpy(&block[0], p, length); |
| 1544 } |
| 1543 } | 1545 } |
| 1544 | 1546 |
| 1545 | 1547 |
| 1546 void SerializationData::WriteArrayBufferContents( | 1548 void SerializationData::WriteArrayBufferContents( |
| 1547 const ArrayBuffer::Contents& contents) { | 1549 const ArrayBuffer::Contents& contents) { |
| 1548 array_buffer_contents.Add(contents); | 1550 array_buffer_contents.Add(contents); |
| 1549 WriteTag(kSerializationTagTransferredArrayBuffer); | 1551 WriteTag(kSerializationTagTransferredArrayBuffer); |
| 1550 int index = array_buffer_contents.length() - 1; | 1552 int index = array_buffer_contents.length() - 1; |
| 1551 Write(index); | 1553 Write(index); |
| 1552 } | 1554 } |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 } | 2399 } |
| 2398 | 2400 |
| 2399 } // namespace v8 | 2401 } // namespace v8 |
| 2400 | 2402 |
| 2401 | 2403 |
| 2402 #ifndef GOOGLE3 | 2404 #ifndef GOOGLE3 |
| 2403 int main(int argc, char* argv[]) { | 2405 int main(int argc, char* argv[]) { |
| 2404 return v8::Shell::Main(argc, argv); | 2406 return v8::Shell::Main(argc, argv); |
| 2405 } | 2407 } |
| 2406 #endif | 2408 #endif |
| OLD | NEW |