OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2329 } | 2329 } |
2330 | 2330 |
2331 | 2331 |
2332 LocationSummary* StaticCallInstr::MakeLocationSummary(Isolate* isolate, | 2332 LocationSummary* StaticCallInstr::MakeLocationSummary(Isolate* isolate, |
2333 bool optimizing) const { | 2333 bool optimizing) const { |
2334 return MakeCallSummary(); | 2334 return MakeCallSummary(); |
2335 } | 2335 } |
2336 | 2336 |
2337 | 2337 |
2338 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2338 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2339 ICData& call_ic_data = ICData::ZoneHandle(ic_data()->raw()); |
| 2340 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { |
| 2341 const Array& arguments_descriptor = |
| 2342 Array::Handle(ArgumentsDescriptor::New(ArgumentCount(), |
| 2343 argument_names())); |
| 2344 // TODO(srdjan): Improve performance of function recognition. |
| 2345 MethodRecognizer::Kind recognized_kind = |
| 2346 MethodRecognizer::RecognizeKind(function()); |
| 2347 int num_args_checked = 0; |
| 2348 if ((recognized_kind == MethodRecognizer::kMathMin) || |
| 2349 (recognized_kind == MethodRecognizer::kMathMax)) { |
| 2350 num_args_checked = 2; |
| 2351 } |
| 2352 call_ic_data = ICData::New(compiler->parsed_function().function(), |
| 2353 String::Handle(function().name()), |
| 2354 arguments_descriptor, |
| 2355 deopt_id(), |
| 2356 num_args_checked); // No arguments checked. |
| 2357 call_ic_data.AddTarget(function()); |
| 2358 } |
2339 if (!compiler->is_optimizing()) { | 2359 if (!compiler->is_optimizing()) { |
2340 // Some static calls can be optimized by the optimizing compiler (e.g. sqrt) | 2360 // Some static calls can be optimized by the optimizing compiler (e.g. sqrt) |
2341 // and therefore need a deoptimization descriptor. | 2361 // and therefore need a deoptimization descriptor. |
2342 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 2362 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
2343 deopt_id(), | 2363 deopt_id(), |
2344 token_pos()); | 2364 token_pos()); |
2345 } | 2365 } |
2346 compiler->GenerateStaticCall(deopt_id(), | 2366 compiler->GenerateStaticCall(deopt_id(), |
2347 token_pos(), | 2367 token_pos(), |
2348 function(), | 2368 function(), |
2349 ArgumentCount(), | 2369 ArgumentCount(), |
2350 argument_names(), | 2370 argument_names(), |
2351 locs()); | 2371 locs(), |
| 2372 call_ic_data); |
2352 } | 2373 } |
2353 | 2374 |
2354 | 2375 |
2355 void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2376 void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2356 compiler->GenerateAssertAssignable(token_pos(), | 2377 compiler->GenerateAssertAssignable(token_pos(), |
2357 deopt_id(), | 2378 deopt_id(), |
2358 dst_type(), | 2379 dst_type(), |
2359 dst_name(), | 2380 dst_name(), |
2360 locs()); | 2381 locs()); |
2361 ASSERT(locs()->in(0).reg() == locs()->out(0).reg()); | 2382 ASSERT(locs()->in(0).reg() == locs()->out(0).reg()); |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3469 case Token::kTRUNCDIV: return 0; | 3490 case Token::kTRUNCDIV: return 0; |
3470 case Token::kMOD: return 1; | 3491 case Token::kMOD: return 1; |
3471 default: UNIMPLEMENTED(); return -1; | 3492 default: UNIMPLEMENTED(); return -1; |
3472 } | 3493 } |
3473 } | 3494 } |
3474 | 3495 |
3475 | 3496 |
3476 #undef __ | 3497 #undef __ |
3477 | 3498 |
3478 } // namespace dart | 3499 } // namespace dart |
OLD | NEW |