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

Side by Side Diff: src/d8.cc

Issue 917653002: Catch graceful failures when deserializing in d8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: correctly rebase Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 // Defined when linking against shared lib on Windows. 6 // Defined when linking against shared lib on Windows.
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED)
8 #define V8_SHARED 8 #define V8_SHARED
9 #endif 9 #endif
10 10
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 CompileForCachedData(source, name, compile_options); 242 CompileForCachedData(source, name, compile_options);
243 ScriptCompiler::Source cached_source(source, origin, data); 243 ScriptCompiler::Source cached_source(source, origin, data);
244 if (compile_options == ScriptCompiler::kProduceCodeCache) { 244 if (compile_options == ScriptCompiler::kProduceCodeCache) {
245 compile_options = ScriptCompiler::kConsumeCodeCache; 245 compile_options = ScriptCompiler::kConsumeCodeCache;
246 } else if (compile_options == ScriptCompiler::kProduceParserCache) { 246 } else if (compile_options == ScriptCompiler::kProduceParserCache) {
247 compile_options = ScriptCompiler::kConsumeParserCache; 247 compile_options = ScriptCompiler::kConsumeParserCache;
248 } else { 248 } else {
249 DCHECK(false); // A new compile option? 249 DCHECK(false); // A new compile option?
250 } 250 }
251 if (data == NULL) compile_options = ScriptCompiler::kNoCompileOptions; 251 if (data == NULL) compile_options = ScriptCompiler::kNoCompileOptions;
252 return source_type == SCRIPT 252 Local<Script> result =
253 ? ScriptCompiler::Compile(isolate, &cached_source, compile_options) 253 source_type == SCRIPT
254 : ScriptCompiler::CompileModule(isolate, &cached_source, 254 ? ScriptCompiler::Compile(isolate, &cached_source, compile_options)
255 compile_options); 255 : ScriptCompiler::CompileModule(isolate, &cached_source,
256 compile_options);
257 CHECK(data == NULL || !data->rejected);
258 return result;
256 } 259 }
257 260
258 261
259 // Executes a string within the current v8 context. 262 // Executes a string within the current v8 context.
260 bool Shell::ExecuteString(Isolate* isolate, Handle<String> source, 263 bool Shell::ExecuteString(Isolate* isolate, Handle<String> source,
261 Handle<Value> name, bool print_result, 264 Handle<Value> name, bool print_result,
262 bool report_exceptions, SourceType source_type) { 265 bool report_exceptions, SourceType source_type) {
263 #ifndef V8_SHARED 266 #ifndef V8_SHARED
264 bool FLAG_debugger = i::FLAG_debugger; 267 bool FLAG_debugger = i::FLAG_debugger;
265 #else 268 #else
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 } 1693 }
1691 1694
1692 } // namespace v8 1695 } // namespace v8
1693 1696
1694 1697
1695 #ifndef GOOGLE3 1698 #ifndef GOOGLE3
1696 int main(int argc, char* argv[]) { 1699 int main(int argc, char* argv[]) {
1697 return v8::Shell::Main(argc, argv); 1700 return v8::Shell::Main(argc, argv);
1698 } 1701 }
1699 #endif 1702 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698