| OLD | NEW |
| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 TFNode* DefaultValue(LocalType type) { | 567 TFNode* DefaultValue(LocalType type) { |
| 568 switch (type) { | 568 switch (type) { |
| 569 case kAstI32: | 569 case kAstI32: |
| 570 return builder_->Int32Constant(0); | 570 return builder_->Int32Constant(0); |
| 571 case kAstI64: | 571 case kAstI64: |
| 572 return builder_->Int64Constant(0); | 572 return builder_->Int64Constant(0); |
| 573 case kAstF32: | 573 case kAstF32: |
| 574 return builder_->Float32Constant(0); | 574 return builder_->Float32Constant(0); |
| 575 case kAstF64: | 575 case kAstF64: |
| 576 return builder_->Float64Constant(0); | 576 return builder_->Float64Constant(0); |
| 577 case kAstS128: |
| 578 return builder_->DefaultS128Value(); |
| 577 default: | 579 default: |
| 578 UNREACHABLE(); | 580 UNREACHABLE(); |
| 579 return nullptr; | 581 return nullptr; |
| 580 } | 582 } |
| 581 } | 583 } |
| 582 | 584 |
| 583 char* indentation() { | 585 char* indentation() { |
| 584 static const int kMaxIndent = 64; | 586 static const int kMaxIndent = 64; |
| 585 static char bytes[kMaxIndent + 1]; | 587 static char bytes[kMaxIndent + 1]; |
| 586 for (int i = 0; i < kMaxIndent; ++i) bytes[i] = ' '; | 588 for (int i = 0; i < kMaxIndent; ++i) bytes[i] = ' '; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 613 break; | 615 break; |
| 614 case kLocalI64: | 616 case kLocalI64: |
| 615 type = kAstI64; | 617 type = kAstI64; |
| 616 break; | 618 break; |
| 617 case kLocalF32: | 619 case kLocalF32: |
| 618 type = kAstF32; | 620 type = kAstF32; |
| 619 break; | 621 break; |
| 620 case kLocalF64: | 622 case kLocalF64: |
| 621 type = kAstF64; | 623 type = kAstF64; |
| 622 break; | 624 break; |
| 625 case kLocalS128: |
| 626 type = kAstS128; |
| 627 break; |
| 623 default: | 628 default: |
| 624 error(pc_ - 1, "invalid local type"); | 629 error(pc_ - 1, "invalid local type"); |
| 625 return; | 630 return; |
| 626 } | 631 } |
| 627 local_type_vec_.insert(local_type_vec_.end(), count, type); | 632 local_type_vec_.insert(local_type_vec_.end(), count, type); |
| 628 } | 633 } |
| 629 total_locals_ = local_type_vec_.size(); | 634 total_locals_ = local_type_vec_.size(); |
| 630 } | 635 } |
| 631 | 636 |
| 632 // Decodes the body of a function. | 637 // Decodes the body of a function. |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1857 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
| 1853 const byte* start, const byte* end) { | 1858 const byte* start, const byte* end) { |
| 1854 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1859 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
| 1855 WasmFullDecoder decoder(zone, nullptr, body); | 1860 WasmFullDecoder decoder(zone, nullptr, body); |
| 1856 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1861 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
| 1857 } | 1862 } |
| 1858 | 1863 |
| 1859 } // namespace wasm | 1864 } // namespace wasm |
| 1860 } // namespace internal | 1865 } // namespace internal |
| 1861 } // namespace v8 | 1866 } // namespace v8 |
| OLD | NEW |