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/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
11 #include "vm/flow_graph_builder.h" | 11 #include "vm/flow_graph_builder.h" |
12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
13 #include "vm/flow_graph_optimizer.h" | 13 #include "vm/flow_graph_optimizer.h" |
14 #include "vm/flow_graph_range_analysis.h" | 14 #include "vm/flow_graph_range_analysis.h" |
15 #include "vm/locations.h" | 15 #include "vm/locations.h" |
16 #include "vm/method_recognizer.h" | 16 #include "vm/method_recognizer.h" |
17 #include "vm/object.h" | 17 #include "vm/object.h" |
18 #include "vm/object_store.h" | 18 #include "vm/object_store.h" |
19 #include "vm/os.h" | 19 #include "vm/os.h" |
| 20 #include "vm/regexp_assembler.h" |
20 #include "vm/resolver.h" | 21 #include "vm/resolver.h" |
21 #include "vm/scopes.h" | 22 #include "vm/scopes.h" |
22 #include "vm/stub_code.h" | 23 #include "vm/stub_code.h" |
23 #include "vm/symbols.h" | 24 #include "vm/symbols.h" |
24 | 25 |
25 #include "vm/il_printer.h" | 26 #include "vm/il_printer.h" |
26 | 27 |
27 namespace dart { | 28 namespace dart { |
28 | 29 |
29 DEFINE_FLAG(bool, propagate_ic_data, true, | 30 DEFINE_FLAG(bool, propagate_ic_data, true, |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 } | 445 } |
445 | 446 |
446 | 447 |
447 GraphEntryInstr::GraphEntryInstr(const ParsedFunction* parsed_function, | 448 GraphEntryInstr::GraphEntryInstr(const ParsedFunction* parsed_function, |
448 TargetEntryInstr* normal_entry, | 449 TargetEntryInstr* normal_entry, |
449 intptr_t osr_id) | 450 intptr_t osr_id) |
450 : BlockEntryInstr(0, CatchClauseNode::kInvalidTryIndex), | 451 : BlockEntryInstr(0, CatchClauseNode::kInvalidTryIndex), |
451 parsed_function_(parsed_function), | 452 parsed_function_(parsed_function), |
452 normal_entry_(normal_entry), | 453 normal_entry_(normal_entry), |
453 catch_entries_(), | 454 catch_entries_(), |
| 455 indirect_entries_(), |
454 initial_definitions_(), | 456 initial_definitions_(), |
455 osr_id_(osr_id), | 457 osr_id_(osr_id), |
456 entry_count_(0), | 458 entry_count_(0), |
457 spill_slot_count_(0), | 459 spill_slot_count_(0), |
458 fixed_slot_count_(0) { | 460 fixed_slot_count_(0) { |
459 } | 461 } |
460 | 462 |
461 | 463 |
462 ConstantInstr* GraphEntryInstr::constant_null() { | 464 ConstantInstr* GraphEntryInstr::constant_null() { |
463 ASSERT(initial_definitions_.length() > 0); | 465 ASSERT(initial_definitions_.length() > 0); |
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2521 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 2523 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
2522 GetDeoptId(), | 2524 GetDeoptId(), |
2523 Scanner::kNoSourcePos); | 2525 Scanner::kNoSourcePos); |
2524 } | 2526 } |
2525 if (HasParallelMove()) { | 2527 if (HasParallelMove()) { |
2526 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 2528 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
2527 } | 2529 } |
2528 } | 2530 } |
2529 | 2531 |
2530 | 2532 |
| 2533 LocationSummary* IndirectEntryInstr::MakeLocationSummary( |
| 2534 Isolate* isolate, bool optimizing) const { |
| 2535 return JoinEntryInstr::MakeLocationSummary(isolate, optimizing); |
| 2536 } |
| 2537 |
| 2538 |
| 2539 void IndirectEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2540 JoinEntryInstr::EmitNativeCode(compiler); |
| 2541 } |
| 2542 |
| 2543 |
2531 LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate, | 2544 LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate, |
2532 bool optimizing) const { | 2545 bool optimizing) const { |
2533 UNREACHABLE(); | 2546 UNREACHABLE(); |
2534 return NULL; | 2547 return NULL; |
2535 } | 2548 } |
2536 | 2549 |
2537 | 2550 |
2538 void PhiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2551 void PhiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2539 UNREACHABLE(); | 2552 UNREACHABLE(); |
2540 } | 2553 } |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3311 case kIllegal: return "illegal"; | 3324 case kIllegal: return "illegal"; |
3312 case kSin: return "sin"; | 3325 case kSin: return "sin"; |
3313 case kCos: return "cos"; | 3326 case kCos: return "cos"; |
3314 case kSqrt: return "sqrt"; | 3327 case kSqrt: return "sqrt"; |
3315 case kDoubleSquare: return "double-square"; | 3328 case kDoubleSquare: return "double-square"; |
3316 } | 3329 } |
3317 UNREACHABLE(); | 3330 UNREACHABLE(); |
3318 return ""; | 3331 return ""; |
3319 } | 3332 } |
3320 | 3333 |
| 3334 typedef RawBool* (*CaseInsensitiveCompareUC16Function) ( |
| 3335 RawString* string_raw, |
| 3336 RawSmi* lhs_index_raw, |
| 3337 RawSmi* rhs_index_raw, |
| 3338 RawSmi* length_raw); |
| 3339 |
| 3340 |
| 3341 extern const RuntimeEntry kCaseInsensitiveCompareUC16RuntimeEntry( |
| 3342 "CaseInsensitiveCompareUC16", reinterpret_cast<RuntimeFunction>( |
| 3343 static_cast<CaseInsensitiveCompareUC16Function>( |
| 3344 &IRRegExpMacroAssembler::CaseInsensitiveCompareUC16)), 4, true, false); |
| 3345 |
| 3346 |
| 3347 const RuntimeEntry& CaseInsensitiveCompareUC16Instr::TargetFunction() const { |
| 3348 return kCaseInsensitiveCompareUC16RuntimeEntry; |
| 3349 } |
| 3350 |
3321 | 3351 |
3322 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs, | 3352 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs, |
3323 intptr_t deopt_id, | 3353 intptr_t deopt_id, |
3324 MergedMathInstr::Kind kind) | 3354 MergedMathInstr::Kind kind) |
3325 : PureDefinition(deopt_id), | 3355 : PureDefinition(deopt_id), |
3326 inputs_(inputs), | 3356 inputs_(inputs), |
3327 kind_(kind) { | 3357 kind_(kind) { |
3328 ASSERT(inputs_->length() == InputCountFor(kind_)); | 3358 ASSERT(inputs_->length() == InputCountFor(kind_)); |
3329 for (intptr_t i = 0; i < inputs_->length(); ++i) { | 3359 for (intptr_t i = 0; i < inputs_->length(); ++i) { |
3330 ASSERT((*inputs)[i] != NULL); | 3360 ASSERT((*inputs)[i] != NULL); |
(...skipping 17 matching lines...) Expand all Loading... |
3348 case Token::kTRUNCDIV: return 0; | 3378 case Token::kTRUNCDIV: return 0; |
3349 case Token::kMOD: return 1; | 3379 case Token::kMOD: return 1; |
3350 default: UNIMPLEMENTED(); return -1; | 3380 default: UNIMPLEMENTED(); return -1; |
3351 } | 3381 } |
3352 } | 3382 } |
3353 | 3383 |
3354 | 3384 |
3355 #undef __ | 3385 #undef __ |
3356 | 3386 |
3357 } // namespace dart | 3387 } // namespace dart |
OLD | NEW |