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" |
(...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2523 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 2523 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
2524 GetDeoptId(), | 2524 GetDeoptId(), |
2525 Scanner::kNoSourcePos); | 2525 Scanner::kNoSourcePos); |
2526 } | 2526 } |
2527 if (HasParallelMove()) { | 2527 if (HasParallelMove()) { |
2528 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 2528 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
2529 } | 2529 } |
2530 } | 2530 } |
2531 | 2531 |
2532 | 2532 |
2533 void IndirectGotoInstr::ComputeOffsetTable(Isolate* isolate) { | |
2534 ASSERT(SuccessorCount() == offsets_.Capacity()); | |
2535 offsets_.SetLength(SuccessorCount()); | |
2536 for (intptr_t i = 0; i < SuccessorCount(); i++) { | |
2537 TargetEntryInstr* target = SuccessorAt(i); | |
2538 | |
2539 // Optimizations might have modified the immediate target block, but | |
2540 // it must end with a goto to the indirect entry. | |
2541 Instruction* instr = target; | |
Vyacheslav Egorov (Google)
2014/11/13 18:30:04
use target->last_instruction() instead of the loop
zerny-google
2014/11/14 13:29:29
No can do, since it is not set if the target is un
| |
2542 while (instr != NULL && !instr->IsGoto()) { | |
2543 instr = instr->next(); | |
2544 } | |
2545 ASSERT(instr->IsGoto()); | |
2546 | |
2547 IndirectEntryInstr* ientry = | |
2548 instr->AsGoto()->successor()->AsIndirectEntry(); | |
2549 ASSERT(ientry != NULL); | |
2550 ASSERT(ientry->indirect_id() == i); | |
2551 | |
2552 // The intermediate block might be compacted, check both it and the | |
2553 // final indirect entry for a valid offset. If neither are valid, then | |
2554 // the indirect entry is unreachable. | |
2555 intptr_t offset = | |
Vyacheslav Egorov (Google)
2014/11/13 18:30:04
when can the ientry be unreachable?
if it is "unr
zerny-google
2014/11/14 13:29:28
It is possible that we never emit a backtracking p
| |
2556 (target->offset() > 0) ? target->offset() : ientry->offset(); | |
2557 | |
2558 if (offset > 0) { | |
2559 offset -= Assembler::EntryPointToPcMarkerOffset(); | |
2560 offsets_.SetAt(i, Smi::ZoneHandle(isolate, Smi::New(offset))); | |
2561 } | |
2562 } | |
2563 } | |
2564 | |
2565 | |
2533 LocationSummary* IndirectEntryInstr::MakeLocationSummary( | 2566 LocationSummary* IndirectEntryInstr::MakeLocationSummary( |
2534 Isolate* isolate, bool optimizing) const { | 2567 Isolate* isolate, bool optimizing) const { |
2535 return JoinEntryInstr::MakeLocationSummary(isolate, optimizing); | 2568 return JoinEntryInstr::MakeLocationSummary(isolate, optimizing); |
2536 } | 2569 } |
2537 | 2570 |
2538 | 2571 |
2539 void IndirectEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2572 void IndirectEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2540 JoinEntryInstr::EmitNativeCode(compiler); | 2573 JoinEntryInstr::EmitNativeCode(compiler); |
2541 } | 2574 } |
2542 | 2575 |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3378 case Token::kTRUNCDIV: return 0; | 3411 case Token::kTRUNCDIV: return 0; |
3379 case Token::kMOD: return 1; | 3412 case Token::kMOD: return 1; |
3380 default: UNIMPLEMENTED(); return -1; | 3413 default: UNIMPLEMENTED(); return -1; |
3381 } | 3414 } |
3382 } | 3415 } |
3383 | 3416 |
3384 | 3417 |
3385 #undef __ | 3418 #undef __ |
3386 | 3419 |
3387 } // namespace dart | 3420 } // namespace dart |
OLD | NEW |