OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/kernel_binary_flowgraph.h" | 5 #include "vm/kernel_binary_flowgraph.h" |
6 #include "vm/compiler.h" | 6 #include "vm/compiler.h" |
7 #include "vm/longjump.h" | 7 #include "vm/longjump.h" |
8 #include "vm/object_store.h" | 8 #include "vm/object_store.h" |
9 | 9 |
10 #if !defined(DART_PRECOMPILED_RUNTIME) | 10 #if !defined(DART_PRECOMPILED_RUNTIME) |
(...skipping 5293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5304 | 5304 |
5305 const String& getter_name = ReadNameAsGetterName(); // read name. | 5305 const String& getter_name = ReadNameAsGetterName(); // read name. |
5306 | 5306 |
5307 const Function* interface_target = &Function::null_function(); | 5307 const Function* interface_target = &Function::null_function(); |
5308 NameIndex itarget_name = | 5308 NameIndex itarget_name = |
5309 ReadCanonicalNameReference(); // read interface_target_reference. | 5309 ReadCanonicalNameReference(); // read interface_target_reference. |
5310 if (FLAG_experimental_strong_mode && !H.IsRoot(itarget_name) && | 5310 if (FLAG_experimental_strong_mode && !H.IsRoot(itarget_name) && |
5311 (H.IsGetter(itarget_name) || H.IsField(itarget_name))) { | 5311 (H.IsGetter(itarget_name) || H.IsField(itarget_name))) { |
5312 interface_target = &Function::ZoneHandle( | 5312 interface_target = &Function::ZoneHandle( |
5313 Z, LookupMethodByMember(itarget_name, H.DartGetterName(itarget_name))); | 5313 Z, LookupMethodByMember(itarget_name, H.DartGetterName(itarget_name))); |
5314 ASSERT(getter_name.Equals(String::Handle(interface_target->name()))); | |
rmacnak
2017/08/22 21:24:24
Stronger: They should both be symbols.
ASSERT(name
alexmarkov
2017/08/22 22:53:11
Done.
| |
5314 } | 5315 } |
5315 | 5316 |
5316 const intptr_t kTypeArgsLen = 0; | 5317 const intptr_t kTypeArgsLen = 0; |
5317 const intptr_t kNumArgsChecked = 1; | 5318 const intptr_t kNumArgsChecked = 1; |
5318 return instructions + InstanceCall(position, getter_name, Token::kGET, | 5319 return instructions + InstanceCall(position, getter_name, Token::kGET, |
5319 kTypeArgsLen, 1, Array::null_array(), | 5320 kTypeArgsLen, 1, Array::null_array(), |
5320 kNumArgsChecked, *interface_target); | 5321 kNumArgsChecked, *interface_target); |
5321 } | 5322 } |
5322 | 5323 |
5323 Fragment StreamingFlowGraphBuilder::BuildPropertySet(TokenPosition* p) { | 5324 Fragment StreamingFlowGraphBuilder::BuildPropertySet(TokenPosition* p) { |
(...skipping 11 matching lines...) Expand all Loading... | |
5335 instructions += BuildExpression(); // read value. | 5336 instructions += BuildExpression(); // read value. |
5336 instructions += StoreLocal(TokenPosition::kNoSource, variable); | 5337 instructions += StoreLocal(TokenPosition::kNoSource, variable); |
5337 instructions += PushArgument(); | 5338 instructions += PushArgument(); |
5338 | 5339 |
5339 const Function* interface_target = &Function::null_function(); | 5340 const Function* interface_target = &Function::null_function(); |
5340 NameIndex itarget_name = | 5341 NameIndex itarget_name = |
5341 ReadCanonicalNameReference(); // read interface_target_reference. | 5342 ReadCanonicalNameReference(); // read interface_target_reference. |
5342 if (FLAG_experimental_strong_mode && !H.IsRoot(itarget_name)) { | 5343 if (FLAG_experimental_strong_mode && !H.IsRoot(itarget_name)) { |
5343 interface_target = &Function::ZoneHandle( | 5344 interface_target = &Function::ZoneHandle( |
5344 Z, LookupMethodByMember(itarget_name, H.DartSetterName(itarget_name))); | 5345 Z, LookupMethodByMember(itarget_name, H.DartSetterName(itarget_name))); |
5346 ASSERT(setter_name.Equals(String::Handle(interface_target->name()))); | |
rmacnak
2017/08/22 21:24:24
"
alexmarkov
2017/08/22 22:53:11
Done.
| |
5345 } | 5347 } |
5346 | 5348 |
5347 const intptr_t kTypeArgsLen = 0; | 5349 const intptr_t kTypeArgsLen = 0; |
5348 const intptr_t kNumArgsChecked = 1; | 5350 const intptr_t kNumArgsChecked = 1; |
5349 instructions += | 5351 instructions += |
5350 InstanceCall(position, setter_name, Token::kSET, kTypeArgsLen, 2, | 5352 InstanceCall(position, setter_name, Token::kSET, kTypeArgsLen, 2, |
5351 Array::null_array(), kNumArgsChecked, *interface_target); | 5353 Array::null_array(), kNumArgsChecked, *interface_target); |
5352 | 5354 |
5353 return instructions + Drop(); | 5355 return instructions + Drop(); |
5354 } | 5356 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5566 // If we have a special operation (e.g. +/-/==) we mark both arguments as | 5568 // If we have a special operation (e.g. +/-/==) we mark both arguments as |
5567 // to be checked. | 5569 // to be checked. |
5568 if (token_kind != Token::kILLEGAL) { | 5570 if (token_kind != Token::kILLEGAL) { |
5569 ASSERT(argument_count <= 2); | 5571 ASSERT(argument_count <= 2); |
5570 checked_argument_count = argument_count; | 5572 checked_argument_count = argument_count; |
5571 } | 5573 } |
5572 | 5574 |
5573 const Function* interface_target = &Function::null_function(); | 5575 const Function* interface_target = &Function::null_function(); |
5574 NameIndex itarget_name = | 5576 NameIndex itarget_name = |
5575 ReadCanonicalNameReference(); // read interface_target_reference. | 5577 ReadCanonicalNameReference(); // read interface_target_reference. |
5576 if (FLAG_experimental_strong_mode && !H.IsRoot(itarget_name)) { | 5578 if (FLAG_experimental_strong_mode && !H.IsRoot(itarget_name) && |
5579 !H.IsField(itarget_name)) { | |
5577 interface_target = &Function::ZoneHandle( | 5580 interface_target = &Function::ZoneHandle( |
5578 Z, | 5581 Z, |
5579 LookupMethodByMember(itarget_name, H.DartProcedureName(itarget_name))); | 5582 LookupMethodByMember(itarget_name, H.DartProcedureName(itarget_name))); |
5583 ASSERT(name.Equals(String::Handle(interface_target->name()))); | |
rmacnak
2017/08/22 21:24:24
"
alexmarkov
2017/08/22 22:53:11
Done.
| |
5580 } | 5584 } |
5581 | 5585 |
5582 instructions += | 5586 instructions += |
5583 InstanceCall(position, name, token_kind, kTypeArgsLen, argument_count, | 5587 InstanceCall(position, name, token_kind, kTypeArgsLen, argument_count, |
5584 argument_names, checked_argument_count, *interface_target); | 5588 argument_names, checked_argument_count, *interface_target); |
5585 // Later optimization passes assume that result of a x.[]=(...) call is not | 5589 // Later optimization passes assume that result of a x.[]=(...) call is not |
5586 // used. We must guarantee this invariant because violation will lead to an | 5590 // used. We must guarantee this invariant because violation will lead to an |
5587 // illegal IL once we replace x.[]=(...) with a sequence that does not | 5591 // illegal IL once we replace x.[]=(...) with a sequence that does not |
5588 // actually produce any value. See http://dartbug.com/29135 for more details. | 5592 // actually produce any value. See http://dartbug.com/29135 for more details. |
5589 if (name.raw() == Symbols::AssignIndexToken().raw()) { | 5593 if (name.raw() == Symbols::AssignIndexToken().raw()) { |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7793 } | 7797 } |
7794 } | 7798 } |
7795 | 7799 |
7796 return Array::Handle(Array::null()); | 7800 return Array::Handle(Array::null()); |
7797 } | 7801 } |
7798 | 7802 |
7799 } // namespace kernel | 7803 } // namespace kernel |
7800 } // namespace dart | 7804 } // namespace dart |
7801 | 7805 |
7802 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 7806 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |