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

Side by Side Diff: src/asmjs/asm-typer.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.h ('k') | src/asmjs/asm-wasm-builder.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/asmjs/asm-typer.h" 5 #include "src/asmjs/asm-typer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 562
563 bool AsmTyper::ValidateAfterFunctionsPhase() { 563 bool AsmTyper::ValidateAfterFunctionsPhase() {
564 if (!AsmType::None()->IsExactly(ValidateModuleAfterFunctionsPhase(root_))) { 564 if (!AsmType::None()->IsExactly(ValidateModuleAfterFunctionsPhase(root_))) {
565 return true; 565 return true;
566 } 566 }
567 return false; 567 return false;
568 } 568 }
569 569
570 void AsmTyper::ClearFunctionNodeTypes() { function_node_types_.clear(); } 570 void AsmTyper::ClearFunctionNodeTypes() { function_node_types_.clear(); }
571 571
572 AsmType* AsmTyper::TriggerParsingError() { FAIL(root_, "Parsing error"); }
573
572 namespace { 574 namespace {
573 bool IsUseAsmDirective(Statement* first_statement) { 575 bool IsUseAsmDirective(Statement* first_statement) {
574 ExpressionStatement* use_asm = first_statement->AsExpressionStatement(); 576 ExpressionStatement* use_asm = first_statement->AsExpressionStatement();
575 if (use_asm == nullptr) { 577 if (use_asm == nullptr) {
576 return false; 578 return false;
577 } 579 }
578 580
579 Literal* use_asm_literal = use_asm->expression()->AsLiteral(); 581 Literal* use_asm_literal = use_asm->expression()->AsLiteral();
580 582
581 if (use_asm_literal == nullptr) { 583 if (use_asm_literal == nullptr) {
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2934 "Heap view creation parameter should be the module's heap parameter."); 2936 "Heap view creation parameter should be the module's heap parameter.");
2935 } 2937 }
2936 2938
2937 DCHECK(heap_view_info->type()->IsA(AsmType::Heap())); 2939 DCHECK(heap_view_info->type()->IsA(AsmType::Heap()));
2938 return heap_view_info->type(); 2940 return heap_view_info->type();
2939 } 2941 }
2940 2942
2941 } // namespace wasm 2943 } // namespace wasm
2942 } // namespace internal 2944 } // namespace internal
2943 } // namespace v8 2945 } // namespace v8
OLDNEW
« no previous file with comments | « src/asmjs/asm-typer.h ('k') | src/asmjs/asm-wasm-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698