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

Side by Side Diff: src/wasm/ast-decoder.cc

Issue 1890803002: [wasm] Generate source position information (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-throw-error
Patch Set: some doc and fixes Created 4 years, 8 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
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/signature.h" 5 #include "src/signature.h"
6 6
7 #include "src/bit-vector.h" 7 #include "src/bit-vector.h"
8 #include "src/flags.h" 8 #include "src/flags.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 if (pc_ >= limit_) { 628 if (pc_ >= limit_) {
629 // End of code reached or exceeded. 629 // End of code reached or exceeded.
630 if (pc_ > limit_ && ok()) { 630 if (pc_ > limit_ && ok()) {
631 error("Beyond end of code"); 631 error("Beyond end of code");
632 } 632 }
633 return; 633 return;
634 } 634 }
635 continue; // back to decoding loop. 635 continue; // back to decoding loop.
636 } 636 }
637 637
638 DCHECK_EQ(pc_ - start_, static_cast<int>(pc_ - start_));
639 if (builder_)
640 builder_->SetCurrentSourcePosition(static_cast<int>(pc_ - start_));
641
638 switch (opcode) { 642 switch (opcode) {
639 case kExprNop: 643 case kExprNop:
640 Leaf(kAstStmt); 644 Leaf(kAstStmt);
641 break; 645 break;
642 case kExprBlock: { 646 case kExprBlock: {
643 BlockCountOperand operand(this, pc_); 647 BlockCountOperand operand(this, pc_);
644 if (operand.count < 1) { 648 if (operand.count < 1) {
645 Leaf(kAstStmt); 649 Leaf(kAstStmt);
646 } else { 650 } else {
647 Shift(kAstEnd, operand.count); 651 Shift(kAstEnd, operand.count);
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, 1791 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals,
1788 const byte* start, const byte* end) { 1792 const byte* start, const byte* end) {
1789 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; 1793 FunctionBody body = {nullptr, nullptr, nullptr, start, end};
1790 SR_WasmDecoder decoder(zone, nullptr, body); 1794 SR_WasmDecoder decoder(zone, nullptr, body);
1791 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); 1795 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals);
1792 } 1796 }
1793 1797
1794 } // namespace wasm 1798 } // namespace wasm
1795 } // namespace internal 1799 } // namespace internal
1796 } // namespace v8 1800 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698