Chromium Code Reviews| 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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1328 } else { | 1328 } else { |
| 1329 EffectGraphVisitor for_right(owner()); | 1329 EffectGraphVisitor for_right(owner()); |
| 1330 node->right()->Visit(&for_right); | 1330 node->right()->Visit(&for_right); |
| 1331 if (node->kind() == Token::kAND) { | 1331 if (node->kind() == Token::kAND) { |
| 1332 Join(for_left, for_right, empty); | 1332 Join(for_left, for_right, empty); |
| 1333 } else { | 1333 } else { |
| 1334 Join(for_left, empty, for_right); | 1334 Join(for_left, empty, for_right); |
| 1335 } | 1335 } |
| 1336 } | 1336 } |
| 1337 return; | 1337 return; |
| 1338 } else if (node->kind() == Token::kIFNULL) { | |
| 1339 // left ?? right. This operation cannot be overloaded. | |
| 1340 // temp = left; temp === null ? right : temp | |
| 1341 ValueGraphVisitor for_left_value(owner()); | |
| 1342 node->left()->Visit(&for_left_value); | |
| 1343 Append(for_left_value); | |
| 1344 Do(BuildStoreExprTemp(for_left_value.value())); | |
| 1345 | |
| 1346 LocalVariable* temp_var = owner()->parsed_function().expression_temp_var(); | |
| 1347 LoadLocalNode* load_temp = | |
| 1348 new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var); | |
| 1349 LiteralNode* null_constant = | |
| 1350 new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance()); | |
| 1351 ComparisonNode* check_is_null = | |
| 1352 new(Z) ComparisonNode(Scanner::kNoSourcePos, | |
| 1353 Token::kEQ_STRICT, | |
| 1354 load_temp, | |
| 1355 null_constant); | |
|
srdjan
2015/06/17 18:15:36
Fix indentation.
hausner
2015/06/17 22:24:57
Done.
| |
| 1356 TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos); | |
| 1357 check_is_null->Visit(&for_test); | |
| 1358 | |
| 1359 ValueGraphVisitor for_right_value(owner()); | |
| 1360 node->right()->Visit(&for_right_value); | |
| 1361 for_right_value.Do(BuildStoreExprTemp(for_right_value.value())); | |
| 1362 | |
| 1363 ValueGraphVisitor for_temp(owner()); | |
| 1364 // Nothing to do, left value is already loaded into temp. | |
| 1365 | |
| 1366 Join(for_test, for_right_value, for_temp); | |
| 1367 return; | |
| 1338 } | 1368 } |
| 1339 ValueGraphVisitor for_left_value(owner()); | 1369 ValueGraphVisitor for_left_value(owner()); |
| 1340 node->left()->Visit(&for_left_value); | 1370 node->left()->Visit(&for_left_value); |
| 1341 Append(for_left_value); | 1371 Append(for_left_value); |
| 1342 PushArgumentInstr* push_left = PushArgument(for_left_value.value()); | 1372 PushArgumentInstr* push_left = PushArgument(for_left_value.value()); |
| 1343 | 1373 |
| 1344 ValueGraphVisitor for_right_value(owner()); | 1374 ValueGraphVisitor for_right_value(owner()); |
| 1345 node->right()->Visit(&for_right_value); | 1375 node->right()->Visit(&for_right_value); |
| 1346 Append(for_right_value); | 1376 Append(for_right_value); |
| 1347 PushArgumentInstr* push_right = PushArgument(for_right_value.value()); | 1377 PushArgumentInstr* push_right = PushArgument(for_right_value.value()); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1403 Join(for_test, for_right, for_false); | 1433 Join(for_test, for_right, for_false); |
| 1404 } else { | 1434 } else { |
| 1405 ASSERT(node->kind() == Token::kOR); | 1435 ASSERT(node->kind() == Token::kOR); |
| 1406 ValueGraphVisitor for_true(owner()); | 1436 ValueGraphVisitor for_true(owner()); |
| 1407 Value* constant_true = for_true.Bind(new(Z) ConstantInstr(Bool::True())); | 1437 Value* constant_true = for_true.Bind(new(Z) ConstantInstr(Bool::True())); |
| 1408 for_true.Do(BuildStoreExprTemp(constant_true)); | 1438 for_true.Do(BuildStoreExprTemp(constant_true)); |
| 1409 Join(for_test, for_true, for_right); | 1439 Join(for_test, for_true, for_right); |
| 1410 } | 1440 } |
| 1411 ReturnDefinition(BuildLoadExprTemp()); | 1441 ReturnDefinition(BuildLoadExprTemp()); |
| 1412 return; | 1442 return; |
| 1443 } else if (node->kind() == Token::kIFNULL) { | |
| 1444 // left ?? right. This operation cannot be overloaded. | |
| 1445 // temp = left; temp === null ? right : temp | |
| 1446 ValueGraphVisitor for_left_value(owner()); | |
| 1447 node->left()->Visit(&for_left_value); | |
| 1448 Append(for_left_value); | |
| 1449 Do(BuildStoreExprTemp(for_left_value.value())); | |
| 1450 | |
| 1451 LocalVariable* temp_var = owner()->parsed_function().expression_temp_var(); | |
| 1452 LoadLocalNode* load_temp = | |
| 1453 new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var); | |
| 1454 LiteralNode* null_constant = | |
| 1455 new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance()); | |
| 1456 ComparisonNode* check_is_null = | |
| 1457 new(Z) ComparisonNode(Scanner::kNoSourcePos, | |
| 1458 Token::kEQ_STRICT, | |
| 1459 load_temp, | |
| 1460 null_constant); | |
|
srdjan
2015/06/17 18:15:36
Fix indentation.
hausner
2015/06/17 22:24:57
Done.
| |
| 1461 TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos); | |
| 1462 check_is_null->Visit(&for_test); | |
| 1463 | |
| 1464 ValueGraphVisitor for_right_value(owner()); | |
| 1465 node->right()->Visit(&for_right_value); | |
| 1466 for_right_value.Do(BuildStoreExprTemp(for_right_value.value())); | |
| 1467 | |
| 1468 ValueGraphVisitor for_temp(owner()); | |
| 1469 // Nothing to do, left value is already loaded into temp. | |
| 1470 | |
| 1471 Join(for_test, for_right_value, for_temp); | |
| 1472 ReturnDefinition(BuildLoadExprTemp()); | |
| 1473 return; | |
| 1413 } | 1474 } |
| 1475 | |
| 1414 EffectGraphVisitor::VisitBinaryOpNode(node); | 1476 EffectGraphVisitor::VisitBinaryOpNode(node); |
| 1415 } | 1477 } |
| 1416 | 1478 |
| 1417 | 1479 |
| 1418 static const String& BinaryOpAndMaskName(BinaryOpNode* node) { | 1480 static const String& BinaryOpAndMaskName(BinaryOpNode* node) { |
| 1419 if (node->kind() == Token::kSHL) { | 1481 if (node->kind() == Token::kSHL) { |
| 1420 return Library::PrivateCoreLibName(Symbols::_leftShiftWithMask32()); | 1482 return Library::PrivateCoreLibName(Symbols::_leftShiftWithMask32()); |
| 1421 } | 1483 } |
| 1422 UNIMPLEMENTED(); | 1484 UNIMPLEMENTED(); |
| 1423 return String::ZoneHandle(Thread::Current()->zone(), String::null()); | 1485 return String::ZoneHandle(Thread::Current()->zone(), String::null()); |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2696 PushArgumentInstr* push_arg = PushArgument(for_argument.value()); | 2758 PushArgumentInstr* push_arg = PushArgument(for_argument.value()); |
| 2697 values->Add(push_arg); | 2759 values->Add(push_arg); |
| 2698 } | 2760 } |
| 2699 } | 2761 } |
| 2700 | 2762 |
| 2701 | 2763 |
| 2702 void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) { | 2764 void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) { |
| 2703 ValueGraphVisitor for_receiver(owner()); | 2765 ValueGraphVisitor for_receiver(owner()); |
| 2704 node->receiver()->Visit(&for_receiver); | 2766 node->receiver()->Visit(&for_receiver); |
| 2705 Append(for_receiver); | 2767 Append(for_receiver); |
| 2706 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | 2768 if (node->is_conditional()) { |
| 2707 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2769 Do(BuildStoreExprTemp(for_receiver.value())); |
| 2708 new(Z) ZoneGrowableArray<PushArgumentInstr*>( | 2770 LocalVariable* temp_var = owner()->parsed_function().expression_temp_var(); |
| 2709 node->arguments()->length() + 1); | 2771 LoadLocalNode* load_temp = |
| 2710 arguments->Add(push_receiver); | 2772 new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var); |
| 2711 | 2773 |
| 2712 BuildPushArguments(*node->arguments(), arguments); | 2774 LiteralNode* null_constant = |
| 2713 InstanceCallInstr* call = new(Z) InstanceCallInstr( | 2775 new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance()); |
| 2714 node->token_pos(), | 2776 ComparisonNode* check_is_null = |
| 2715 node->function_name(), | 2777 new(Z) ComparisonNode(Scanner::kNoSourcePos, |
| 2716 Token::kILLEGAL, | 2778 Token::kEQ, |
| 2717 arguments, | 2779 load_temp, |
| 2718 node->arguments()->names(), | 2780 null_constant); |
| 2719 1, | 2781 TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos); |
| 2720 owner()->ic_data_array()); | 2782 check_is_null->Visit(&for_test); |
| 2721 ReturnDefinition(call); | 2783 |
| 2784 EffectGraphVisitor for_true(owner()); | |
| 2785 EffectGraphVisitor for_false(owner()); | |
| 2786 | |
| 2787 StoreLocalNode* store_null = | |
| 2788 new(Z) StoreLocalNode(Scanner::kNoSourcePos, temp_var, null_constant); | |
| 2789 store_null->Visit(&for_true); | |
| 2790 | |
| 2791 InstanceCallNode* call = | |
| 2792 new(Z) InstanceCallNode(node->token_pos(), | |
| 2793 load_temp, | |
| 2794 node->function_name(), | |
| 2795 node->arguments()); | |
| 2796 StoreLocalNode* store_result = | |
| 2797 new(Z) StoreLocalNode(Scanner::kNoSourcePos, temp_var, call); | |
| 2798 store_result->Visit(&for_false); | |
| 2799 | |
| 2800 Join(for_test, for_true, for_false); | |
| 2801 ReturnDefinition(BuildLoadExprTemp()); | |
| 2802 } else { | |
| 2803 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | |
| 2804 ZoneGrowableArray<PushArgumentInstr*>* arguments = | |
| 2805 new(Z) ZoneGrowableArray<PushArgumentInstr*>( | |
| 2806 node->arguments()->length() + 1); | |
| 2807 arguments->Add(push_receiver); | |
| 2808 | |
| 2809 BuildPushArguments(*node->arguments(), arguments); | |
| 2810 InstanceCallInstr* call = new(Z) InstanceCallInstr( | |
| 2811 node->token_pos(), | |
| 2812 node->function_name(), | |
| 2813 Token::kILLEGAL, | |
| 2814 arguments, | |
| 2815 node->arguments()->names(), | |
| 2816 1, | |
| 2817 owner()->ic_data_array()); | |
| 2818 ReturnDefinition(call); | |
| 2819 } | |
| 2722 } | 2820 } |
| 2723 | 2821 |
| 2724 | 2822 |
| 2725 static intptr_t GetResultCidOfNativeFactory(const Function& function) { | 2823 static intptr_t GetResultCidOfNativeFactory(const Function& function) { |
| 2726 const Class& function_class = Class::Handle(function.Owner()); | 2824 const Class& function_class = Class::Handle(function.Owner()); |
| 2727 if (function_class.library() == Library::TypedDataLibrary()) { | 2825 if (function_class.library() == Library::TypedDataLibrary()) { |
| 2728 const String& function_name = String::Handle(function.name()); | 2826 const String& function_name = String::Handle(function.name()); |
| 2729 if (!String::EqualsIgnoringPrivateKey(function_name, Symbols::_New())) { | 2827 if (!String::EqualsIgnoringPrivateKey(function_name, Symbols::_New())) { |
| 2730 return kDynamicCid; | 2828 return kDynamicCid; |
| 2731 } | 2829 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3056 BuildConstructorCall(node, push_allocated_value); | 3154 BuildConstructorCall(node, push_allocated_value); |
| 3057 ReturnDefinition(ExitTempLocalScope(tmp_var)); | 3155 ReturnDefinition(ExitTempLocalScope(tmp_var)); |
| 3058 } | 3156 } |
| 3059 } | 3157 } |
| 3060 | 3158 |
| 3061 | 3159 |
| 3062 void EffectGraphVisitor::VisitInstanceGetterNode(InstanceGetterNode* node) { | 3160 void EffectGraphVisitor::VisitInstanceGetterNode(InstanceGetterNode* node) { |
| 3063 ValueGraphVisitor for_receiver(owner()); | 3161 ValueGraphVisitor for_receiver(owner()); |
| 3064 node->receiver()->Visit(&for_receiver); | 3162 node->receiver()->Visit(&for_receiver); |
| 3065 Append(for_receiver); | 3163 Append(for_receiver); |
| 3066 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | 3164 if (node->is_conditional()) { |
| 3067 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 3165 Do(BuildStoreExprTemp(for_receiver.value())); |
| 3068 new(Z) ZoneGrowableArray<PushArgumentInstr*>(1); | 3166 LocalVariable* temp_var = owner()->parsed_function().expression_temp_var(); |
| 3069 arguments->Add(push_receiver); | 3167 LoadLocalNode* load_temp = |
| 3070 const String& name = | 3168 new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var); |
| 3071 String::ZoneHandle(Z, Field::GetterSymbol(node->field_name())); | 3169 |
| 3072 InstanceCallInstr* call = new(Z) InstanceCallInstr( | 3170 LiteralNode* null_constant = |
| 3073 node->token_pos(), | 3171 new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance()); |
| 3074 name, | 3172 ComparisonNode* check_is_null = |
| 3075 Token::kGET, | 3173 new(Z) ComparisonNode(Scanner::kNoSourcePos, |
| 3076 arguments, Object::null_array(), | 3174 Token::kEQ, |
| 3077 1, | 3175 load_temp, |
| 3078 owner()->ic_data_array()); | 3176 null_constant); |
| 3079 ReturnDefinition(call); | 3177 TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos); |
| 3178 check_is_null->Visit(&for_test); | |
| 3179 | |
| 3180 EffectGraphVisitor for_true(owner()); | |
| 3181 EffectGraphVisitor for_false(owner()); | |
| 3182 | |
| 3183 StoreLocalNode* store_null = | |
| 3184 new(Z) StoreLocalNode(Scanner::kNoSourcePos, temp_var, null_constant); | |
| 3185 store_null->Visit(&for_true); | |
| 3186 | |
| 3187 InstanceGetterNode* getter = | |
| 3188 new(Z) InstanceGetterNode(node->token_pos(), | |
| 3189 load_temp, | |
| 3190 node->field_name()); | |
| 3191 StoreLocalNode* store_getter = | |
| 3192 new(Z) StoreLocalNode(Scanner::kNoSourcePos, temp_var, getter); | |
| 3193 store_getter->Visit(&for_false); | |
| 3194 | |
| 3195 Join(for_test, for_true, for_false); | |
| 3196 ReturnDefinition(BuildLoadExprTemp()); | |
| 3197 } else { | |
| 3198 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | |
| 3199 ZoneGrowableArray<PushArgumentInstr*>* arguments = | |
| 3200 new(Z) ZoneGrowableArray<PushArgumentInstr*>(1); | |
| 3201 arguments->Add(push_receiver); | |
| 3202 const String& name = | |
| 3203 String::ZoneHandle(Z, Field::GetterSymbol(node->field_name())); | |
| 3204 InstanceCallInstr* call = new(Z) InstanceCallInstr( | |
| 3205 node->token_pos(), | |
| 3206 name, | |
| 3207 Token::kGET, | |
| 3208 arguments, Object::null_array(), | |
| 3209 1, | |
| 3210 owner()->ic_data_array()); | |
| 3211 ReturnDefinition(call); | |
| 3212 } | |
| 3080 } | 3213 } |
| 3081 | 3214 |
| 3082 | 3215 |
| 3083 void EffectGraphVisitor::BuildInstanceSetterArguments( | 3216 void EffectGraphVisitor::BuildInstanceSetterArguments( |
| 3084 InstanceSetterNode* node, | 3217 InstanceSetterNode* node, |
| 3085 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 3218 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 3086 bool result_is_needed) { | 3219 bool result_is_needed) { |
| 3087 ValueGraphVisitor for_receiver(owner()); | 3220 ValueGraphVisitor for_receiver(owner()); |
| 3088 node->receiver()->Visit(&for_receiver); | 3221 node->receiver()->Visit(&for_receiver); |
| 3089 Append(for_receiver); | 3222 Append(for_receiver); |
| 3090 arguments->Add(PushArgument(for_receiver.value())); | 3223 arguments->Add(PushArgument(for_receiver.value())); |
| 3091 | 3224 |
| 3092 ValueGraphVisitor for_value(owner()); | 3225 ValueGraphVisitor for_value(owner()); |
| 3093 node->value()->Visit(&for_value); | 3226 node->value()->Visit(&for_value); |
| 3094 Append(for_value); | 3227 Append(for_value); |
| 3095 | 3228 |
| 3096 Value* value = NULL; | 3229 Value* value = NULL; |
| 3097 if (result_is_needed) { | 3230 if (result_is_needed) { |
| 3098 value = Bind(BuildStoreExprTemp(for_value.value())); | 3231 value = Bind(BuildStoreExprTemp(for_value.value())); |
| 3099 } else { | 3232 } else { |
| 3100 value = for_value.value(); | 3233 value = for_value.value(); |
| 3101 } | 3234 } |
| 3102 arguments->Add(PushArgument(value)); | 3235 arguments->Add(PushArgument(value)); |
| 3103 } | 3236 } |
| 3104 | 3237 |
| 3105 | 3238 |
| 3106 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { | 3239 void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { |
| 3240 if (node->is_conditional()) { | |
| 3241 ValueGraphVisitor for_receiver(owner()); | |
| 3242 node->receiver()->Visit(&for_receiver); | |
| 3243 Append(for_receiver); | |
| 3244 Do(BuildStoreExprTemp(for_receiver.value())); | |
| 3245 | |
| 3246 LocalVariable* temp_var = owner()->parsed_function().expression_temp_var(); | |
| 3247 LoadLocalNode* load_temp = | |
| 3248 new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var); | |
| 3249 LiteralNode* null_constant = | |
| 3250 new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance()); | |
| 3251 ComparisonNode* check_is_null = | |
| 3252 new(Z) ComparisonNode(Scanner::kNoSourcePos, | |
| 3253 Token::kEQ, | |
| 3254 load_temp, | |
| 3255 null_constant); | |
| 3256 TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos); | |
| 3257 check_is_null->Visit(&for_test); | |
| 3258 | |
| 3259 EffectGraphVisitor for_true(owner()); | |
| 3260 EffectGraphVisitor for_false(owner()); | |
| 3261 | |
| 3262 InstanceSetterNode* setter = | |
| 3263 new(Z) InstanceSetterNode(node->token_pos(), | |
| 3264 load_temp, | |
| 3265 node->field_name(), | |
| 3266 node->value()); | |
| 3267 setter->Visit(&for_false); | |
| 3268 Join(for_test, for_true, for_false); | |
| 3269 return; | |
| 3270 } | |
| 3107 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 3271 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 3108 new(Z) ZoneGrowableArray<PushArgumentInstr*>(2); | 3272 new(Z) ZoneGrowableArray<PushArgumentInstr*>(2); |
| 3109 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); | 3273 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); |
| 3110 const String& name = | 3274 const String& name = |
| 3111 String::ZoneHandle(Z, Field::SetterSymbol(node->field_name())); | 3275 String::ZoneHandle(Z, Field::SetterSymbol(node->field_name())); |
| 3112 const intptr_t kNumArgsChecked = 1; // Do not check value type. | 3276 const intptr_t kNumArgsChecked = 1; // Do not check value type. |
| 3113 InstanceCallInstr* call = new(Z) InstanceCallInstr(node->token_pos(), | 3277 InstanceCallInstr* call = new(Z) InstanceCallInstr(node->token_pos(), |
| 3114 name, | 3278 name, |
| 3115 Token::kSET, | 3279 Token::kSET, |
| 3116 arguments, | 3280 arguments, |
| 3117 Object::null_array(), | 3281 Object::null_array(), |
| 3118 kNumArgsChecked, | 3282 kNumArgsChecked, |
| 3119 owner()->ic_data_array()); | 3283 owner()->ic_data_array()); |
| 3120 ReturnDefinition(call); | 3284 ReturnDefinition(call); |
| 3121 } | 3285 } |
| 3122 | 3286 |
| 3123 | 3287 |
| 3124 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { | 3288 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { |
| 3289 if (node->is_conditional()) { | |
| 3290 ValueGraphVisitor for_receiver(owner()); | |
| 3291 node->receiver()->Visit(&for_receiver); | |
| 3292 Append(for_receiver); | |
| 3293 Do(BuildStoreExprTemp(for_receiver.value())); | |
| 3294 | |
| 3295 LocalVariable* temp_var = owner()->parsed_function().expression_temp_var(); | |
| 3296 LoadLocalNode* load_temp = | |
| 3297 new(Z) LoadLocalNode(Scanner::kNoSourcePos, temp_var); | |
| 3298 LiteralNode* null_constant = | |
| 3299 new(Z) LiteralNode(Scanner::kNoSourcePos, Object::null_instance()); | |
| 3300 ComparisonNode* check_is_null = | |
| 3301 new(Z) ComparisonNode(Scanner::kNoSourcePos, | |
| 3302 Token::kEQ, | |
| 3303 load_temp, | |
| 3304 null_constant); | |
| 3305 TestGraphVisitor for_test(owner(), Scanner::kNoSourcePos); | |
| 3306 check_is_null->Visit(&for_test); | |
| 3307 | |
| 3308 ValueGraphVisitor for_true(owner()); | |
| 3309 null_constant->Visit(&for_true); | |
| 3310 for_true.Do(BuildStoreExprTemp(for_true.value())); | |
| 3311 | |
| 3312 ValueGraphVisitor for_false(owner()); | |
| 3313 InstanceSetterNode* setter = | |
| 3314 new(Z) InstanceSetterNode(node->token_pos(), | |
| 3315 load_temp, | |
| 3316 node->field_name(), | |
| 3317 node->value()); | |
| 3318 setter->Visit(&for_false); | |
| 3319 for_false.Do(BuildStoreExprTemp(for_false.value())); | |
| 3320 | |
| 3321 Join(for_test, for_true, for_false); | |
| 3322 ReturnDefinition(BuildLoadExprTemp()); | |
| 3323 return; | |
| 3324 } | |
| 3125 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 3325 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 3126 new(Z) ZoneGrowableArray<PushArgumentInstr*>(2); | 3326 new(Z) ZoneGrowableArray<PushArgumentInstr*>(2); |
| 3127 BuildInstanceSetterArguments(node, arguments, kResultNeeded); | 3327 BuildInstanceSetterArguments(node, arguments, kResultNeeded); |
| 3128 const String& name = | 3328 const String& name = |
| 3129 String::ZoneHandle(Z, Field::SetterSymbol(node->field_name())); | 3329 String::ZoneHandle(Z, Field::SetterSymbol(node->field_name())); |
| 3130 const intptr_t kNumArgsChecked = 1; // Do not check value type. | 3330 const intptr_t kNumArgsChecked = 1; // Do not check value type. |
| 3131 Do(new(Z) InstanceCallInstr(node->token_pos(), | 3331 Do(new(Z) InstanceCallInstr(node->token_pos(), |
| 3132 name, | 3332 name, |
| 3133 Token::kSET, | 3333 Token::kSET, |
| 3134 arguments, | 3334 arguments, |
| (...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4527 Report::MessageF(Report::kBailout, | 4727 Report::MessageF(Report::kBailout, |
| 4528 Script::Handle(function.script()), | 4728 Script::Handle(function.script()), |
| 4529 function.token_pos(), | 4729 function.token_pos(), |
| 4530 "FlowGraphBuilder Bailout: %s %s", | 4730 "FlowGraphBuilder Bailout: %s %s", |
| 4531 String::Handle(function.name()).ToCString(), | 4731 String::Handle(function.name()).ToCString(), |
| 4532 reason); | 4732 reason); |
| 4533 UNREACHABLE(); | 4733 UNREACHABLE(); |
| 4534 } | 4734 } |
| 4535 | 4735 |
| 4536 } // namespace dart | 4736 } // namespace dart |
| OLD | NEW |