| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 <cstring> | 5 #include <cstring> |
| 6 #include <functional> | 6 #include <functional> |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/asmjs/asm-typer.h" | 10 #include "src/asmjs/asm-typer.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 success = ValidateExpressionStatment(fun_decl_) != AsmType::None(); | 253 success = ValidateExpressionStatment(fun_decl_) != AsmType::None(); |
| 254 } else { | 254 } else { |
| 255 success = typer_->Validate(); | 255 success = typer_->Validate(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 if (success) { | 258 if (success) { |
| 259 std::cerr << "Asm validation succeeded\n"; | 259 std::cerr << "Asm validation succeeded\n"; |
| 260 return false; | 260 return false; |
| 261 } | 261 } |
| 262 | 262 |
| 263 if (std::strstr(typer_->error_message(), error_message) == nullptr) { | 263 std::unique_ptr<char[]> msg = i::MessageHandler::GetLocalizedMessage( |
| 264 isolate_, typer_->error_message()); |
| 265 if (std::strstr(msg.get(), error_message) == nullptr) { |
| 264 std::cerr << "Asm validation failed with the wrong error message:\n" | 266 std::cerr << "Asm validation failed with the wrong error message:\n" |
| 265 "Expected to contain '" | 267 "Expected to contain '" |
| 266 << error_message << "'\n" | 268 << error_message << "'\n" |
| 267 " Actually is '" | 269 " Actually is '" |
| 268 << typer_->error_message() << "'\n"; | 270 << msg.get() << "'\n"; |
| 269 return false; | 271 return false; |
| 270 } | 272 } |
| 271 | 273 |
| 272 return true; | 274 return true; |
| 273 } | 275 } |
| 274 | 276 |
| 275 private: | 277 private: |
| 276 Variable* DeclareVariable(VariableName var_name) { | 278 Variable* DeclareVariable(VariableName var_name) { |
| 277 auto* name_ast_string = ast_value_factory_.GetOneByteString(var_name.name_); | 279 auto* name_ast_string = ast_value_factory_.GetOneByteString(var_name.name_); |
| 278 ast_value_factory_.Internalize(isolate_); | 280 ast_value_factory_.Internalize(isolate_); |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 if (!ValidationOf(Module(kTests[ii])) | 2051 if (!ValidationOf(Module(kTests[ii])) |
| 2050 ->FailsWithMessage( | 2052 ->FailsWithMessage( |
| 2051 "Constant in return must be signed, float, or double.")) { | 2053 "Constant in return must be signed, float, or double.")) { |
| 2052 std::cerr << "Test:\n" << kTests[ii]; | 2054 std::cerr << "Test:\n" << kTests[ii]; |
| 2053 CHECK(false); | 2055 CHECK(false); |
| 2054 } | 2056 } |
| 2055 } | 2057 } |
| 2056 } | 2058 } |
| 2057 | 2059 |
| 2058 } // namespace | 2060 } // namespace |
| OLD | NEW |