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 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3311 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | 3311 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
3312 LoadFieldInstr* load = new(I) LoadFieldInstr( | 3312 LoadFieldInstr* load = new(I) LoadFieldInstr( |
3313 receiver, | 3313 receiver, |
3314 Bigint::digits_offset(), | 3314 Bigint::digits_offset(), |
3315 Type::ZoneHandle(I, Type::DynamicType()), | 3315 Type::ZoneHandle(I, Type::DynamicType()), |
3316 node->token_pos()); | 3316 node->token_pos()); |
3317 load->set_result_cid(kTypedDataUint32ArrayCid); | 3317 load->set_result_cid(kTypedDataUint32ArrayCid); |
3318 load->set_recognized_kind(kind); | 3318 load->set_recognized_kind(kind); |
3319 return ReturnDefinition(load); | 3319 return ReturnDefinition(load); |
3320 } | 3320 } |
3321 case MethodRecognizer::kBigint_setDigits: { | |
3322 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | |
3323 LocalVariable* value_var = | |
3324 node->scope()->LookupVariable(Symbols::Value(), true); | |
3325 ASSERT(value_var != NULL); | |
3326 Value* value = Bind(new(I) LoadLocalInstr(*value_var)); | |
3327 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | |
3328 Bigint::digits_offset(), | |
3329 receiver, | |
3330 value, | |
3331 kEmitStoreBarrier, | |
3332 node->token_pos()); | |
3333 Do(store); | |
3334 ConstantInstr* null_const = new(I) ConstantInstr( | |
3335 Object::ZoneHandle(I, Object::null())); | |
3336 return ReturnDefinition(null_const); | |
3337 } | |
3338 case MethodRecognizer::kBigint_getUsed: { | 3321 case MethodRecognizer::kBigint_getUsed: { |
3339 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | 3322 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
3340 LoadFieldInstr* load = new(I) LoadFieldInstr( | 3323 LoadFieldInstr* load = new(I) LoadFieldInstr( |
3341 receiver, | 3324 receiver, |
3342 Bigint::used_offset(), | 3325 Bigint::used_offset(), |
3343 Type::ZoneHandle(I, Type::SmiType()), | 3326 Type::ZoneHandle(I, Type::SmiType()), |
3344 node->token_pos()); | 3327 node->token_pos()); |
3345 load->set_result_cid(kSmiCid); | 3328 load->set_result_cid(kSmiCid); |
3346 load->set_recognized_kind(kind); | 3329 load->set_recognized_kind(kind); |
3347 return ReturnDefinition(load); | 3330 return ReturnDefinition(load); |
3348 } | 3331 } |
3349 case MethodRecognizer::kBigint_setUsed: { | |
3350 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | |
3351 LocalVariable* value_var = | |
3352 node->scope()->LookupVariable(Symbols::Value(), true); | |
3353 ASSERT(value_var != NULL); | |
3354 Value* value = Bind(new(I) LoadLocalInstr(*value_var)); | |
3355 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | |
3356 Bigint::used_offset(), | |
3357 receiver, | |
3358 value, | |
3359 kNoStoreBarrier, | |
3360 node->token_pos()); | |
3361 Do(store); | |
3362 ConstantInstr* null_const = new(I) ConstantInstr( | |
3363 Object::ZoneHandle(I, Object::null())); | |
3364 return ReturnDefinition(null_const); | |
3365 } | |
3366 case MethodRecognizer::kBigint_getNeg: { | 3332 case MethodRecognizer::kBigint_getNeg: { |
3367 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | 3333 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
3368 LoadFieldInstr* load = new(I) LoadFieldInstr( | 3334 LoadFieldInstr* load = new(I) LoadFieldInstr( |
3369 receiver, | 3335 receiver, |
3370 Bigint::neg_offset(), | 3336 Bigint::neg_offset(), |
3371 Type::ZoneHandle(I, Type::BoolType()), | 3337 Type::ZoneHandle(I, Type::BoolType()), |
3372 node->token_pos()); | 3338 node->token_pos()); |
3373 load->set_result_cid(kBoolCid); | 3339 load->set_result_cid(kBoolCid); |
3374 load->set_recognized_kind(kind); | 3340 load->set_recognized_kind(kind); |
3375 return ReturnDefinition(load); | 3341 return ReturnDefinition(load); |
3376 } | 3342 } |
3377 case MethodRecognizer::kBigint_setNeg: { | |
3378 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | |
3379 LocalVariable* value_var = | |
3380 node->scope()->LookupVariable(Symbols::Value(), true); | |
3381 ASSERT(value_var != NULL); | |
3382 Value* value = Bind(new(I) LoadLocalInstr(*value_var)); | |
3383 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | |
3384 Bigint::neg_offset(), | |
3385 receiver, | |
3386 value, | |
3387 kEmitStoreBarrier, | |
3388 node->token_pos()); | |
3389 Do(store); | |
3390 ConstantInstr* null_const = new(I) ConstantInstr( | |
3391 Object::ZoneHandle(I, Object::null())); | |
3392 return ReturnDefinition(null_const); | |
3393 } | |
3394 default: | 3343 default: |
3395 break; | 3344 break; |
3396 } | 3345 } |
3397 } | 3346 } |
3398 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); | 3347 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); |
3399 NativeCallInstr* native_call = new(I) NativeCallInstr(node); | 3348 NativeCallInstr* native_call = new(I) NativeCallInstr(node); |
3400 ReturnDefinition(native_call); | 3349 ReturnDefinition(native_call); |
3401 } | 3350 } |
3402 | 3351 |
3403 | 3352 |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 Report::MessageF(Report::kBailout, | 4282 Report::MessageF(Report::kBailout, |
4334 Script::Handle(function.script()), | 4283 Script::Handle(function.script()), |
4335 function.token_pos(), | 4284 function.token_pos(), |
4336 "FlowGraphBuilder Bailout: %s %s", | 4285 "FlowGraphBuilder Bailout: %s %s", |
4337 String::Handle(function.name()).ToCString(), | 4286 String::Handle(function.name()).ToCString(), |
4338 reason); | 4287 reason); |
4339 UNREACHABLE(); | 4288 UNREACHABLE(); |
4340 } | 4289 } |
4341 | 4290 |
4342 } // namespace dart | 4291 } // namespace dart |
OLD | NEW |