| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/ast-literal-reindexer.h" | 9 #include "src/ast-literal-reindexer.h" |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 DCHECK_EQ(scanner_.peek_location().beg_pos, source->length()); | 979 DCHECK_EQ(scanner_.peek_location().beg_pos, source->length()); |
| 980 } | 980 } |
| 981 HandleSourceURLComments(isolate, info->script()); | 981 HandleSourceURLComments(isolate, info->script()); |
| 982 | 982 |
| 983 if (FLAG_trace_parse && result != NULL) { | 983 if (FLAG_trace_parse && result != NULL) { |
| 984 double ms = timer.Elapsed().InMillisecondsF(); | 984 double ms = timer.Elapsed().InMillisecondsF(); |
| 985 if (info->is_eval()) { | 985 if (info->is_eval()) { |
| 986 PrintF("[parsing eval"); | 986 PrintF("[parsing eval"); |
| 987 } else if (info->script()->name()->IsString()) { | 987 } else if (info->script()->name()->IsString()) { |
| 988 String* name = String::cast(info->script()->name()); | 988 String* name = String::cast(info->script()->name()); |
| 989 SmartArrayPointer<char> name_chars = name->ToCString(); | 989 base::SmartArrayPointer<char> name_chars = name->ToCString(); |
| 990 PrintF("[parsing script: %s", name_chars.get()); | 990 PrintF("[parsing script: %s", name_chars.get()); |
| 991 } else { | 991 } else { |
| 992 PrintF("[parsing script"); | 992 PrintF("[parsing script"); |
| 993 } | 993 } |
| 994 PrintF(" - took %0.3f ms]\n", ms); | 994 PrintF(" - took %0.3f ms]\n", ms); |
| 995 } | 995 } |
| 996 if (produce_cached_parse_data()) { | 996 if (produce_cached_parse_data()) { |
| 997 if (result != NULL) *info->cached_data() = recorder.GetScriptData(); | 997 if (result != NULL) *info->cached_data() = recorder.GetScriptData(); |
| 998 log_ = NULL; | 998 log_ = NULL; |
| 999 } | 999 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 result = ParseLazy(isolate, info, &stream); | 1118 result = ParseLazy(isolate, info, &stream); |
| 1119 } else { | 1119 } else { |
| 1120 GenericStringUtf16CharacterStream stream(source, | 1120 GenericStringUtf16CharacterStream stream(source, |
| 1121 shared_info->start_position(), | 1121 shared_info->start_position(), |
| 1122 shared_info->end_position()); | 1122 shared_info->end_position()); |
| 1123 result = ParseLazy(isolate, info, &stream); | 1123 result = ParseLazy(isolate, info, &stream); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 if (FLAG_trace_parse && result != NULL) { | 1126 if (FLAG_trace_parse && result != NULL) { |
| 1127 double ms = timer.Elapsed().InMillisecondsF(); | 1127 double ms = timer.Elapsed().InMillisecondsF(); |
| 1128 SmartArrayPointer<char> name_chars = result->debug_name()->ToCString(); | 1128 base::SmartArrayPointer<char> name_chars = |
| 1129 result->debug_name()->ToCString(); |
| 1129 PrintF("[parsing function: %s - took %0.3f ms]\n", name_chars.get(), ms); | 1130 PrintF("[parsing function: %s - took %0.3f ms]\n", name_chars.get(), ms); |
| 1130 } | 1131 } |
| 1131 return result; | 1132 return result; |
| 1132 } | 1133 } |
| 1133 | 1134 |
| 1134 | 1135 |
| 1135 FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info, | 1136 FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info, |
| 1136 Utf16CharacterStream* source) { | 1137 Utf16CharacterStream* source) { |
| 1137 Handle<SharedFunctionInfo> shared_info = info->shared_info(); | 1138 Handle<SharedFunctionInfo> shared_info = info->shared_info(); |
| 1138 scanner_.Initialize(source); | 1139 scanner_.Initialize(source); |
| (...skipping 4805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5944 Expression* Parser::SpreadCallNew(Expression* function, | 5945 Expression* Parser::SpreadCallNew(Expression* function, |
| 5945 ZoneList<v8::internal::Expression*>* args, | 5946 ZoneList<v8::internal::Expression*>* args, |
| 5946 int pos) { | 5947 int pos) { |
| 5947 args->InsertAt(0, function, zone()); | 5948 args->InsertAt(0, function, zone()); |
| 5948 | 5949 |
| 5949 return factory()->NewCallRuntime( | 5950 return factory()->NewCallRuntime( |
| 5950 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 5951 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
| 5951 } | 5952 } |
| 5952 } // namespace internal | 5953 } // namespace internal |
| 5953 } // namespace v8 | 5954 } // namespace v8 |
| OLD | NEW |