| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // TODO(srdjan): Allow compiler to add constants as they are encountered in | 49 // TODO(srdjan): Allow compiler to add constants as they are encountered in |
| 50 // the compilation. | 50 // the compilation. |
| 51 const double kCommonDoubleConstants[] = | 51 const double kCommonDoubleConstants[] = |
| 52 {-1.0, -0.5, -0.1, 0.0, 0.1, 0.5, 1.0, 2.0, 4.0, 5.0, | 52 {-1.0, -0.5, -0.1, 0.0, 0.1, 0.5, 1.0, 2.0, 4.0, 5.0, |
| 53 10.0, 20.0, 30.0, 64.0, 255.0, NAN, | 53 10.0, 20.0, 30.0, 64.0, 255.0, NAN, |
| 54 // From dart:math | 54 // From dart:math |
| 55 2.718281828459045, 2.302585092994046, 0.6931471805599453, | 55 2.718281828459045, 2.302585092994046, 0.6931471805599453, |
| 56 1.4426950408889634, 0.4342944819032518, 3.1415926535897932, | 56 1.4426950408889634, 0.4342944819032518, 3.1415926535897932, |
| 57 0.7071067811865476, 1.4142135623730951}; | 57 0.7071067811865476, 1.4142135623730951}; |
| 58 | 58 |
| 59 |
| 60 static bool TypeChecksEnabled() { |
| 61 return FLAG_enable_type_checks || Isolate::Current()->checked_mode(); |
| 62 } |
| 63 |
| 64 |
| 65 static bool AssertsEnabled() { |
| 66 return FLAG_enable_asserts || Isolate::Current()->checked_mode(); |
| 67 } |
| 68 |
| 69 |
| 59 uword FlowGraphBuilder::FindDoubleConstant(double value) { | 70 uword FlowGraphBuilder::FindDoubleConstant(double value) { |
| 60 intptr_t len = sizeof(kCommonDoubleConstants) / sizeof(double); // NOLINT | 71 intptr_t len = sizeof(kCommonDoubleConstants) / sizeof(double); // NOLINT |
| 61 for (intptr_t i = 0; i < len; i++) { | 72 for (intptr_t i = 0; i < len; i++) { |
| 62 if (Utils::DoublesBitEqual(value, kCommonDoubleConstants[i])) { | 73 if (Utils::DoublesBitEqual(value, kCommonDoubleConstants[i])) { |
| 63 return reinterpret_cast<uword>(&kCommonDoubleConstants[i]); | 74 return reinterpret_cast<uword>(&kCommonDoubleConstants[i]); |
| 64 } | 75 } |
| 65 } | 76 } |
| 66 return 0; | 77 return 0; |
| 67 } | 78 } |
| 68 | 79 |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 return CreateSuccessorFor(true_successor_addresses_); | 893 return CreateSuccessorFor(true_successor_addresses_); |
| 883 } | 894 } |
| 884 | 895 |
| 885 | 896 |
| 886 BlockEntryInstr* TestGraphVisitor::CreateFalseSuccessor() const { | 897 BlockEntryInstr* TestGraphVisitor::CreateFalseSuccessor() const { |
| 887 return CreateSuccessorFor(false_successor_addresses_); | 898 return CreateSuccessorFor(false_successor_addresses_); |
| 888 } | 899 } |
| 889 | 900 |
| 890 | 901 |
| 891 void TestGraphVisitor::ReturnValue(Value* value) { | 902 void TestGraphVisitor::ReturnValue(Value* value) { |
| 892 if (FLAG_enable_type_checks || FLAG_enable_asserts) { | 903 if (TypeChecksEnabled() || AssertsEnabled()) { |
| 893 value = Bind(new(I) AssertBooleanInstr(condition_token_pos(), value)); | 904 value = Bind(new(I) AssertBooleanInstr(condition_token_pos(), value)); |
| 894 } | 905 } |
| 895 Value* constant_true = Bind(new(I) ConstantInstr(Bool::True())); | 906 Value* constant_true = Bind(new(I) ConstantInstr(Bool::True())); |
| 896 StrictCompareInstr* comp = | 907 StrictCompareInstr* comp = |
| 897 new(I) StrictCompareInstr(condition_token_pos(), | 908 new(I) StrictCompareInstr(condition_token_pos(), |
| 898 Token::kEQ_STRICT, | 909 Token::kEQ_STRICT, |
| 899 value, | 910 value, |
| 900 constant_true, | 911 constant_true, |
| 901 false); // No number check. | 912 false); // No number check. |
| 902 BranchInstr* branch = new(I) BranchInstr(comp); | 913 BranchInstr* branch = new(I) BranchInstr(comp); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 917 (comp->left()->BindsToConstantNull() || | 928 (comp->left()->BindsToConstantNull() || |
| 918 comp->right()->BindsToConstantNull())) { | 929 comp->right()->BindsToConstantNull())) { |
| 919 branch = new(I) BranchInstr(new(I) StrictCompareInstr( | 930 branch = new(I) BranchInstr(new(I) StrictCompareInstr( |
| 920 comp->token_pos(), | 931 comp->token_pos(), |
| 921 (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT, | 932 (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT, |
| 922 comp->left(), | 933 comp->left(), |
| 923 comp->right(), | 934 comp->right(), |
| 924 false)); // No number check. | 935 false)); // No number check. |
| 925 } else { | 936 } else { |
| 926 branch = new(I) BranchInstr(comp); | 937 branch = new(I) BranchInstr(comp); |
| 927 branch->set_is_checked(FLAG_enable_type_checks); | 938 branch->set_is_checked(TypeChecksEnabled()); |
| 928 } | 939 } |
| 929 AddInstruction(branch); | 940 AddInstruction(branch); |
| 930 CloseFragment(); | 941 CloseFragment(); |
| 931 true_successor_addresses_.Add(branch->true_successor_address()); | 942 true_successor_addresses_.Add(branch->true_successor_address()); |
| 932 false_successor_addresses_.Add(branch->false_successor_address()); | 943 false_successor_addresses_.Add(branch->false_successor_address()); |
| 933 } | 944 } |
| 934 | 945 |
| 935 | 946 |
| 936 void TestGraphVisitor::MergeBranchWithNegate(BooleanNegateInstr* neg) { | 947 void TestGraphVisitor::MergeBranchWithNegate(BooleanNegateInstr* neg) { |
| 937 ASSERT(!FLAG_enable_type_checks); | 948 ASSERT(!TypeChecksEnabled()); |
| 938 Value* constant_true = Bind(new(I) ConstantInstr(Bool::True())); | 949 Value* constant_true = Bind(new(I) ConstantInstr(Bool::True())); |
| 939 StrictCompareInstr* comp = | 950 StrictCompareInstr* comp = |
| 940 new(I) StrictCompareInstr(condition_token_pos(), | 951 new(I) StrictCompareInstr(condition_token_pos(), |
| 941 Token::kNE_STRICT, | 952 Token::kNE_STRICT, |
| 942 neg->value(), | 953 neg->value(), |
| 943 constant_true, | 954 constant_true, |
| 944 false); // No number check. | 955 false); // No number check. |
| 945 BranchInstr* branch = new(I) BranchInstr(comp); | 956 BranchInstr* branch = new(I) BranchInstr(comp); |
| 946 AddInstruction(branch); | 957 AddInstruction(branch); |
| 947 CloseFragment(); | 958 CloseFragment(); |
| 948 true_successor_addresses_.Add(branch->true_successor_address()); | 959 true_successor_addresses_.Add(branch->true_successor_address()); |
| 949 false_successor_addresses_.Add(branch->false_successor_address()); | 960 false_successor_addresses_.Add(branch->false_successor_address()); |
| 950 } | 961 } |
| 951 | 962 |
| 952 | 963 |
| 953 void TestGraphVisitor::ReturnDefinition(Definition* definition) { | 964 void TestGraphVisitor::ReturnDefinition(Definition* definition) { |
| 954 ComparisonInstr* comp = definition->AsComparison(); | 965 ComparisonInstr* comp = definition->AsComparison(); |
| 955 if (comp != NULL) { | 966 if (comp != NULL) { |
| 956 MergeBranchWithComparison(comp); | 967 MergeBranchWithComparison(comp); |
| 957 return; | 968 return; |
| 958 } | 969 } |
| 959 if (!FLAG_enable_type_checks) { | 970 if (!TypeChecksEnabled()) { |
| 960 BooleanNegateInstr* neg = definition->AsBooleanNegate(); | 971 BooleanNegateInstr* neg = definition->AsBooleanNegate(); |
| 961 if (neg != NULL) { | 972 if (neg != NULL) { |
| 962 MergeBranchWithNegate(neg); | 973 MergeBranchWithNegate(neg); |
| 963 return; | 974 return; |
| 964 } | 975 } |
| 965 } | 976 } |
| 966 ReturnValue(Bind(definition)); | 977 ReturnValue(Bind(definition)); |
| 967 } | 978 } |
| 968 | 979 |
| 969 | 980 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 // step mode. This call must happen before the contexts are | 1049 // step mode. This call must happen before the contexts are |
| 1039 // unchained so that captured variables can be inspected. | 1050 // unchained so that captured variables can be inspected. |
| 1040 // No debugger check is done in native functions or for return | 1051 // No debugger check is done in native functions or for return |
| 1041 // statements for which there is no associated source position. | 1052 // statements for which there is no associated source position. |
| 1042 const Function& function = owner()->function(); | 1053 const Function& function = owner()->function(); |
| 1043 if ((node->token_pos() != Scanner::kNoSourcePos) && !function.is_native()) { | 1054 if ((node->token_pos() != Scanner::kNoSourcePos) && !function.is_native()) { |
| 1044 AddInstruction(new(I) DebugStepCheckInstr(node->token_pos(), | 1055 AddInstruction(new(I) DebugStepCheckInstr(node->token_pos(), |
| 1045 RawPcDescriptors::kRuntimeCall)); | 1056 RawPcDescriptors::kRuntimeCall)); |
| 1046 } | 1057 } |
| 1047 | 1058 |
| 1048 if (FLAG_enable_type_checks) { | 1059 if (TypeChecksEnabled()) { |
| 1049 const bool is_implicit_dynamic_getter = | 1060 const bool is_implicit_dynamic_getter = |
| 1050 (!function.is_static() && | 1061 (!function.is_static() && |
| 1051 ((function.kind() == RawFunction::kImplicitGetter) || | 1062 ((function.kind() == RawFunction::kImplicitGetter) || |
| 1052 (function.kind() == RawFunction::kImplicitStaticFinalGetter))); | 1063 (function.kind() == RawFunction::kImplicitStaticFinalGetter))); |
| 1053 // Implicit getters do not need a type check at return, unless they compute | 1064 // Implicit getters do not need a type check at return, unless they compute |
| 1054 // the initial value of a static field. | 1065 // the initial value of a static field. |
| 1055 // The body of a constructor cannot modify the type of the | 1066 // The body of a constructor cannot modify the type of the |
| 1056 // constructed instance, which is passed in as an implicit parameter. | 1067 // constructed instance, which is passed in as an implicit parameter. |
| 1057 // However, factories may create an instance of the wrong type. | 1068 // However, factories may create an instance of the wrong type. |
| 1058 if (!is_implicit_dynamic_getter && !function.IsConstructor()) { | 1069 if (!is_implicit_dynamic_getter && !function.IsConstructor()) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 // left: <Expression> | 1248 // left: <Expression> |
| 1238 // right: <Expression> } | 1249 // right: <Expression> } |
| 1239 void EffectGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) { | 1250 void EffectGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) { |
| 1240 // Operators "&&" and "||" cannot be overloaded therefore do not call | 1251 // Operators "&&" and "||" cannot be overloaded therefore do not call |
| 1241 // operator. | 1252 // operator. |
| 1242 if ((node->kind() == Token::kAND) || (node->kind() == Token::kOR)) { | 1253 if ((node->kind() == Token::kAND) || (node->kind() == Token::kOR)) { |
| 1243 // See ValueGraphVisitor::VisitBinaryOpNode. | 1254 // See ValueGraphVisitor::VisitBinaryOpNode. |
| 1244 TestGraphVisitor for_left(owner(), node->left()->token_pos()); | 1255 TestGraphVisitor for_left(owner(), node->left()->token_pos()); |
| 1245 node->left()->Visit(&for_left); | 1256 node->left()->Visit(&for_left); |
| 1246 EffectGraphVisitor empty(owner()); | 1257 EffectGraphVisitor empty(owner()); |
| 1247 if (FLAG_enable_type_checks || FLAG_enable_asserts) { | 1258 if (TypeChecksEnabled() || AssertsEnabled()) { |
| 1248 ValueGraphVisitor for_right(owner()); | 1259 ValueGraphVisitor for_right(owner()); |
| 1249 node->right()->Visit(&for_right); | 1260 node->right()->Visit(&for_right); |
| 1250 Value* right_value = for_right.value(); | 1261 Value* right_value = for_right.value(); |
| 1251 for_right.Do(new(I) AssertBooleanInstr(node->right()->token_pos(), | 1262 for_right.Do(new(I) AssertBooleanInstr(node->right()->token_pos(), |
| 1252 right_value)); | 1263 right_value)); |
| 1253 if (node->kind() == Token::kAND) { | 1264 if (node->kind() == Token::kAND) { |
| 1254 Join(for_left, for_right, empty); | 1265 Join(for_left, for_right, empty); |
| 1255 } else { | 1266 } else { |
| 1256 Join(for_left, empty, for_right); | 1267 Join(for_left, empty, for_right); |
| 1257 } | 1268 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 // of left is sufficient. | 1313 // of left is sufficient. |
| 1303 // AND: left ? right === true : false; | 1314 // AND: left ? right === true : false; |
| 1304 // OR: left ? true : right === true; | 1315 // OR: left ? true : right === true; |
| 1305 | 1316 |
| 1306 TestGraphVisitor for_test(owner(), node->left()->token_pos()); | 1317 TestGraphVisitor for_test(owner(), node->left()->token_pos()); |
| 1307 node->left()->Visit(&for_test); | 1318 node->left()->Visit(&for_test); |
| 1308 | 1319 |
| 1309 ValueGraphVisitor for_right(owner()); | 1320 ValueGraphVisitor for_right(owner()); |
| 1310 node->right()->Visit(&for_right); | 1321 node->right()->Visit(&for_right); |
| 1311 Value* right_value = for_right.value(); | 1322 Value* right_value = for_right.value(); |
| 1312 if (FLAG_enable_type_checks|| FLAG_enable_asserts) { | 1323 if (TypeChecksEnabled()|| AssertsEnabled()) { |
| 1313 right_value = | 1324 right_value = |
| 1314 for_right.Bind(new(I) AssertBooleanInstr(node->right()->token_pos(), | 1325 for_right.Bind(new(I) AssertBooleanInstr(node->right()->token_pos(), |
| 1315 right_value)); | 1326 right_value)); |
| 1316 } | 1327 } |
| 1317 Value* constant_true = for_right.Bind(new(I) ConstantInstr(Bool::True())); | 1328 Value* constant_true = for_right.Bind(new(I) ConstantInstr(Bool::True())); |
| 1318 Value* compare = | 1329 Value* compare = |
| 1319 for_right.Bind(new(I) StrictCompareInstr(node->token_pos(), | 1330 for_right.Bind(new(I) StrictCompareInstr(node->token_pos(), |
| 1320 Token::kEQ_STRICT, | 1331 Token::kEQ_STRICT, |
| 1321 right_value, | 1332 right_value, |
| 1322 constant_true, | 1333 constant_true, |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 | 1772 |
| 1762 Definition* result = new(I) InstanceCallInstr( | 1773 Definition* result = new(I) InstanceCallInstr( |
| 1763 node->token_pos(), | 1774 node->token_pos(), |
| 1764 Symbols::EqualOperator(), | 1775 Symbols::EqualOperator(), |
| 1765 Token::kEQ, // Result is negated later for kNE. | 1776 Token::kEQ, // Result is negated later for kNE. |
| 1766 arguments, | 1777 arguments, |
| 1767 Object::null_array(), | 1778 Object::null_array(), |
| 1768 2, | 1779 2, |
| 1769 owner()->ic_data_array()); | 1780 owner()->ic_data_array()); |
| 1770 if (node->kind() == Token::kNE) { | 1781 if (node->kind() == Token::kNE) { |
| 1771 if (FLAG_enable_type_checks || FLAG_enable_asserts) { | 1782 if (TypeChecksEnabled() || AssertsEnabled()) { |
| 1772 Value* value = Bind(result); | 1783 Value* value = Bind(result); |
| 1773 result = new(I) AssertBooleanInstr(node->token_pos(), value); | 1784 result = new(I) AssertBooleanInstr(node->token_pos(), value); |
| 1774 } | 1785 } |
| 1775 Value* value = Bind(result); | 1786 Value* value = Bind(result); |
| 1776 result = new(I) BooleanNegateInstr(value); | 1787 result = new(I) BooleanNegateInstr(value); |
| 1777 } | 1788 } |
| 1778 ReturnDefinition(result); | 1789 ReturnDefinition(result); |
| 1779 return; | 1790 return; |
| 1780 } | 1791 } |
| 1781 | 1792 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1807 } | 1818 } |
| 1808 | 1819 |
| 1809 | 1820 |
| 1810 void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) { | 1821 void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) { |
| 1811 // "!" cannot be overloaded, therefore do not call operator. | 1822 // "!" cannot be overloaded, therefore do not call operator. |
| 1812 if (node->kind() == Token::kNOT) { | 1823 if (node->kind() == Token::kNOT) { |
| 1813 ValueGraphVisitor for_value(owner()); | 1824 ValueGraphVisitor for_value(owner()); |
| 1814 node->operand()->Visit(&for_value); | 1825 node->operand()->Visit(&for_value); |
| 1815 Append(for_value); | 1826 Append(for_value); |
| 1816 Value* value = for_value.value(); | 1827 Value* value = for_value.value(); |
| 1817 if (FLAG_enable_type_checks || FLAG_enable_asserts) { | 1828 if (TypeChecksEnabled() || AssertsEnabled()) { |
| 1818 value = | 1829 value = |
| 1819 Bind(new(I) AssertBooleanInstr(node->operand()->token_pos(), value)); | 1830 Bind(new(I) AssertBooleanInstr(node->operand()->token_pos(), value)); |
| 1820 } | 1831 } |
| 1821 BooleanNegateInstr* negate = new(I) BooleanNegateInstr(value); | 1832 BooleanNegateInstr* negate = new(I) BooleanNegateInstr(value); |
| 1822 ReturnDefinition(negate); | 1833 ReturnDefinition(negate); |
| 1823 return; | 1834 return; |
| 1824 } | 1835 } |
| 1825 | 1836 |
| 1826 ValueGraphVisitor for_value(owner()); | 1837 ValueGraphVisitor for_value(owner()); |
| 1827 node->operand()->Visit(&for_value); | 1838 node->operand()->Visit(&for_value); |
| (...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3410 node->value()->IsLoadLocalNode() || | 3421 node->value()->IsLoadLocalNode() || |
| 3411 node->value()->IsClosureNode()) { | 3422 node->value()->IsClosureNode()) { |
| 3412 AddInstruction(new(I) DebugStepCheckInstr( | 3423 AddInstruction(new(I) DebugStepCheckInstr( |
| 3413 node->token_pos(), RawPcDescriptors::kRuntimeCall)); | 3424 node->token_pos(), RawPcDescriptors::kRuntimeCall)); |
| 3414 } | 3425 } |
| 3415 | 3426 |
| 3416 ValueGraphVisitor for_value(owner()); | 3427 ValueGraphVisitor for_value(owner()); |
| 3417 node->value()->Visit(&for_value); | 3428 node->value()->Visit(&for_value); |
| 3418 Append(for_value); | 3429 Append(for_value); |
| 3419 Value* store_value = for_value.value(); | 3430 Value* store_value = for_value.value(); |
| 3420 if (FLAG_enable_type_checks) { | 3431 if (TypeChecksEnabled()) { |
| 3421 store_value = BuildAssignableValue(node->value()->token_pos(), | 3432 store_value = BuildAssignableValue(node->value()->token_pos(), |
| 3422 store_value, | 3433 store_value, |
| 3423 node->local().type(), | 3434 node->local().type(), |
| 3424 node->local().name()); | 3435 node->local().name()); |
| 3425 } | 3436 } |
| 3426 Definition* store = BuildStoreLocal(node->local(), store_value); | 3437 Definition* store = BuildStoreLocal(node->local(), store_value); |
| 3427 ReturnDefinition(store); | 3438 ReturnDefinition(store); |
| 3428 } | 3439 } |
| 3429 | 3440 |
| 3430 | 3441 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3451 | 3462 |
| 3452 void EffectGraphVisitor::VisitStoreInstanceFieldNode( | 3463 void EffectGraphVisitor::VisitStoreInstanceFieldNode( |
| 3453 StoreInstanceFieldNode* node) { | 3464 StoreInstanceFieldNode* node) { |
| 3454 ValueGraphVisitor for_instance(owner()); | 3465 ValueGraphVisitor for_instance(owner()); |
| 3455 node->instance()->Visit(&for_instance); | 3466 node->instance()->Visit(&for_instance); |
| 3456 Append(for_instance); | 3467 Append(for_instance); |
| 3457 ValueGraphVisitor for_value(owner()); | 3468 ValueGraphVisitor for_value(owner()); |
| 3458 node->value()->Visit(&for_value); | 3469 node->value()->Visit(&for_value); |
| 3459 Append(for_value); | 3470 Append(for_value); |
| 3460 Value* store_value = for_value.value(); | 3471 Value* store_value = for_value.value(); |
| 3461 if (FLAG_enable_type_checks) { | 3472 if (TypeChecksEnabled()) { |
| 3462 const AbstractType& type = | 3473 const AbstractType& type = |
| 3463 AbstractType::ZoneHandle(I, node->field().type()); | 3474 AbstractType::ZoneHandle(I, node->field().type()); |
| 3464 const String& dst_name = String::ZoneHandle(I, node->field().name()); | 3475 const String& dst_name = String::ZoneHandle(I, node->field().name()); |
| 3465 store_value = BuildAssignableValue(node->value()->token_pos(), | 3476 store_value = BuildAssignableValue(node->value()->token_pos(), |
| 3466 store_value, | 3477 store_value, |
| 3467 type, | 3478 type, |
| 3468 dst_name); | 3479 dst_name); |
| 3469 } | 3480 } |
| 3470 | 3481 |
| 3471 store_value = Bind(BuildStoreExprTemp(store_value)); | 3482 store_value = Bind(BuildStoreExprTemp(store_value)); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3813 CheckStackOverflowInstr* check = | 3824 CheckStackOverflowInstr* check = |
| 3814 new(I) CheckStackOverflowInstr(function.token_pos(), 0); | 3825 new(I) CheckStackOverflowInstr(function.token_pos(), 0); |
| 3815 // If we are inlining don't actually attach the stack check. We must still | 3826 // If we are inlining don't actually attach the stack check. We must still |
| 3816 // create the stack check in order to allocate a deopt id. | 3827 // create the stack check in order to allocate a deopt id. |
| 3817 if (!owner()->IsInlining()) { | 3828 if (!owner()->IsInlining()) { |
| 3818 AddInstruction(check); | 3829 AddInstruction(check); |
| 3819 } | 3830 } |
| 3820 } | 3831 } |
| 3821 } | 3832 } |
| 3822 | 3833 |
| 3823 if (FLAG_enable_type_checks && is_top_level_sequence) { | 3834 if (TypeChecksEnabled() && is_top_level_sequence) { |
| 3824 const Function& function = owner()->function(); | 3835 const Function& function = owner()->function(); |
| 3825 const int num_params = function.NumParameters(); | 3836 const int num_params = function.NumParameters(); |
| 3826 int pos = 0; | 3837 int pos = 0; |
| 3827 if (function.IsConstructor()) { | 3838 if (function.IsConstructor()) { |
| 3828 // Skip type checking of receiver and phase for constructor functions. | 3839 // Skip type checking of receiver and phase for constructor functions. |
| 3829 pos = 2; | 3840 pos = 2; |
| 3830 } else if (function.IsFactory() || function.IsDynamicFunction()) { | 3841 } else if (function.IsFactory() || function.IsDynamicFunction()) { |
| 3831 // Skip type checking of type arguments for factory functions. | 3842 // Skip type checking of type arguments for factory functions. |
| 3832 // Skip type checking of receiver for instance functions. | 3843 // Skip type checking of receiver for instance functions. |
| 3833 pos = 1; | 3844 pos = 1; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 Report::MessageF(Report::kBailout, | 4322 Report::MessageF(Report::kBailout, |
| 4312 Script::Handle(function.script()), | 4323 Script::Handle(function.script()), |
| 4313 function.token_pos(), | 4324 function.token_pos(), |
| 4314 "FlowGraphBuilder Bailout: %s %s", | 4325 "FlowGraphBuilder Bailout: %s %s", |
| 4315 String::Handle(function.name()).ToCString(), | 4326 String::Handle(function.name()).ToCString(), |
| 4316 reason); | 4327 reason); |
| 4317 UNREACHABLE(); | 4328 UNREACHABLE(); |
| 4318 } | 4329 } |
| 4319 | 4330 |
| 4320 } // namespace dart | 4331 } // namespace dart |
| OLD | NEW |