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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 // Required to get M_E etc. in MSVC. | 7 // Required to get M_E etc. in MSVC. |
8 #if defined(_WIN32) | 8 #if defined(_WIN32) |
9 #define _USE_MATH_DEFINES | 9 #define _USE_MATH_DEFINES |
10 #endif | 10 #endif |
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 } | 1506 } |
1507 | 1507 |
1508 void VisitCountOperation(CountOperation* expr) { UNREACHABLE(); } | 1508 void VisitCountOperation(CountOperation* expr) { UNREACHABLE(); } |
1509 | 1509 |
1510 bool MatchIntBinaryOperation(BinaryOperation* expr, Token::Value op, | 1510 bool MatchIntBinaryOperation(BinaryOperation* expr, Token::Value op, |
1511 int32_t val) { | 1511 int32_t val) { |
1512 DCHECK_NOT_NULL(expr->right()); | 1512 DCHECK_NOT_NULL(expr->right()); |
1513 if (expr->op() == op && expr->right()->IsLiteral() && | 1513 if (expr->op() == op && expr->right()->IsLiteral() && |
1514 TypeOf(expr) == kAstI32) { | 1514 TypeOf(expr) == kAstI32) { |
1515 Literal* right = expr->right()->AsLiteral(); | 1515 Literal* right = expr->right()->AsLiteral(); |
1516 DCHECK(right->raw_value()->IsNumber()); | 1516 if (right->raw_value()->IsNumber() && |
1517 if (static_cast<int32_t>(right->raw_value()->AsNumber()) == val) { | 1517 static_cast<int32_t>(right->raw_value()->AsNumber()) == val) { |
1518 return true; | 1518 return true; |
1519 } | 1519 } |
1520 } | 1520 } |
1521 return false; | 1521 return false; |
1522 } | 1522 } |
1523 | 1523 |
1524 bool MatchDoubleBinaryOperation(BinaryOperation* expr, Token::Value op, | 1524 bool MatchDoubleBinaryOperation(BinaryOperation* expr, Token::Value op, |
1525 double val) { | 1525 double val) { |
1526 DCHECK_NOT_NULL(expr->right()); | 1526 DCHECK_NOT_NULL(expr->right()); |
1527 if (expr->op() == op && expr->right()->IsLiteral() && | 1527 if (expr->op() == op && expr->right()->IsLiteral() && |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1982 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); | 1982 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); |
1983 return {module_buffer, asm_offsets_buffer, success}; | 1983 return {module_buffer, asm_offsets_buffer, success}; |
1984 } | 1984 } |
1985 | 1985 |
1986 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; | 1986 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; |
1987 const char* AsmWasmBuilder::single_function_name = "__single_function__"; | 1987 const char* AsmWasmBuilder::single_function_name = "__single_function__"; |
1988 | 1988 |
1989 } // namespace wasm | 1989 } // namespace wasm |
1990 } // namespace internal | 1990 } // namespace internal |
1991 } // namespace v8 | 1991 } // namespace v8 |
OLD | NEW |