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/typing-asm.h" | 5 #include "src/typing-asm.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 RECURSE(Visit(expr->key())); | 774 RECURSE(Visit(expr->key())); |
775 } else { | 775 } else { |
776 BinaryOperation* bin = expr->key()->AsBinaryOperation(); | 776 BinaryOperation* bin = expr->key()->AsBinaryOperation(); |
777 if (bin == NULL || bin->op() != Token::SAR) { | 777 if (bin == NULL || bin->op() != Token::SAR) { |
778 FAIL(expr->key(), "expected >> in heap access"); | 778 FAIL(expr->key(), "expected >> in heap access"); |
779 } | 779 } |
780 RECURSE(VisitWithExpectation(bin->left(), cache_.kAsmSigned, | 780 RECURSE(VisitWithExpectation(bin->left(), cache_.kAsmSigned, |
781 "array index expected to be integer")); | 781 "array index expected to be integer")); |
782 Literal* right = bin->right()->AsLiteral(); | 782 Literal* right = bin->right()->AsLiteral(); |
783 if (right == NULL || right->raw_value()->ContainsDot()) { | 783 if (right == NULL || right->raw_value()->ContainsDot()) { |
784 FAIL(right, "heap access shift must be integer"); | 784 FAIL(bin->right(), "heap access shift must be integer"); |
785 } | 785 } |
786 RECURSE(VisitWithExpectation(bin->right(), cache_.kAsmSigned, | 786 RECURSE(VisitWithExpectation(bin->right(), cache_.kAsmSigned, |
787 "array shift expected to be integer")); | 787 "array shift expected to be integer")); |
788 int n = static_cast<int>(right->raw_value()->AsNumber()); | 788 int n = static_cast<int>(right->raw_value()->AsNumber()); |
789 if (expected_shift < 0 || n != expected_shift) { | 789 if (expected_shift < 0 || n != expected_shift) { |
790 FAIL(right, "heap access shift must match element size"); | 790 FAIL(right, "heap access shift must match element size"); |
791 } | 791 } |
792 } | 792 } |
793 expr->key()->set_bounds(Bounds(cache_.kAsmSigned)); | 793 expr->key()->set_bounds(Bounds(cache_.kAsmSigned)); |
794 } | 794 } |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 } | 1615 } |
1616 | 1616 |
1617 | 1617 |
1618 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { | 1618 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { |
1619 RECURSE(Visit(expr->expression())); | 1619 RECURSE(Visit(expr->expression())); |
1620 } | 1620 } |
1621 | 1621 |
1622 | 1622 |
1623 } // namespace internal | 1623 } // namespace internal |
1624 } // namespace v8 | 1624 } // namespace v8 |
OLD | NEW |