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() {
source->TryFlatten();
scanner_.Initialize(source, JAVASCRIPT);
ASSERT(target_stack_ == NULL);
+ if (pre_data_ != NULL) pre_data_->Initialize();
// Compute the parsing mode.
mode_ = FLAG_lazy ? PARSE_LAZILY : PARSE_EAGERLY;
void ScriptDataImpl::Initialize() {
+ // Prepares state for use.
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]);
public:
explicit ScriptDataImpl(Vector<unsigned> store)
: store_(store),
- function_index_(kHeaderSize),
- owns_store_(true) {
- Initialize();
- }
+ owns_store_(true) { }
// Create an empty ScriptDataImpl that is guaranteed to not satisfy
// a SanityCheck.
ScriptDataImpl(const char* backing_store, int length)
: store_(reinterpret_cast<unsigned*>(const_cast<char*>(backing_store)),
length / sizeof(unsigned)),
- function_index_(kHeaderSize),
owns_store_(false) {
ASSERT_EQ(0, reinterpret_cast<intptr_t>(backing_store) % sizeof(unsigned));
- Initialize();
}
// Read strings written by ParserRecorder::WriteString.