| 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/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3444 case MethodRecognizer::kGrowableArrayLength: | 3444 case MethodRecognizer::kGrowableArrayLength: |
| 3445 case MethodRecognizer::kObjectArrayLength: | 3445 case MethodRecognizer::kObjectArrayLength: |
| 3446 case MethodRecognizer::kImmutableArrayLength: | 3446 case MethodRecognizer::kImmutableArrayLength: |
| 3447 case MethodRecognizer::kTypedDataLength: { | 3447 case MethodRecognizer::kTypedDataLength: { |
| 3448 LoadFieldInstr* load = BuildNativeGetter( | 3448 LoadFieldInstr* load = BuildNativeGetter( |
| 3449 node, kind, OffsetForLengthGetter(kind), | 3449 node, kind, OffsetForLengthGetter(kind), |
| 3450 Type::ZoneHandle(Z, Type::SmiType()), kSmiCid); | 3450 Type::ZoneHandle(Z, Type::SmiType()), kSmiCid); |
| 3451 load->set_is_immutable(kind != MethodRecognizer::kGrowableArrayLength); | 3451 load->set_is_immutable(kind != MethodRecognizer::kGrowableArrayLength); |
| 3452 return ReturnDefinition(load); | 3452 return ReturnDefinition(load); |
| 3453 } | 3453 } |
| 3454 #if !defined(TARGET_ARCH_DBC) | |
| 3455 // TODO(vegorov) add bytecode to support this method. | |
| 3456 case MethodRecognizer::kClassIDgetID: { | 3454 case MethodRecognizer::kClassIDgetID: { |
| 3457 LocalVariable* value_var = | 3455 LocalVariable* value_var = |
| 3458 node->scope()->LookupVariable(Symbols::Value(), true); | 3456 node->scope()->LookupVariable(Symbols::Value(), true); |
| 3459 Value* value = Bind(new(Z) LoadLocalInstr(*value_var, token_pos)); | 3457 Value* value = Bind(new(Z) LoadLocalInstr(*value_var, token_pos)); |
| 3460 LoadClassIdInstr* load = new(Z) LoadClassIdInstr(value); | 3458 LoadClassIdInstr* load = new(Z) LoadClassIdInstr(value); |
| 3461 return ReturnDefinition(load); | 3459 return ReturnDefinition(load); |
| 3462 } | 3460 } |
| 3463 #endif | |
| 3464 case MethodRecognizer::kGrowableArrayCapacity: { | 3461 case MethodRecognizer::kGrowableArrayCapacity: { |
| 3465 Value* receiver = Bind(BuildLoadThisVar(node->scope(), token_pos)); | 3462 Value* receiver = Bind(BuildLoadThisVar(node->scope(), token_pos)); |
| 3466 LoadFieldInstr* data_load = new(Z) LoadFieldInstr( | 3463 LoadFieldInstr* data_load = new(Z) LoadFieldInstr( |
| 3467 receiver, | 3464 receiver, |
| 3468 Array::data_offset(), | 3465 Array::data_offset(), |
| 3469 Object::dynamic_type(), | 3466 Object::dynamic_type(), |
| 3470 node->token_pos()); | 3467 node->token_pos()); |
| 3471 data_load->set_result_cid(kArrayCid); | 3468 data_load->set_result_cid(kArrayCid); |
| 3472 Value* data = Bind(data_load); | 3469 Value* data = Bind(data_load); |
| 3473 LoadFieldInstr* length_load = new(Z) LoadFieldInstr( | 3470 LoadFieldInstr* length_load = new(Z) LoadFieldInstr( |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4619 Script::Handle(function.script()), | 4616 Script::Handle(function.script()), |
| 4620 function.token_pos(), | 4617 function.token_pos(), |
| 4621 Report::AtLocation, | 4618 Report::AtLocation, |
| 4622 "FlowGraphBuilder Bailout: %s %s", | 4619 "FlowGraphBuilder Bailout: %s %s", |
| 4623 String::Handle(function.name()).ToCString(), | 4620 String::Handle(function.name()).ToCString(), |
| 4624 reason); | 4621 reason); |
| 4625 UNREACHABLE(); | 4622 UNREACHABLE(); |
| 4626 } | 4623 } |
| 4627 | 4624 |
| 4628 } // namespace dart | 4625 } // namespace dart |
| OLD | NEW |