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/base/platform/elapsed-timer.h" | 5 #include "src/base/platform/elapsed-timer.h" |
6 #include "src/signature.h" | 6 #include "src/signature.h" |
7 | 7 |
8 #include "src/bit-vector.h" | 8 #include "src/bit-vector.h" |
9 #include "src/flags.h" | 9 #include "src/flags.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 size > 0 ? reinterpret_cast<TFNode**>(zone_->New(size)) : nullptr; | 294 size > 0 ? reinterpret_cast<TFNode**>(zone_->New(size)) : nullptr; |
295 | 295 |
296 int pos = 0; | 296 int pos = 0; |
297 if (builder_) { | 297 if (builder_) { |
298 start = builder_->Start(param_count + 1); | 298 start = builder_->Start(param_count + 1); |
299 // Initialize parameters. | 299 // Initialize parameters. |
300 for (int i = 0; i < param_count; i++) { | 300 for (int i = 0; i < param_count; i++) { |
301 ssa_env->locals[pos++] = builder_->Param(i, sig->GetParam(i)); | 301 ssa_env->locals[pos++] = builder_->Param(i, sig->GetParam(i)); |
302 } | 302 } |
303 // Initialize int32 locals. | 303 // Initialize int32 locals. |
304 if (function_env_->local_int32_count > 0) { | 304 if (function_env_->local_i32_count > 0) { |
305 TFNode* zero = builder_->Int32Constant(0); | 305 TFNode* zero = builder_->Int32Constant(0); |
306 for (uint32_t i = 0; i < function_env_->local_int32_count; i++) { | 306 for (uint32_t i = 0; i < function_env_->local_i32_count; i++) { |
307 ssa_env->locals[pos++] = zero; | 307 ssa_env->locals[pos++] = zero; |
308 } | 308 } |
309 } | 309 } |
310 // Initialize int64 locals. | 310 // Initialize int64 locals. |
311 if (function_env_->local_int64_count > 0) { | 311 if (function_env_->local_i64_count > 0) { |
312 TFNode* zero = builder_->Int64Constant(0); | 312 TFNode* zero = builder_->Int64Constant(0); |
313 for (uint32_t i = 0; i < function_env_->local_int64_count; i++) { | 313 for (uint32_t i = 0; i < function_env_->local_i64_count; i++) { |
314 ssa_env->locals[pos++] = zero; | 314 ssa_env->locals[pos++] = zero; |
315 } | 315 } |
316 } | 316 } |
317 // Initialize float32 locals. | 317 // Initialize float32 locals. |
318 if (function_env_->local_float32_count > 0) { | 318 if (function_env_->local_f32_count > 0) { |
319 TFNode* zero = builder_->Float32Constant(0); | 319 TFNode* zero = builder_->Float32Constant(0); |
320 for (uint32_t i = 0; i < function_env_->local_float32_count; i++) { | 320 for (uint32_t i = 0; i < function_env_->local_f32_count; i++) { |
321 ssa_env->locals[pos++] = zero; | 321 ssa_env->locals[pos++] = zero; |
322 } | 322 } |
323 } | 323 } |
324 // Initialize float64 locals. | 324 // Initialize float64 locals. |
325 if (function_env_->local_float64_count > 0) { | 325 if (function_env_->local_f64_count > 0) { |
326 TFNode* zero = builder_->Float64Constant(0); | 326 TFNode* zero = builder_->Float64Constant(0); |
327 for (uint32_t i = 0; i < function_env_->local_float64_count; i++) { | 327 for (uint32_t i = 0; i < function_env_->local_f64_count; i++) { |
328 ssa_env->locals[pos++] = zero; | 328 ssa_env->locals[pos++] = zero; |
329 } | 329 } |
330 } | 330 } |
331 DCHECK_EQ(function_env_->total_locals, pos); | 331 DCHECK_EQ(function_env_->total_locals, pos); |
332 DCHECK_EQ(EnvironmentCount(), pos); | 332 DCHECK_EQ(EnvironmentCount(), pos); |
333 builder_->set_module(function_env_->module); | 333 builder_->set_module(function_env_->module); |
334 } | 334 } |
335 ssa_env->control = start; | 335 ssa_env->control = start; |
336 ssa_env->effect = start; | 336 ssa_env->effect = start; |
337 SetEnv("initial", ssa_env); | 337 SetEnv("initial", ssa_env); |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 | 1681 |
1682 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, FunctionEnv* env, | 1682 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, FunctionEnv* env, |
1683 const byte* start, const byte* end) { | 1683 const byte* start, const byte* end) { |
1684 LoopAssignmentAnalyzer analyzer(zone, env); | 1684 LoopAssignmentAnalyzer analyzer(zone, env); |
1685 return analyzer.Analyze(start, end); | 1685 return analyzer.Analyze(start, end); |
1686 } | 1686 } |
1687 | 1687 |
1688 } // namespace wasm | 1688 } // namespace wasm |
1689 } // namespace internal | 1689 } // namespace internal |
1690 } // namespace v8 | 1690 } // namespace v8 |
OLD | NEW |