| OLD | NEW | 
|     1 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file |     1 // Copyright (c) 2014, 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/globals.h"  // Needed here to get TARGET_ARCH_ARM64. |     5 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_ARM64. | 
|     6 #if defined(TARGET_ARCH_ARM64) |     6 #if defined(TARGET_ARCH_ARM64) | 
|     7  |     7  | 
|     8 #include "vm/intermediate_language.h" |     8 #include "vm/intermediate_language.h" | 
|     9  |     9  | 
|    10 #include "vm/dart_entry.h" |    10 #include "vm/dart_entry.h" | 
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   350   const intptr_t kNumTemps = 0; |   350   const intptr_t kNumTemps = 0; | 
|   351   LocationSummary* locs = new(zone) LocationSummary( |   351   LocationSummary* locs = new(zone) LocationSummary( | 
|   352       zone, kNumInputs, kNumTemps, LocationSummary::kCall); |   352       zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 
|   353   locs->set_in(0, Location::RegisterLocation(R0)); |   353   locs->set_in(0, Location::RegisterLocation(R0)); | 
|   354   locs->set_out(0, Location::RegisterLocation(R0)); |   354   locs->set_out(0, Location::RegisterLocation(R0)); | 
|   355   return locs; |   355   return locs; | 
|   356 } |   356 } | 
|   357  |   357  | 
|   358  |   358  | 
|   359 static void EmitAssertBoolean(Register reg, |   359 static void EmitAssertBoolean(Register reg, | 
|   360                               intptr_t token_pos, |   360                               TokenPosition token_pos, | 
|   361                               intptr_t deopt_id, |   361                               intptr_t deopt_id, | 
|   362                               LocationSummary* locs, |   362                               LocationSummary* locs, | 
|   363                               FlowGraphCompiler* compiler) { |   363                               FlowGraphCompiler* compiler) { | 
|   364   // Check that the type of the value is allowed in conditional context. |   364   // Check that the type of the value is allowed in conditional context. | 
|   365   // Call the runtime if the object is not bool::true or bool::false. |   365   // Call the runtime if the object is not bool::true or bool::false. | 
|   366   ASSERT(locs->always_calls()); |   366   ASSERT(locs->always_calls()); | 
|   367   Label done; |   367   Label done; | 
|   368  |   368  | 
|   369   if (Isolate::Current()->flags().type_checks()) { |   369   if (Isolate::Current()->flags().type_checks()) { | 
|   370     __ CompareObject(reg, Bool::True()); |   370     __ CompareObject(reg, Bool::True()); | 
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1671     __ Bind(entry_label()); |  1671     __ Bind(entry_label()); | 
|  1672     const Code& stub = Code::ZoneHandle(compiler->zone(), |  1672     const Code& stub = Code::ZoneHandle(compiler->zone(), | 
|  1673         StubCode::GetAllocationStubForClass(cls_)); |  1673         StubCode::GetAllocationStubForClass(cls_)); | 
|  1674     const StubEntry stub_entry(stub); |  1674     const StubEntry stub_entry(stub); | 
|  1675  |  1675  | 
|  1676     LocationSummary* locs = instruction_->locs(); |  1676     LocationSummary* locs = instruction_->locs(); | 
|  1677  |  1677  | 
|  1678     locs->live_registers()->Remove(Location::RegisterLocation(result_)); |  1678     locs->live_registers()->Remove(Location::RegisterLocation(result_)); | 
|  1679  |  1679  | 
|  1680     compiler->SaveLiveRegisters(locs); |  1680     compiler->SaveLiveRegisters(locs); | 
|  1681     compiler->GenerateCall(Token::kNoSourcePos,  // No token position. |  1681     compiler->GenerateCall(TokenPosition::kNoSource,  // No token position. | 
|  1682                            stub_entry, |  1682                            stub_entry, | 
|  1683                            RawPcDescriptors::kOther, |  1683                            RawPcDescriptors::kOther, | 
|  1684                            locs); |  1684                            locs); | 
|  1685     compiler->AddStubCallTarget(stub); |  1685     compiler->AddStubCallTarget(stub); | 
|  1686     __ mov(result_, R0); |  1686     __ mov(result_, R0); | 
|  1687     compiler->RestoreLiveRegisters(locs); |  1687     compiler->RestoreLiveRegisters(locs); | 
|  1688     __ b(exit_label()); |  1688     __ b(exit_label()); | 
|  1689   } |  1689   } | 
|  1690  |  1690  | 
|  1691   static void Allocate(FlowGraphCompiler* compiler, |  1691   static void Allocate(FlowGraphCompiler* compiler, | 
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2600     compiler->GenerateRuntimeCall(instruction_->token_pos(), |  2600     compiler->GenerateRuntimeCall(instruction_->token_pos(), | 
|  2601                                   instruction_->deopt_id(), |  2601                                   instruction_->deopt_id(), | 
|  2602                                   kStackOverflowRuntimeEntry, |  2602                                   kStackOverflowRuntimeEntry, | 
|  2603                                   0, |  2603                                   0, | 
|  2604                                   instruction_->locs()); |  2604                                   instruction_->locs()); | 
|  2605  |  2605  | 
|  2606     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { |  2606     if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 
|  2607       // In unoptimized code, record loop stack checks as possible OSR entries. |  2607       // In unoptimized code, record loop stack checks as possible OSR entries. | 
|  2608       compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |  2608       compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, | 
|  2609                                      instruction_->deopt_id(), |  2609                                      instruction_->deopt_id(), | 
|  2610                                      0);  // No token position. |  2610                                      TokenPosition::kNoSource); | 
|  2611     } |  2611     } | 
|  2612     compiler->pending_deoptimization_env_ = NULL; |  2612     compiler->pending_deoptimization_env_ = NULL; | 
|  2613     compiler->RestoreLiveRegisters(instruction_->locs()); |  2613     compiler->RestoreLiveRegisters(instruction_->locs()); | 
|  2614     __ b(exit_label()); |  2614     __ b(exit_label()); | 
|  2615   } |  2615   } | 
|  2616  |  2616  | 
|  2617   Label* osr_entry_label() { |  2617   Label* osr_entry_label() { | 
|  2618     ASSERT(FLAG_use_osr); |  2618     ASSERT(FLAG_use_osr); | 
|  2619     return &osr_entry_label_; |  2619     return &osr_entry_label_; | 
|  2620   } |  2620   } | 
| (...skipping 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5399  |  5399  | 
|  5400 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |  5400 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 
|  5401   if (!compiler->is_optimizing()) { |  5401   if (!compiler->is_optimizing()) { | 
|  5402     if (FLAG_emit_edge_counters) { |  5402     if (FLAG_emit_edge_counters) { | 
|  5403       compiler->EmitEdgeCounter(block()->preorder_number()); |  5403       compiler->EmitEdgeCounter(block()->preorder_number()); | 
|  5404     } |  5404     } | 
|  5405     // Add a deoptimization descriptor for deoptimizing instructions that |  5405     // Add a deoptimization descriptor for deoptimizing instructions that | 
|  5406     // may be inserted before this instruction. |  5406     // may be inserted before this instruction. | 
|  5407     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |  5407     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 
|  5408                                    GetDeoptId(), |  5408                                    GetDeoptId(), | 
|  5409                                    Token::kNoSourcePos); |  5409                                    TokenPosition::kNoSource); | 
|  5410   } |  5410   } | 
|  5411   if (HasParallelMove()) { |  5411   if (HasParallelMove()) { | 
|  5412     compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |  5412     compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 
|  5413   } |  5413   } | 
|  5414  |  5414  | 
|  5415   // We can fall through if the successor is the next block in the list. |  5415   // We can fall through if the successor is the next block in the list. | 
|  5416   // Otherwise, we need a jump. |  5416   // Otherwise, we need a jump. | 
|  5417   if (!compiler->CanFallThroughTo(successor())) { |  5417   if (!compiler->CanFallThroughTo(successor())) { | 
|  5418     __ b(compiler->GetJumpLabel(successor())); |  5418     __ b(compiler->GetJumpLabel(successor())); | 
|  5419   } |  5419   } | 
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5601   locs->set_out(0, Location::RegisterLocation(R0)); |  5601   locs->set_out(0, Location::RegisterLocation(R0)); | 
|  5602   return locs; |  5602   return locs; | 
|  5603 } |  5603 } | 
|  5604  |  5604  | 
|  5605  |  5605  | 
|  5606 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |  5606 void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 
|  5607   const Register typed_data = locs()->in(0).reg(); |  5607   const Register typed_data = locs()->in(0).reg(); | 
|  5608   const Register result = locs()->out(0).reg(); |  5608   const Register result = locs()->out(0).reg(); | 
|  5609   __ PushObject(Object::null_object()); |  5609   __ PushObject(Object::null_object()); | 
|  5610   __ Push(typed_data); |  5610   __ Push(typed_data); | 
|  5611   compiler->GenerateRuntimeCall(Token::kNoSourcePos,  // No token position. |  5611   compiler->GenerateRuntimeCall(TokenPosition::kNoSource, | 
|  5612                                 deopt_id(), |  5612                                 deopt_id(), | 
|  5613                                 kGrowRegExpStackRuntimeEntry, |  5613                                 kGrowRegExpStackRuntimeEntry, | 
|  5614                                 1, |  5614                                 1, | 
|  5615                                 locs()); |  5615                                 locs()); | 
|  5616   __ Drop(1); |  5616   __ Drop(1); | 
|  5617   __ Pop(result); |  5617   __ Pop(result); | 
|  5618 } |  5618 } | 
|  5619  |  5619  | 
|  5620  |  5620  | 
|  5621 }  // namespace dart |  5621 }  // namespace dart | 
|  5622  |  5622  | 
|  5623 #endif  // defined TARGET_ARCH_ARM64 |  5623 #endif  // defined TARGET_ARCH_ARM64 | 
| OLD | NEW |