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

Side by Side Diff: src/asmjs/asm-wasm-builder.cc

Issue 2614563002: [wasm][asm.js] Cancel exception and rethrow on parse failure. (Closed)
Patch Set: fix Created 3 years, 11 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 | « src/asmjs/asm-typer.cc ('k') | test/mjsunit/asm/regress-674089.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 // Required to get M_E etc. in MSVC. 7 // Required to get M_E etc. in MSVC.
8 #if defined(_WIN32) 8 #if defined(_WIN32)
9 #define _USE_MATH_DEFINES 9 #define _USE_MATH_DEFINES
10 #endif 10 #endif
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 info.set_language_mode(decl->fun()->scope()->language_mode()); 156 info.set_language_mode(decl->fun()->scope()->language_mode());
157 info.set_allow_lazy_parsing(false); 157 info.set_allow_lazy_parsing(false);
158 info.set_function_literal_id(shared->function_literal_id()); 158 info.set_function_literal_id(shared->function_literal_id());
159 info.set_ast_value_factory(ast_value_factory_); 159 info.set_ast_value_factory(ast_value_factory_);
160 info.set_ast_value_factory_owned(false); 160 info.set_ast_value_factory_owned(false);
161 // Create fresh function scope to use to parse the function in. 161 // Create fresh function scope to use to parse the function in.
162 new_func_scope = new (info.zone()) DeclarationScope( 162 new_func_scope = new (info.zone()) DeclarationScope(
163 info.zone(), decl->fun()->scope()->outer_scope(), FUNCTION_SCOPE); 163 info.zone(), decl->fun()->scope()->outer_scope(), FUNCTION_SCOPE);
164 info.set_asm_function_scope(new_func_scope); 164 info.set_asm_function_scope(new_func_scope);
165 if (!Compiler::ParseAndAnalyze(&info)) { 165 if (!Compiler::ParseAndAnalyze(&info)) {
166 decl->fun()->scope()->outer_scope()->RemoveInnerScope(new_func_scope);
167 if (isolate_->has_pending_exception()) {
168 isolate_->clear_pending_exception();
169 }
170 typer_->TriggerParsingError();
166 typer_failed_ = true; 171 typer_failed_ = true;
167 return; 172 return;
168 } 173 }
169 FunctionLiteral* func = info.literal(); 174 FunctionLiteral* func = info.literal();
170 DCHECK_NOT_NULL(func); 175 DCHECK_NOT_NULL(func);
171 decl->set_fun(func); 176 decl->set_fun(func);
172 } 177 }
173 if (!typer_->ValidateInnerFunction(decl)) { 178 if (!typer_->ValidateInnerFunction(decl)) {
174 typer_failed_ = true; 179 typer_failed_ = true;
175 decl->set_fun(old_func); 180 decl->set_fun(old_func);
(...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after
2001 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); 2006 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer);
2002 return {module_buffer, asm_offsets_buffer, success}; 2007 return {module_buffer, asm_offsets_buffer, success};
2003 } 2008 }
2004 2009
2005 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; 2010 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__";
2006 const char* AsmWasmBuilder::single_function_name = "__single_function__"; 2011 const char* AsmWasmBuilder::single_function_name = "__single_function__";
2007 2012
2008 } // namespace wasm 2013 } // namespace wasm
2009 } // namespace internal 2014 } // namespace internal
2010 } // namespace v8 2015 } // namespace v8
OLDNEW
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | test/mjsunit/asm/regress-674089.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698