| 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 14 matching lines...) Expand all Loading... |
| 25 #if DEBUG | 25 #if DEBUG |
| 26 #define TRACE(...) \ | 26 #define TRACE(...) \ |
| 27 do { \ | 27 do { \ |
| 28 if (FLAG_trace_wasm_decoder) PrintF(__VA_ARGS__); \ | 28 if (FLAG_trace_wasm_decoder) PrintF(__VA_ARGS__); \ |
| 29 } while (false) | 29 } while (false) |
| 30 #else | 30 #else |
| 31 #define TRACE(...) | 31 #define TRACE(...) |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #define CHECK_PROTOTYPE_OPCODE(flag) \ | 34 #define CHECK_PROTOTYPE_OPCODE(flag) \ |
| 35 if (module_ && module_->origin == kAsmJsOrigin) { \ |
| 36 error("Opcode not supported for asmjs modules"); \ |
| 37 } \ |
| 35 if (!FLAG_##flag) { \ | 38 if (!FLAG_##flag) { \ |
| 36 error("Invalid opcode (enable with --" #flag ")"); \ | 39 error("Invalid opcode (enable with --" #flag ")"); \ |
| 37 break; \ | 40 break; \ |
| 38 } | 41 } |
| 39 // TODO(titzer): this is only for intermediate migration. | 42 // TODO(titzer): this is only for intermediate migration. |
| 40 #define IMPLICIT_FUNCTION_END 1 | 43 #define IMPLICIT_FUNCTION_END 1 |
| 41 | 44 |
| 42 // An SsaEnv environment carries the current local variable renaming | 45 // An SsaEnv environment carries the current local variable renaming |
| 43 // as well as the current effect and control dependency in the TF graph. | 46 // as well as the current effect and control dependency in the TF graph. |
| 44 // It maintains a control state that tracks whether the environment | 47 // It maintains a control state that tracks whether the environment |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 switch (type) { | 496 switch (type) { |
| 494 case kAstI32: | 497 case kAstI32: |
| 495 return builder_->Int32Constant(0); | 498 return builder_->Int32Constant(0); |
| 496 case kAstI64: | 499 case kAstI64: |
| 497 return builder_->Int64Constant(0); | 500 return builder_->Int64Constant(0); |
| 498 case kAstF32: | 501 case kAstF32: |
| 499 return builder_->Float32Constant(0); | 502 return builder_->Float32Constant(0); |
| 500 case kAstF64: | 503 case kAstF64: |
| 501 return builder_->Float64Constant(0); | 504 return builder_->Float64Constant(0); |
| 502 case kAstS128: | 505 case kAstS128: |
| 503 return builder_->DefaultS128Value(); | 506 return builder_->CreateS128Value(0); |
| 504 default: | 507 default: |
| 505 UNREACHABLE(); | 508 UNREACHABLE(); |
| 506 return nullptr; | 509 return nullptr; |
| 507 } | 510 } |
| 508 } | 511 } |
| 509 | 512 |
| 510 char* indentation() { | 513 char* indentation() { |
| 511 static const int kMaxIndent = 64; | 514 static const int kMaxIndent = 64; |
| 512 static char bytes[kMaxIndent + 1]; | 515 static char bytes[kMaxIndent + 1]; |
| 513 for (int i = 0; i < kMaxIndent; ++i) bytes[i] = ' '; | 516 for (int i = 0; i < kMaxIndent; ++i) bytes[i] = ' '; |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1933 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1936 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
| 1934 const byte* start, const byte* end) { | 1937 const byte* start, const byte* end) { |
| 1935 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1938 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
| 1936 WasmFullDecoder decoder(zone, nullptr, body); | 1939 WasmFullDecoder decoder(zone, nullptr, body); |
| 1937 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1940 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
| 1938 } | 1941 } |
| 1939 | 1942 |
| 1940 } // namespace wasm | 1943 } // namespace wasm |
| 1941 } // namespace internal | 1944 } // namespace internal |
| 1942 } // namespace v8 | 1945 } // namespace v8 |
| OLD | NEW |