| 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 4372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4383 new(I) ZoneGrowableArray<Value*>(call->ArgumentCount()); | 4383 new(I) ZoneGrowableArray<Value*>(call->ArgumentCount()); |
| 4384 for (intptr_t i = 0; i < call->ArgumentCount(); i++) { | 4384 for (intptr_t i = 0; i < call->ArgumentCount(); i++) { |
| 4385 args->Add(new(I) Value(call->ArgumentAt(i))); | 4385 args->Add(new(I) Value(call->ArgumentAt(i))); |
| 4386 } | 4386 } |
| 4387 InvokeMathCFunctionInstr* invoke = | 4387 InvokeMathCFunctionInstr* invoke = |
| 4388 new(I) InvokeMathCFunctionInstr(args, | 4388 new(I) InvokeMathCFunctionInstr(args, |
| 4389 call->deopt_id(), | 4389 call->deopt_id(), |
| 4390 recognized_kind, | 4390 recognized_kind, |
| 4391 call->token_pos()); | 4391 call->token_pos()); |
| 4392 ReplaceCall(call, invoke); | 4392 ReplaceCall(call, invoke); |
| 4393 } else if (recognized_kind == MethodRecognizer::kObjectArrayAllocate) { | |
| 4394 Value* type = new(I) Value(call->ArgumentAt(0)); | |
| 4395 Value* num_elements = new(I) Value(call->ArgumentAt(1)); | |
| 4396 CreateArrayInstr* create_array = | |
| 4397 new(I) CreateArrayInstr(call->token_pos(), type, num_elements); | |
| 4398 ReplaceCall(call, create_array); | |
| 4399 } else if (recognized_kind == MethodRecognizer::kDoubleFromInteger) { | 4393 } else if (recognized_kind == MethodRecognizer::kDoubleFromInteger) { |
| 4400 if (call->HasICData() && (call->ic_data()->NumberOfChecks() == 1)) { | 4394 if (call->HasICData() && (call->ic_data()->NumberOfChecks() == 1)) { |
| 4401 const ICData& ic_data = *call->ic_data(); | 4395 const ICData& ic_data = *call->ic_data(); |
| 4402 if (CanUnboxDouble() && ArgIsAlways(kSmiCid, ic_data, 0)) { | 4396 if (CanUnboxDouble() && ArgIsAlways(kSmiCid, ic_data, 0)) { |
| 4403 Definition* arg = call->ArgumentAt(0); | 4397 Definition* arg = call->ArgumentAt(0); |
| 4404 InsertBefore(call, | 4398 InsertBefore(call, |
| 4405 new(I) CheckSmiInstr( | 4399 new(I) CheckSmiInstr( |
| 4406 new(I) Value(arg), | 4400 new(I) Value(arg), |
| 4407 call->deopt_id(), | 4401 call->deopt_id(), |
| 4408 call->token_pos()), | 4402 call->token_pos()), |
| (...skipping 5209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9618 | 9612 |
| 9619 // Insert materializations at environment uses. | 9613 // Insert materializations at environment uses. |
| 9620 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 9614 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 9621 CreateMaterializationAt( | 9615 CreateMaterializationAt( |
| 9622 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 9616 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
| 9623 } | 9617 } |
| 9624 } | 9618 } |
| 9625 | 9619 |
| 9626 | 9620 |
| 9627 } // namespace dart | 9621 } // namespace dart |
| OLD | NEW |