| 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 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3292 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | 3292 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| 3293 LoadFieldInstr* load = new(I) LoadFieldInstr( | 3293 LoadFieldInstr* load = new(I) LoadFieldInstr( |
| 3294 receiver, | 3294 receiver, |
| 3295 Bigint::digits_offset(), | 3295 Bigint::digits_offset(), |
| 3296 Type::ZoneHandle(I, Type::DynamicType()), | 3296 Type::ZoneHandle(I, Type::DynamicType()), |
| 3297 node->token_pos()); | 3297 node->token_pos()); |
| 3298 load->set_result_cid(kTypedDataUint32ArrayCid); | 3298 load->set_result_cid(kTypedDataUint32ArrayCid); |
| 3299 load->set_recognized_kind(kind); | 3299 load->set_recognized_kind(kind); |
| 3300 return ReturnDefinition(load); | 3300 return ReturnDefinition(load); |
| 3301 } | 3301 } |
| 3302 case MethodRecognizer::kBigint_setDigits: { | |
| 3303 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | |
| 3304 LocalVariable* value_var = | |
| 3305 node->scope()->LookupVariable(Symbols::Value(), true); | |
| 3306 ASSERT(value_var != NULL); | |
| 3307 Value* value = Bind(new(I) LoadLocalInstr(*value_var)); | |
| 3308 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | |
| 3309 Bigint::digits_offset(), | |
| 3310 receiver, | |
| 3311 value, | |
| 3312 kEmitStoreBarrier, | |
| 3313 node->token_pos()); | |
| 3314 Do(store); | |
| 3315 ConstantInstr* null_const = new(I) ConstantInstr( | |
| 3316 Object::ZoneHandle(I, Object::null())); | |
| 3317 return ReturnDefinition(null_const); | |
| 3318 } | |
| 3319 case MethodRecognizer::kBigint_getUsed: { | 3302 case MethodRecognizer::kBigint_getUsed: { |
| 3320 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | 3303 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| 3321 LoadFieldInstr* load = new(I) LoadFieldInstr( | 3304 LoadFieldInstr* load = new(I) LoadFieldInstr( |
| 3322 receiver, | 3305 receiver, |
| 3323 Bigint::used_offset(), | 3306 Bigint::used_offset(), |
| 3324 Type::ZoneHandle(I, Type::SmiType()), | 3307 Type::ZoneHandle(I, Type::SmiType()), |
| 3325 node->token_pos()); | 3308 node->token_pos()); |
| 3326 load->set_result_cid(kSmiCid); | 3309 load->set_result_cid(kSmiCid); |
| 3327 load->set_recognized_kind(kind); | 3310 load->set_recognized_kind(kind); |
| 3328 return ReturnDefinition(load); | 3311 return ReturnDefinition(load); |
| 3329 } | 3312 } |
| 3330 case MethodRecognizer::kBigint_setUsed: { | |
| 3331 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | |
| 3332 LocalVariable* value_var = | |
| 3333 node->scope()->LookupVariable(Symbols::Value(), true); | |
| 3334 ASSERT(value_var != NULL); | |
| 3335 Value* value = Bind(new(I) LoadLocalInstr(*value_var)); | |
| 3336 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | |
| 3337 Bigint::used_offset(), | |
| 3338 receiver, | |
| 3339 value, | |
| 3340 kNoStoreBarrier, | |
| 3341 node->token_pos()); | |
| 3342 Do(store); | |
| 3343 ConstantInstr* null_const = new(I) ConstantInstr( | |
| 3344 Object::ZoneHandle(I, Object::null())); | |
| 3345 return ReturnDefinition(null_const); | |
| 3346 } | |
| 3347 case MethodRecognizer::kBigint_getNeg: { | 3313 case MethodRecognizer::kBigint_getNeg: { |
| 3348 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | 3314 Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| 3349 LoadFieldInstr* load = new(I) LoadFieldInstr( | 3315 LoadFieldInstr* load = new(I) LoadFieldInstr( |
| 3350 receiver, | 3316 receiver, |
| 3351 Bigint::neg_offset(), | 3317 Bigint::neg_offset(), |
| 3352 Type::ZoneHandle(I, Type::BoolType()), | 3318 Type::ZoneHandle(I, Type::BoolType()), |
| 3353 node->token_pos()); | 3319 node->token_pos()); |
| 3354 load->set_result_cid(kBoolCid); | 3320 load->set_result_cid(kBoolCid); |
| 3355 load->set_recognized_kind(kind); | 3321 load->set_recognized_kind(kind); |
| 3356 return ReturnDefinition(load); | 3322 return ReturnDefinition(load); |
| 3357 } | 3323 } |
| 3358 case MethodRecognizer::kBigint_setNeg: { | |
| 3359 Value* receiver = Bind(BuildLoadThisVar(node->scope())); | |
| 3360 LocalVariable* value_var = | |
| 3361 node->scope()->LookupVariable(Symbols::Value(), true); | |
| 3362 ASSERT(value_var != NULL); | |
| 3363 Value* value = Bind(new(I) LoadLocalInstr(*value_var)); | |
| 3364 StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr( | |
| 3365 Bigint::neg_offset(), | |
| 3366 receiver, | |
| 3367 value, | |
| 3368 kEmitStoreBarrier, | |
| 3369 node->token_pos()); | |
| 3370 Do(store); | |
| 3371 ConstantInstr* null_const = new(I) ConstantInstr( | |
| 3372 Object::ZoneHandle(I, Object::null())); | |
| 3373 return ReturnDefinition(null_const); | |
| 3374 } | |
| 3375 default: | 3324 default: |
| 3376 break; | 3325 break; |
| 3377 } | 3326 } |
| 3378 } | 3327 } |
| 3379 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); | 3328 InlineBailout("EffectGraphVisitor::VisitNativeBodyNode"); |
| 3380 NativeCallInstr* native_call = new(I) NativeCallInstr(node); | 3329 NativeCallInstr* native_call = new(I) NativeCallInstr(node); |
| 3381 ReturnDefinition(native_call); | 3330 ReturnDefinition(native_call); |
| 3382 } | 3331 } |
| 3383 | 3332 |
| 3384 | 3333 |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 Report::MessageF(Report::kBailout, | 4260 Report::MessageF(Report::kBailout, |
| 4312 Script::Handle(function.script()), | 4261 Script::Handle(function.script()), |
| 4313 function.token_pos(), | 4262 function.token_pos(), |
| 4314 "FlowGraphBuilder Bailout: %s %s", | 4263 "FlowGraphBuilder Bailout: %s %s", |
| 4315 String::Handle(function.name()).ToCString(), | 4264 String::Handle(function.name()).ToCString(), |
| 4316 reason); | 4265 reason); |
| 4317 UNREACHABLE(); | 4266 UNREACHABLE(); |
| 4318 } | 4267 } |
| 4319 | 4268 |
| 4320 } // namespace dart | 4269 } // namespace dart |
| OLD | NEW |