Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: src/parser.cc

Issue 6677076: Merge up to bleeding_edge r7201 to isolates branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Fix lint. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/platform.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5117 matching lines...) Expand 10 before | Expand all | Expand 10 after
5128 5128
5129 bool ParserApi::Parse(CompilationInfo* info) { 5129 bool ParserApi::Parse(CompilationInfo* info) {
5130 ASSERT(info->function() == NULL); 5130 ASSERT(info->function() == NULL);
5131 FunctionLiteral* result = NULL; 5131 FunctionLiteral* result = NULL;
5132 Handle<Script> script = info->script(); 5132 Handle<Script> script = info->script();
5133 if (info->is_lazy()) { 5133 if (info->is_lazy()) {
5134 Parser parser(script, true, NULL, NULL); 5134 Parser parser(script, true, NULL, NULL);
5135 result = parser.ParseLazy(info); 5135 result = parser.ParseLazy(info);
5136 } else { 5136 } else {
5137 bool allow_natives_syntax = 5137 bool allow_natives_syntax =
5138 FLAG_allow_natives_syntax || 5138 info->allows_natives_syntax() || FLAG_allow_natives_syntax;
5139 info->isolate()->bootstrapper()->IsActive();
5140 ScriptDataImpl* pre_data = info->pre_parse_data(); 5139 ScriptDataImpl* pre_data = info->pre_parse_data();
5141 Parser parser(script, allow_natives_syntax, info->extension(), pre_data); 5140 Parser parser(script, allow_natives_syntax, info->extension(), pre_data);
5142 if (pre_data != NULL && pre_data->has_error()) { 5141 if (pre_data != NULL && pre_data->has_error()) {
5143 Scanner::Location loc = pre_data->MessageLocation(); 5142 Scanner::Location loc = pre_data->MessageLocation();
5144 const char* message = pre_data->BuildMessage(); 5143 const char* message = pre_data->BuildMessage();
5145 Vector<const char*> args = pre_data->BuildArgs(); 5144 Vector<const char*> args = pre_data->BuildArgs();
5146 parser.ReportMessageAt(loc, message, args); 5145 parser.ReportMessageAt(loc, message, args);
5147 DeleteArray(message); 5146 DeleteArray(message);
5148 for (int i = 0; i < args.length(); i++) { 5147 for (int i = 0; i < args.length(); i++) {
5149 DeleteArray(args[i]); 5148 DeleteArray(args[i]);
5150 } 5149 }
5151 DeleteArray(args.start()); 5150 DeleteArray(args.start());
5152 ASSERT(info->isolate()->has_pending_exception()); 5151 ASSERT(info->isolate()->has_pending_exception());
5153 } else { 5152 } else {
5154 Handle<String> source = Handle<String>(String::cast(script->source())); 5153 Handle<String> source = Handle<String>(String::cast(script->source()));
5155 result = parser.ParseProgram(source, 5154 result = parser.ParseProgram(source,
5156 info->is_global(), 5155 info->is_global(),
5157 info->StrictMode()); 5156 info->StrictMode());
5158 } 5157 }
5159 } 5158 }
5160 5159
5161 info->SetFunction(result); 5160 info->SetFunction(result);
5162 return (result != NULL); 5161 return (result != NULL);
5163 } 5162 }
5164 5163
5165 } } // namespace v8::internal 5164 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698