Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: src/typing-asm.cc

Issue 1722473002: Allow intish and floatish to be coerced by heap assignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 if (building_function_tables_) { 676 if (building_function_tables_) {
677 return; 677 return;
678 } 678 }
679 } 679 }
680 } 680 }
681 if (expr->is_compound()) FAIL(expr, "compound assignment encountered"); 681 if (expr->is_compound()) FAIL(expr, "compound assignment encountered");
682 Type* type = expected_type_; 682 Type* type = expected_type_;
683 RECURSE(VisitWithExpectation( 683 RECURSE(VisitWithExpectation(
684 expr->value(), type, "assignment value expected to match surrounding")); 684 expr->value(), type, "assignment value expected to match surrounding"));
685 Type* target_type = StorageType(computed_type_); 685 Type* target_type = StorageType(computed_type_);
686 if (intish_ != 0) {
687 FAIL(expr, "intish or floatish assignment");
688 }
689 if (expr->target()->IsVariableProxy()) { 686 if (expr->target()->IsVariableProxy()) {
687 if (intish_ != 0) {
688 FAIL(expr, "intish or floatish assignment");
689 }
690 expected_type_ = target_type; 690 expected_type_ = target_type;
691 VisitVariableProxy(expr->target()->AsVariableProxy(), true); 691 VisitVariableProxy(expr->target()->AsVariableProxy(), true);
692 } else if (expr->target()->IsProperty()) { 692 } else if (expr->target()->IsProperty()) {
693 int value_intish = intish_;
693 Property* property = expr->target()->AsProperty(); 694 Property* property = expr->target()->AsProperty();
694 RECURSE(VisitWithExpectation(property->obj(), Type::Any(), 695 RECURSE(VisitWithExpectation(property->obj(), Type::Any(),
695 "bad propety object")); 696 "bad propety object"));
696 if (!computed_type_->IsArray()) { 697 if (!computed_type_->IsArray()) {
697 FAIL(property->obj(), "array expected"); 698 FAIL(property->obj(), "array expected");
698 } 699 }
700 if (value_intish != 0 && computed_type_->Is(cache_.kFloat64Array)) {
701 FAIL(expr, "floatish assignment to double array");
702 }
699 VisitHeapAccess(property, true, target_type); 703 VisitHeapAccess(property, true, target_type);
700 } 704 }
701 IntersectResult(expr, target_type); 705 IntersectResult(expr, target_type);
702 } 706 }
703 707
704 708
705 void AsmTyper::VisitYield(Yield* expr) { 709 void AsmTyper::VisitYield(Yield* expr) {
706 FAIL(expr, "yield expression encountered"); 710 FAIL(expr, "yield expression encountered");
707 } 711 }
708 712
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 } 1555 }
1552 1556
1553 1557
1554 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { 1558 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) {
1555 RECURSE(Visit(expr->expression())); 1559 RECURSE(Visit(expr->expression()));
1556 } 1560 }
1557 1561
1558 1562
1559 } // namespace internal 1563 } // namespace internal
1560 } // namespace v8 1564 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698