diff --git a/src/api.cc b/src/api.cc index 23f934751e..88cf2bcde0 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1046,7 +1046,7 @@ void ObjectTemplate::SetInternalFieldCount(int value) { ScriptData* ScriptData::PreCompile(const char* input, int length) { unibrow::Utf8InputBuffer<> buf(input, length); - return i::PreParse(&buf, NULL); + return i::PreParse(i::Handle(), &buf, NULL); } diff --git a/src/compiler.cc b/src/compiler.cc index 0cdfc9edf4..feff492404 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -266,7 +266,7 @@ Handle Compiler::Compile(Handle source, if (pre_data == NULL && source_length >= FLAG_min_preparse_length) { Access buf(&safe_string_input_buffer); buf->Reset(source.location()); - pre_data = PreParse(buf.value(), extension); + pre_data = PreParse(source, buf.value(), extension); } // Create a script object describing the script to be compiled. diff --git a/src/factory.cc b/src/factory.cc index 36554df732..bb6987bb8c 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -87,8 +87,10 @@ Handle Factory::NewStringFromUtf8(Vector string, } -Handle Factory::NewStringFromTwoByte(Vector string) { - CALL_HEAP_FUNCTION(Heap::AllocateStringFromTwoByte(string), String); +Handle Factory::NewStringFromTwoByte(Vector string, + PretenureFlag pretenure) { + CALL_HEAP_FUNCTION(Heap::AllocateStringFromTwoByte(string, pretenure), + String); } diff --git a/src/factory.h b/src/factory.h index 4db5d4e71b..ddf71dec7a 100644 --- a/src/factory.h +++ b/src/factory.h @@ -92,7 +92,8 @@ class Factory : public AllStatic { Vector str, PretenureFlag pretenure = NOT_TENURED); - static Handle NewStringFromTwoByte(Vector str); + static Handle NewStringFromTwoByte(Vector str, + PretenureFlag pretenure = NOT_TENURED); // Allocates and partially initializes a TwoByte String. The characters of // the string are uninitialized. Currently used in regexp code only, where diff --git a/src/parser.cc b/src/parser.cc index 348c12a4ac..e3b72a3848 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -97,7 +97,7 @@ class Parser { // Pre-parse the program from the character stream; returns true on // success, false if a stack-overflow happened during parsing. - bool PreParseProgram(unibrow::CharacterStream* stream); + bool PreParseProgram(Handle source, unibrow::CharacterStream* stream); void ReportMessage(const char* message, Vector args); virtual void ReportMessageAt(Scanner::Location loc, @@ -1167,13 +1167,14 @@ Parser::Parser(Handle