| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5090 } | 5090 } |
| 5091 | 5091 |
| 5092 | 5092 |
| 5093 ScriptDataImpl* PreParse(Handle<String> source, | 5093 ScriptDataImpl* PreParse(Handle<String> source, |
| 5094 unibrow::CharacterStream* stream, | 5094 unibrow::CharacterStream* stream, |
| 5095 v8::Extension* extension) { | 5095 v8::Extension* extension) { |
| 5096 Handle<Script> no_script; | 5096 Handle<Script> no_script; |
| 5097 bool allow_natives_syntax = | 5097 bool allow_natives_syntax = |
| 5098 always_allow_natives_syntax || | 5098 always_allow_natives_syntax || |
| 5099 FLAG_allow_natives_syntax || | 5099 FLAG_allow_natives_syntax || |
| 5100 Bootstrapper::IsActive(); | 5100 Isolate::Current()->bootstrapper()->IsActive(); |
| 5101 PreParser parser(no_script, allow_natives_syntax, extension); | 5101 PreParser parser(no_script, allow_natives_syntax, extension); |
| 5102 if (!parser.PreParseProgram(source, stream)) return NULL; | 5102 if (!parser.PreParseProgram(source, stream)) return NULL; |
| 5103 // The list owns the backing store so we need to clone the vector. | 5103 // The list owns the backing store so we need to clone the vector. |
| 5104 // That way, the result will be exactly the right size rather than | 5104 // That way, the result will be exactly the right size rather than |
| 5105 // the expected 50% too large. | 5105 // the expected 50% too large. |
| 5106 Vector<unsigned> store = parser.recorder()->store()->ToVector().Clone(); | 5106 Vector<unsigned> store = parser.recorder()->store()->ToVector().Clone(); |
| 5107 return new ScriptDataImpl(store); | 5107 return new ScriptDataImpl(store); |
| 5108 } | 5108 } |
| 5109 | 5109 |
| 5110 | 5110 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 5131 | 5131 |
| 5132 | 5132 |
| 5133 FunctionLiteral* MakeAST(bool compile_in_global_context, | 5133 FunctionLiteral* MakeAST(bool compile_in_global_context, |
| 5134 Handle<Script> script, | 5134 Handle<Script> script, |
| 5135 v8::Extension* extension, | 5135 v8::Extension* extension, |
| 5136 ScriptDataImpl* pre_data, | 5136 ScriptDataImpl* pre_data, |
| 5137 bool is_json) { | 5137 bool is_json) { |
| 5138 bool allow_natives_syntax = | 5138 bool allow_natives_syntax = |
| 5139 always_allow_natives_syntax || | 5139 always_allow_natives_syntax || |
| 5140 FLAG_allow_natives_syntax || | 5140 FLAG_allow_natives_syntax || |
| 5141 Bootstrapper::IsActive(); | 5141 Isolate::Current()->bootstrapper()->IsActive(); |
| 5142 AstBuildingParser parser(script, allow_natives_syntax, extension, pre_data); | 5142 AstBuildingParser parser(script, allow_natives_syntax, extension, pre_data); |
| 5143 if (pre_data != NULL && pre_data->has_error()) { | 5143 if (pre_data != NULL && pre_data->has_error()) { |
| 5144 Scanner::Location loc = pre_data->MessageLocation(); | 5144 Scanner::Location loc = pre_data->MessageLocation(); |
| 5145 const char* message = pre_data->BuildMessage(); | 5145 const char* message = pre_data->BuildMessage(); |
| 5146 Vector<const char*> args = pre_data->BuildArgs(); | 5146 Vector<const char*> args = pre_data->BuildArgs(); |
| 5147 parser.ReportMessageAt(loc, message, args); | 5147 parser.ReportMessageAt(loc, message, args); |
| 5148 DeleteArray(message); | 5148 DeleteArray(message); |
| 5149 for (int i = 0; i < args.length(); i++) { | 5149 for (int i = 0; i < args.length(); i++) { |
| 5150 DeleteArray(args[i]); | 5150 DeleteArray(args[i]); |
| 5151 } | 5151 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 5179 parser.ParseLazy(script_source, name, | 5179 parser.ParseLazy(script_source, name, |
| 5180 start_position, end_position, is_expression); | 5180 start_position, end_position, is_expression); |
| 5181 return result; | 5181 return result; |
| 5182 } | 5182 } |
| 5183 | 5183 |
| 5184 | 5184 |
| 5185 #undef NEW | 5185 #undef NEW |
| 5186 | 5186 |
| 5187 | 5187 |
| 5188 } } // namespace v8::internal | 5188 } } // namespace v8::internal |
| OLD | NEW |