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 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2513 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 2515 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
2514 GetDeoptId(), | 2516 GetDeoptId(), |
2515 Scanner::kNoSourcePos); | 2517 Scanner::kNoSourcePos); |
2516 } | 2518 } |
2517 if (HasParallelMove()) { | 2519 if (HasParallelMove()) { |
2518 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 2520 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
2519 } | 2521 } |
2520 } | 2522 } |
2521 | 2523 |
2522 | 2524 |
| 2525 LocationSummary* IndirectEntryInstr::MakeLocationSummary( |
| 2526 Isolate* isolate, bool optimizing) const { |
| 2527 return JoinEntryInstr::MakeLocationSummary(isolate, optimizing); |
| 2528 } |
| 2529 |
| 2530 |
| 2531 void IndirectEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2532 JoinEntryInstr::EmitNativeCode(compiler); |
| 2533 } |
| 2534 |
| 2535 |
2523 LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate, | 2536 LocationSummary* PhiInstr::MakeLocationSummary(Isolate* isolate, |
2524 bool optimizing) const { | 2537 bool optimizing) const { |
2525 UNREACHABLE(); | 2538 UNREACHABLE(); |
2526 return NULL; | 2539 return NULL; |
2527 } | 2540 } |
2528 | 2541 |
2529 | 2542 |
2530 void PhiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2543 void PhiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2531 UNREACHABLE(); | 2544 UNREACHABLE(); |
2532 } | 2545 } |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3303 case kIllegal: return "illegal"; | 3316 case kIllegal: return "illegal"; |
3304 case kSin: return "sin"; | 3317 case kSin: return "sin"; |
3305 case kCos: return "cos"; | 3318 case kCos: return "cos"; |
3306 case kSqrt: return "sqrt"; | 3319 case kSqrt: return "sqrt"; |
3307 case kDoubleSquare: return "double-square"; | 3320 case kDoubleSquare: return "double-square"; |
3308 } | 3321 } |
3309 UNREACHABLE(); | 3322 UNREACHABLE(); |
3310 return ""; | 3323 return ""; |
3311 } | 3324 } |
3312 | 3325 |
| 3326 typedef RawBool* (*CaseInsensitiveCompareUC16Function) ( |
| 3327 RawString* string_raw, |
| 3328 RawSmi* lhs_index_raw, |
| 3329 RawSmi* rhs_index_raw, |
| 3330 RawSmi* length_raw); |
| 3331 |
| 3332 |
| 3333 extern const RuntimeEntry kCaseInsensitiveCompareUC16RuntimeEntry( |
| 3334 "CaseInsensitiveCompareUC16", reinterpret_cast<RuntimeFunction>( |
| 3335 static_cast<CaseInsensitiveCompareUC16Function>( |
| 3336 &IRRegExpMacroAssembler::CaseInsensitiveCompareUC16)), 4, true, false); |
| 3337 |
| 3338 |
| 3339 const RuntimeEntry& CaseInsensitiveCompareUC16Instr::TargetFunction() const { |
| 3340 return kCaseInsensitiveCompareUC16RuntimeEntry; |
| 3341 } |
| 3342 |
3313 | 3343 |
3314 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs, | 3344 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs, |
3315 intptr_t deopt_id, | 3345 intptr_t deopt_id, |
3316 MergedMathInstr::Kind kind) | 3346 MergedMathInstr::Kind kind) |
3317 : PureDefinition(deopt_id), | 3347 : PureDefinition(deopt_id), |
3318 inputs_(inputs), | 3348 inputs_(inputs), |
3319 kind_(kind) { | 3349 kind_(kind) { |
3320 ASSERT(inputs_->length() == InputCountFor(kind_)); | 3350 ASSERT(inputs_->length() == InputCountFor(kind_)); |
3321 for (intptr_t i = 0; i < inputs_->length(); ++i) { | 3351 for (intptr_t i = 0; i < inputs_->length(); ++i) { |
3322 ASSERT((*inputs)[i] != NULL); | 3352 ASSERT((*inputs)[i] != NULL); |
(...skipping 17 matching lines...) Expand all Loading... |
3340 case Token::kTRUNCDIV: return 0; | 3370 case Token::kTRUNCDIV: return 0; |
3341 case Token::kMOD: return 1; | 3371 case Token::kMOD: return 1; |
3342 default: UNIMPLEMENTED(); return -1; | 3372 default: UNIMPLEMENTED(); return -1; |
3343 } | 3373 } |
3344 } | 3374 } |
3345 | 3375 |
3346 | 3376 |
3347 #undef __ | 3377 #undef __ |
3348 | 3378 |
3349 } // namespace dart | 3379 } // namespace dart |
OLD | NEW |