| 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 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3268 node->scope()->LookupVariable(Symbols::TypeArgumentsParameter(), | 3268 node->scope()->LookupVariable(Symbols::TypeArgumentsParameter(), |
| 3269 true); | 3269 true); |
| 3270 Value* element_type = Bind(new(I) LoadLocalInstr(*type_args_parameter)); | 3270 Value* element_type = Bind(new(I) LoadLocalInstr(*type_args_parameter)); |
| 3271 LocalVariable* length_parameter = | 3271 LocalVariable* length_parameter = |
| 3272 node->scope()->LookupVariable(Symbols::Length(), true); | 3272 node->scope()->LookupVariable(Symbols::Length(), true); |
| 3273 Value* length = Bind(new(I) LoadLocalInstr(*length_parameter)); | 3273 Value* length = Bind(new(I) LoadLocalInstr(*length_parameter)); |
| 3274 CreateArrayInstr* create_array = | 3274 CreateArrayInstr* create_array = |
| 3275 new CreateArrayInstr(node->token_pos(), element_type, length); | 3275 new CreateArrayInstr(node->token_pos(), element_type, length); |
| 3276 return ReturnDefinition(create_array); | 3276 return ReturnDefinition(create_array); |
| 3277 } | 3277 } |
| 3278 case MethodRecognizer::kBigint_getDigits: { |
| 3279 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| 3280 LoadFieldInstr* load = new(I) LoadFieldInstr( |
| 3281 receiver, |
| 3282 Bigint::digits_offset(), |
| 3283 Type::ZoneHandle(I, Type::DynamicType()), |
| 3284 node->token_pos()); |
| 3285 // TODO(srdjan): Enabling the correct result type throws an NPE. |
| 3286 // load->set_result_cid(kTypedDataUint32ArrayCid); |
| 3287 load->set_result_cid(kDynamicCid); |
| 3288 load->set_recognized_kind(kind); |
| 3289 return ReturnDefinition(load); |
| 3290 } |
| 3291 case MethodRecognizer::kBigint_getUsed: { |
| 3292 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| 3293 LoadFieldInstr* load = new(I) LoadFieldInstr( |
| 3294 receiver, |
| 3295 Bigint::used_offset(), |
| 3296 Type::ZoneHandle(I, Type::SmiType()), |
| 3297 node->token_pos()); |
| 3298 load->set_result_cid(kSmiCid); |
| 3299 load->set_recognized_kind(kind); |
| 3300 return ReturnDefinition(load); |
| 3301 } |
| 3302 case MethodRecognizer::kBigint_getNeg: { |
| 3303 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| 3304 LoadFieldInstr* load = new(I) LoadFieldInstr( |
| 3305 receiver, |
| 3306 Bigint::neg_offset(), |
| 3307 Type::ZoneHandle(I, Type::BoolType()), |
| 3308 node->token_pos()); |
| 3309 load->set_result_cid(kBoolCid); |
| 3310 load->set_recognized_kind(kind); |
| 3311 return ReturnDefinition(load); |
| 3312 } |
| 3278 default: | 3313 default: |
| 3279 break; | 3314 break; |
| 3280 } | 3315 } |
| 3281 } | 3316 } |
| 3282 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); | 3317 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); |
| 3283 NativeCallInstr* native_call = new(I) NativeCallInstr(node); | 3318 NativeCallInstr* native_call = new(I) NativeCallInstr(node); |
| 3284 ReturnDefinition(native_call); | 3319 ReturnDefinition(native_call); |
| 3285 } | 3320 } |
| 3286 | 3321 |
| 3287 | 3322 |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4223 Report::MessageF(Report::kBailout, | 4258 Report::MessageF(Report::kBailout, |
| 4224 Script::Handle(function.script()), | 4259 Script::Handle(function.script()), |
| 4225 function.token_pos(), | 4260 function.token_pos(), |
| 4226 "FlowGraphBuilder Bailout: %s %s", | 4261 "FlowGraphBuilder Bailout: %s %s", |
| 4227 String::Handle(function.name()).ToCString(), | 4262 String::Handle(function.name()).ToCString(), |
| 4228 reason); | 4263 reason); |
| 4229 UNREACHABLE(); | 4264 UNREACHABLE(); |
| 4230 } | 4265 } |
| 4231 | 4266 |
| 4232 } // namespace dart | 4267 } // namespace dart |
| OLD | NEW |