| 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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3321 case kIllegal: return "illegal"; | 3334 case kIllegal: return "illegal"; |
| 3322 case kSin: return "sin"; | 3335 case kSin: return "sin"; |
| 3323 case kCos: return "cos"; | 3336 case kCos: return "cos"; |
| 3324 case kSqrt: return "sqrt"; | 3337 case kSqrt: return "sqrt"; |
| 3325 case kDoubleSquare: return "double-square"; | 3338 case kDoubleSquare: return "double-square"; |
| 3326 } | 3339 } |
| 3327 UNREACHABLE(); | 3340 UNREACHABLE(); |
| 3328 return ""; | 3341 return ""; |
| 3329 } | 3342 } |
| 3330 | 3343 |
| 3344 typedef RawBool* (*CaseInsensitiveCompareUC16Function) ( |
| 3345 RawString* string_raw, |
| 3346 RawSmi* lhs_index_raw, |
| 3347 RawSmi* rhs_index_raw, |
| 3348 RawSmi* length_raw); |
| 3349 |
| 3350 |
| 3351 extern const RuntimeEntry kCaseInsensitiveCompareUC16RuntimeEntry( |
| 3352 "CaseInsensitiveCompareUC16", reinterpret_cast<RuntimeFunction>( |
| 3353 static_cast<CaseInsensitiveCompareUC16Function>( |
| 3354 &IRRegExpMacroAssembler::CaseInsensitiveCompareUC16)), 4, true, false); |
| 3355 |
| 3356 |
| 3357 const RuntimeEntry& CaseInsensitiveCompareUC16Instr::TargetFunction() const { |
| 3358 return kCaseInsensitiveCompareUC16RuntimeEntry; |
| 3359 } |
| 3360 |
| 3331 | 3361 |
| 3332 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs, | 3362 MergedMathInstr::MergedMathInstr(ZoneGrowableArray<Value*>* inputs, |
| 3333 intptr_t deopt_id, | 3363 intptr_t deopt_id, |
| 3334 MergedMathInstr::Kind kind) | 3364 MergedMathInstr::Kind kind) |
| 3335 : PureDefinition(deopt_id), | 3365 : PureDefinition(deopt_id), |
| 3336 inputs_(inputs), | 3366 inputs_(inputs), |
| 3337 kind_(kind) { | 3367 kind_(kind) { |
| 3338 ASSERT(inputs_->length() == InputCountFor(kind_)); | 3368 ASSERT(inputs_->length() == InputCountFor(kind_)); |
| 3339 for (intptr_t i = 0; i < inputs_->length(); ++i) { | 3369 for (intptr_t i = 0; i < inputs_->length(); ++i) { |
| 3340 ASSERT((*inputs)[i] != NULL); | 3370 ASSERT((*inputs)[i] != NULL); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3358 case Token::kTRUNCDIV: return 0; | 3388 case Token::kTRUNCDIV: return 0; |
| 3359 case Token::kMOD: return 1; | 3389 case Token::kMOD: return 1; |
| 3360 default: UNIMPLEMENTED(); return -1; | 3390 default: UNIMPLEMENTED(); return -1; |
| 3361 } | 3391 } |
| 3362 } | 3392 } |
| 3363 | 3393 |
| 3364 | 3394 |
| 3365 #undef __ | 3395 #undef __ |
| 3366 | 3396 |
| 3367 } // namespace dart | 3397 } // namespace dart |
| OLD | NEW |