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

Side by Side Diff: src/compiler.cc

Issue 932603002: [turbofan] Clear pending exception from unsuccessful compilation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | test/mjsunit/regress/regress-458987.js » ('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 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/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/ast-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 VMState<COMPILER> state(isolate); 860 VMState<COMPILER> state(isolate);
861 PostponeInterruptsScope postpone(isolate); 861 PostponeInterruptsScope postpone(isolate);
862 862
863 info.SetOptimizing(BailoutId::None(), handle(function->shared()->code())); 863 info.SetOptimizing(BailoutId::None(), handle(function->shared()->code()));
864 info.MarkAsContextSpecializing(); 864 info.MarkAsContextSpecializing();
865 865
866 if (GetOptimizedCodeNow(&info)) { 866 if (GetOptimizedCodeNow(&info)) {
867 DCHECK(function->shared()->is_compiled()); 867 DCHECK(function->shared()->is_compiled());
868 return info.code(); 868 return info.code();
869 } 869 }
870 // We have failed compilation. If there was an exception clear it so that
871 // we can compile unoptimized code.
872 if (isolate->has_pending_exception()) isolate->clear_pending_exception();
870 } 873 }
871 874
872 if (function->shared()->is_compiled()) { 875 if (function->shared()->is_compiled()) {
873 return Handle<Code>(function->shared()->code()); 876 return Handle<Code>(function->shared()->code());
874 } 877 }
875 878
876 CompilationInfoWithZone info(function); 879 CompilationInfoWithZone info(function);
877 Handle<Code> result; 880 Handle<Code> result;
878 ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info), 881 ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCodeCommon(&info),
879 Code); 882 Code);
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 } 1524 }
1522 1525
1523 1526
1524 #if DEBUG 1527 #if DEBUG
1525 void CompilationInfo::PrintAstForTesting() { 1528 void CompilationInfo::PrintAstForTesting() {
1526 PrintF("--- Source from AST ---\n%s\n", 1529 PrintF("--- Source from AST ---\n%s\n",
1527 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1530 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1528 } 1531 }
1529 #endif 1532 #endif
1530 } } // namespace v8::internal 1533 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-458987.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698