| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 | 1335 |
| 1336 | 1336 |
| 1337 bool FlowGraphOptimizer::TryInlineRecognizedMethod(intptr_t receiver_cid, | 1337 bool FlowGraphOptimizer::TryInlineRecognizedMethod(intptr_t receiver_cid, |
| 1338 const Function& target, | 1338 const Function& target, |
| 1339 Instruction* call, | 1339 Instruction* call, |
| 1340 Definition* receiver, | 1340 Definition* receiver, |
| 1341 intptr_t token_pos, | 1341 intptr_t token_pos, |
| 1342 const ICData& ic_data, | 1342 const ICData& ic_data, |
| 1343 TargetEntryInstr** entry, | 1343 TargetEntryInstr** entry, |
| 1344 Definition** last) { | 1344 Definition** last) { |
| 1345 ICData& value_check = ICData::ZoneHandle(isolate(), ICData::null()); | 1345 ICData& value_check = ICData::ZoneHandle(isolate()); |
| 1346 MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(target); | 1346 MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(target); |
| 1347 switch (kind) { | 1347 switch (kind) { |
| 1348 // Recognized [] operators. | 1348 // Recognized [] operators. |
| 1349 case MethodRecognizer::kImmutableArrayGetIndexed: | 1349 case MethodRecognizer::kImmutableArrayGetIndexed: |
| 1350 case MethodRecognizer::kObjectArrayGetIndexed: | 1350 case MethodRecognizer::kObjectArrayGetIndexed: |
| 1351 case MethodRecognizer::kGrowableArrayGetIndexed: | 1351 case MethodRecognizer::kGrowableArrayGetIndexed: |
| 1352 case MethodRecognizer::kInt8ArrayGetIndexed: | 1352 case MethodRecognizer::kInt8ArrayGetIndexed: |
| 1353 case MethodRecognizer::kUint8ArrayGetIndexed: | 1353 case MethodRecognizer::kUint8ArrayGetIndexed: |
| 1354 case MethodRecognizer::kUint8ClampedArrayGetIndexed: | 1354 case MethodRecognizer::kUint8ClampedArrayGetIndexed: |
| 1355 case MethodRecognizer::kExternalUint8ArrayGetIndexed: | 1355 case MethodRecognizer::kExternalUint8ArrayGetIndexed: |
| (...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3657 // Extract the instance call so we can use the function_name in the stored | 3657 // Extract the instance call so we can use the function_name in the stored |
| 3658 // value check ICData. | 3658 // value check ICData. |
| 3659 InstanceCallInstr* i_call = NULL; | 3659 InstanceCallInstr* i_call = NULL; |
| 3660 if (call->IsPolymorphicInstanceCall()) { | 3660 if (call->IsPolymorphicInstanceCall()) { |
| 3661 i_call = call->AsPolymorphicInstanceCall()->instance_call(); | 3661 i_call = call->AsPolymorphicInstanceCall()->instance_call(); |
| 3662 } else { | 3662 } else { |
| 3663 ASSERT(call->IsInstanceCall()); | 3663 ASSERT(call->IsInstanceCall()); |
| 3664 i_call = call->AsInstanceCall(); | 3664 i_call = call->AsInstanceCall(); |
| 3665 } | 3665 } |
| 3666 ASSERT(i_call != NULL); | 3666 ASSERT(i_call != NULL); |
| 3667 ICData& value_check = ICData::ZoneHandle(isolate(), ICData::null()); | 3667 ICData& value_check = ICData::ZoneHandle(isolate()); |
| 3668 switch (view_cid) { | 3668 switch (view_cid) { |
| 3669 case kTypedDataInt8ArrayCid: | 3669 case kTypedDataInt8ArrayCid: |
| 3670 case kTypedDataUint8ArrayCid: | 3670 case kTypedDataUint8ArrayCid: |
| 3671 case kTypedDataUint8ClampedArrayCid: | 3671 case kTypedDataUint8ClampedArrayCid: |
| 3672 case kExternalTypedDataUint8ArrayCid: | 3672 case kExternalTypedDataUint8ArrayCid: |
| 3673 case kExternalTypedDataUint8ClampedArrayCid: | 3673 case kExternalTypedDataUint8ClampedArrayCid: |
| 3674 case kTypedDataInt16ArrayCid: | 3674 case kTypedDataInt16ArrayCid: |
| 3675 case kTypedDataUint16ArrayCid: { | 3675 case kTypedDataUint16ArrayCid: { |
| 3676 // Check that value is always smi. | 3676 // Check that value is always smi. |
| 3677 value_check = ICData::New(flow_graph_->parsed_function().function(), | 3677 value_check = ICData::New(flow_graph_->parsed_function().function(), |
| (...skipping 6175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9853 } | 9853 } |
| 9854 | 9854 |
| 9855 // Insert materializations at environment uses. | 9855 // Insert materializations at environment uses. |
| 9856 for (intptr_t i = 0; i < exits.length(); i++) { | 9856 for (intptr_t i = 0; i < exits.length(); i++) { |
| 9857 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); | 9857 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); |
| 9858 } | 9858 } |
| 9859 } | 9859 } |
| 9860 | 9860 |
| 9861 | 9861 |
| 9862 } // namespace dart | 9862 } // namespace dart |
| OLD | NEW |