| Index: src/preparse-data.cc
|
| diff --git a/src/preparse-data.cc b/src/preparse-data.cc
|
| index c101493c9f924d22a934128db77c2fa5c8eaf4a0..b129ab833feeb054748b64b67548afd8b2809d7b 100644
|
| --- a/src/preparse-data.cc
|
| +++ b/src/preparse-data.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "src/ast-value-factory.h"
|
| #include "src/base/logging.h"
|
| #include "src/compiler.h"
|
| #include "src/globals.h"
|
| @@ -14,7 +15,7 @@ namespace internal {
|
|
|
|
|
| CompleteParserRecorder::CompleteParserRecorder()
|
| - : function_store_(0) {
|
| + : function_store_(0), next_function_calls_eval_(false) {
|
| preamble_[PreparseDataConstants::kMagicOffset] =
|
| PreparseDataConstants::kMagicNumber;
|
| preamble_[PreparseDataConstants::kVersionOffset] =
|
| @@ -59,6 +60,23 @@ void CompleteParserRecorder::WriteString(Vector<const char> str) {
|
| }
|
|
|
|
|
| +void CompleteParserRecorder::WriteString(const AstRawString* str) {
|
| + const bool is_one_byte = str->is_one_byte();
|
| + function_store_.Add(is_one_byte);
|
| + int byte_length = str->length();
|
| + if (!is_one_byte) {
|
| + byte_length *= 2;
|
| + }
|
| + function_store_.Add(byte_length);
|
| + DCHECK(byte_length > 0);
|
| + const int word_length =
|
| + 1 + (((byte_length * sizeof(unsigned char)) - 1) / sizeof(unsigned));
|
| + Vector<unsigned char> dest =
|
| + Vector<unsigned char>::cast(function_store_.AddBlock(word_length, 0));
|
| + MemCopy(dest.start(), str->raw_data(), byte_length);
|
| +}
|
| +
|
| +
|
| ScriptData* CompleteParserRecorder::GetScriptData() {
|
| int function_size = function_store_.size();
|
| int total_size = PreparseDataConstants::kHeaderSize + function_size;
|
|
|