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/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 size_t size = sizeof(TFNode*) * EnvironmentCount(); | 517 size_t size = sizeof(TFNode*) * EnvironmentCount(); |
518 ssa_env->state = SsaEnv::kReached; | 518 ssa_env->state = SsaEnv::kReached; |
519 ssa_env->locals = | 519 ssa_env->locals = |
520 size > 0 ? reinterpret_cast<TFNode**>(zone_->New(size)) : nullptr; | 520 size > 0 ? reinterpret_cast<TFNode**>(zone_->New(size)) : nullptr; |
521 | 521 |
522 if (builder_) { | 522 if (builder_) { |
523 start = builder_->Start(static_cast<int>(sig_->parameter_count() + 1)); | 523 start = builder_->Start(static_cast<int>(sig_->parameter_count() + 1)); |
524 // Initialize local variables. | 524 // Initialize local variables. |
525 uint32_t index = 0; | 525 uint32_t index = 0; |
526 while (index < sig_->parameter_count()) { | 526 while (index < sig_->parameter_count()) { |
527 ssa_env->locals[index] = builder_->Param(index, local_type_vec_[index]); | 527 ssa_env->locals[index] = builder_->Param(index); |
528 index++; | 528 index++; |
529 } | 529 } |
530 while (index < local_type_vec_.size()) { | 530 while (index < local_type_vec_.size()) { |
531 LocalType type = local_type_vec_[index]; | 531 LocalType type = local_type_vec_[index]; |
532 TFNode* node = DefaultValue(type); | 532 TFNode* node = DefaultValue(type); |
533 while (index < local_type_vec_.size() && | 533 while (index < local_type_vec_.size() && |
534 local_type_vec_[index] == type) { | 534 local_type_vec_[index] == type) { |
535 // Do a whole run of like-typed locals at a time. | 535 // Do a whole run of like-typed locals at a time. |
536 ssa_env->locals[index++] = node; | 536 ssa_env->locals[index++] = node; |
537 } | 537 } |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2059 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 2059 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
2060 const byte* start, const byte* end) { | 2060 const byte* start, const byte* end) { |
2061 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 2061 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
2062 WasmFullDecoder decoder(zone, nullptr, body); | 2062 WasmFullDecoder decoder(zone, nullptr, body); |
2063 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 2063 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
2064 } | 2064 } |
2065 | 2065 |
2066 } // namespace wasm | 2066 } // namespace wasm |
2067 } // namespace internal | 2067 } // namespace internal |
2068 } // namespace v8 | 2068 } // namespace v8 |
OLD | NEW |