Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 856c474066191acc0691432f9eecabf67a19e499..a29339b46669f3e4ed888e4a16ce8d03301c069f 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -1001,7 +1001,7 @@ class CompleteParserRecorder: public PartialParserRecorder { |
Vector<Vector<const char> > symbol = symbol_entries_.AddBlock(1, literal); |
entry->key = &symbol[0]; |
} |
- symbol_store_.Add(id - 1); |
+ WriteNumber(id - 1); |
} |
virtual Vector<unsigned> ExtractData() { |
@@ -1503,6 +1503,8 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source, |
source->TryFlatten(); |
scanner_.Initialize(source, JAVASCRIPT); |
ASSERT(target_stack_ == NULL); |
+ if (pre_data_ != NULL) pre_data_->Initialize(); |
+ |
Rico
2010/09/17 12:53:24
Delete extra blank line
|
// Compute the parsing mode. |
mode_ = FLAG_lazy ? PARSE_LAZILY : PARSE_EAGERLY; |
@@ -5492,7 +5494,9 @@ ScriptDataImpl* PartialPreParse(Handle<String> source, |
void ScriptDataImpl::Initialize() { |
+ // Resets pointers to initial value, if reusing a pre-used ScriptData. |
Rico
2010/09/17 12:53:24
value->values
Lasse Reichstein
2010/09/17 12:55:13
Reworded to "Prepares script data for reading."
|
if (store_.length() >= kHeaderSize) { |
+ function_index_ = kHeaderSize; |
int symbol_data_offset = kHeaderSize + store_[kFunctionsSizeOffset]; |
if (store_.length() > symbol_data_offset) { |
symbol_data_ = reinterpret_cast<byte*>(&store_[symbol_data_offset]); |