| 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 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3122 Value* data = Bind(data_load); | 3122 Value* data = Bind(data_load); |
| 3123 LoadFieldInstr* length_load = new(I) LoadFieldInstr( | 3123 LoadFieldInstr* length_load = new(I) LoadFieldInstr( |
| 3124 data, | 3124 data, |
| 3125 Array::length_offset(), | 3125 Array::length_offset(), |
| 3126 Type::ZoneHandle(I, Type::SmiType()), | 3126 Type::ZoneHandle(I, Type::SmiType()), |
| 3127 node->token_pos()); | 3127 node->token_pos()); |
| 3128 length_load->set_result_cid(kSmiCid); | 3128 length_load->set_result_cid(kSmiCid); |
| 3129 length_load->set_recognized_kind(MethodRecognizer::kObjectArrayLength); | 3129 length_load->set_recognized_kind(MethodRecognizer::kObjectArrayLength); |
| 3130 return ReturnDefinition(length_load); | 3130 return ReturnDefinition(length_load); |
| 3131 } | 3131 } |
| 3132 case MethodRecognizer::kObjectArrayAllocate: { |
| 3133 LocalVariable* type_args_parameter = |
| 3134 node->scope()->LookupVariable(Symbols::TypeArgumentsParameter(), |
| 3135 true); |
| 3136 Value* element_type = Bind(new(I) LoadLocalInstr(*type_args_parameter)); |
| 3137 LocalVariable* length_parameter = |
| 3138 node->scope()->LookupVariable(Symbols::Length(), true); |
| 3139 Value* length = Bind(new(I) LoadLocalInstr(*length_parameter)); |
| 3140 CreateArrayInstr* create_array = |
| 3141 new CreateArrayInstr(node->token_pos(), element_type, length); |
| 3142 return ReturnDefinition(create_array); |
| 3143 } |
| 3132 default: | 3144 default: |
| 3133 break; | 3145 break; |
| 3134 } | 3146 } |
| 3135 } | 3147 } |
| 3136 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); | 3148 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); |
| 3137 NativeCallInstr* native_call = new(I) NativeCallInstr(node); | 3149 NativeCallInstr* native_call = new(I) NativeCallInstr(node); |
| 3138 ReturnDefinition(native_call); | 3150 ReturnDefinition(native_call); |
| 3139 } | 3151 } |
| 3140 | 3152 |
| 3141 | 3153 |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4005 Report::MessageF(Report::kBailout, | 4017 Report::MessageF(Report::kBailout, |
| 4006 Script::Handle(function.script()), | 4018 Script::Handle(function.script()), |
| 4007 function.token_pos(), | 4019 function.token_pos(), |
| 4008 "FlowGraphBuilder Bailout: %s %s", | 4020 "FlowGraphBuilder Bailout: %s %s", |
| 4009 String::Handle(function.name()).ToCString(), | 4021 String::Handle(function.name()).ToCString(), |
| 4010 reason); | 4022 reason); |
| 4011 UNREACHABLE(); | 4023 UNREACHABLE(); |
| 4012 } | 4024 } |
| 4013 | 4025 |
| 4014 } // namespace dart | 4026 } // namespace dart |
| OLD | NEW |