| Index: src/preparse-data.cc
|
| diff --git a/src/preparse-data.cc b/src/preparse-data.cc
|
| index 50e91201b2258afb7a228d4db32fa5009070cee2..3a95adfd28a808fa73414ac6981f2cb87c963d7f 100644
|
| --- a/src/preparse-data.cc
|
| +++ b/src/preparse-data.cc
|
| @@ -59,17 +59,21 @@ void CompleteParserRecorder::WriteString(Vector<const char> str) {
|
| }
|
|
|
|
|
| -Vector<unsigned> CompleteParserRecorder::ExtractData() {
|
| +ScriptData* CompleteParserRecorder::GetScriptData() {
|
| int function_size = function_store_.size();
|
| int total_size = PreparseDataConstants::kHeaderSize + function_size;
|
| - Vector<unsigned> data = Vector<unsigned>::New(total_size);
|
| + unsigned* data = NewArray<unsigned>(total_size);
|
| preamble_[PreparseDataConstants::kFunctionsSizeOffset] = function_size;
|
| - MemCopy(data.start(), preamble_, sizeof(preamble_));
|
| + MemCopy(data, preamble_, sizeof(preamble_));
|
| if (function_size > 0) {
|
| - function_store_.WriteTo(data.SubVector(PreparseDataConstants::kHeaderSize,
|
| - total_size));
|
| + function_store_.WriteTo(Vector<unsigned>(
|
| + data + PreparseDataConstants::kHeaderSize, function_size));
|
| }
|
| - return data;
|
| + ASSERT(IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment));
|
| + ScriptData* result = new ScriptData(reinterpret_cast<byte*>(data),
|
| + total_size * sizeof(unsigned));
|
| + result->AcquireDataOwnership();
|
| + return result;
|
| }
|
|
|
|
|
|
|