| 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/globals.h"  // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h"  // Needed here to get TARGET_ARCH_X64. | 
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) | 
| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 89         (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 89         (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 
| 90     ASSERT(fp_sp_dist <= 0); | 90     ASSERT(fp_sp_dist <= 0); | 
| 91     __ movq(RDI, RSP); | 91     __ movq(RDI, RSP); | 
| 92     __ subq(RDI, RBP); | 92     __ subq(RDI, RBP); | 
| 93     __ CompareImmediate(RDI, Immediate(fp_sp_dist), PP); | 93     __ CompareImmediate(RDI, Immediate(fp_sp_dist), PP); | 
| 94     __ j(EQUAL, &done, Assembler::kNearJump); | 94     __ j(EQUAL, &done, Assembler::kNearJump); | 
| 95     __ int3(); | 95     __ int3(); | 
| 96     __ Bind(&done); | 96     __ Bind(&done); | 
| 97   } | 97   } | 
| 98 #endif | 98 #endif | 
| 99 | 99   __ LeaveDartFrame(); | 
| 100   __ ReturnPatchable(); | 100   __ ret(); | 
| 101   compiler->AddCurrentDescriptor(PcDescriptors::kReturn, |  | 
| 102                                  Isolate::kNoDeoptId, |  | 
| 103                                  token_pos()); |  | 
| 104 } | 101 } | 
| 105 | 102 | 
| 106 | 103 | 
| 107 static Condition NegateCondition(Condition condition) { | 104 static Condition NegateCondition(Condition condition) { | 
| 108   switch (condition) { | 105   switch (condition) { | 
| 109     case EQUAL:         return NOT_EQUAL; | 106     case EQUAL:         return NOT_EQUAL; | 
| 110     case NOT_EQUAL:     return EQUAL; | 107     case NOT_EQUAL:     return EQUAL; | 
| 111     case LESS:          return GREATER_EQUAL; | 108     case LESS:          return GREATER_EQUAL; | 
| 112     case LESS_EQUAL:    return GREATER; | 109     case LESS_EQUAL:    return GREATER; | 
| 113     case GREATER:       return LESS_EQUAL; | 110     case GREATER:       return LESS_EQUAL; | 
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 633       (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : | 630       (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : | 
| 634                                 &StubCode::CallNativeCFunctionLabel(); | 631                                 &StubCode::CallNativeCFunctionLabel(); | 
| 635   compiler->GenerateCall(token_pos(), | 632   compiler->GenerateCall(token_pos(), | 
| 636                          stub_entry, | 633                          stub_entry, | 
| 637                          PcDescriptors::kOther, | 634                          PcDescriptors::kOther, | 
| 638                          locs()); | 635                          locs()); | 
| 639   __ popq(result); | 636   __ popq(result); | 
| 640 } | 637 } | 
| 641 | 638 | 
| 642 | 639 | 
|  | 640 LocationSummary* DebugStepCheckInstr::MakeLocationSummary(bool opt) const { | 
|  | 641   const intptr_t kNumInputs = 0; | 
|  | 642   const intptr_t kNumTemps = 0; | 
|  | 643   LocationSummary* locs = | 
|  | 644       new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 
|  | 645   return locs; | 
|  | 646 } | 
|  | 647 | 
|  | 648 | 
|  | 649 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 
|  | 650   if (!compiler->is_optimizing()) { | 
|  | 651     const ExternalLabel label("debug_step_check", | 
|  | 652                               StubCode::DebugStepCheckEntryPoint()); | 
|  | 653     compiler->GenerateCall(token_pos(), | 
|  | 654                            &label, | 
|  | 655                            PcDescriptors::kReturn, | 
|  | 656                            locs()); | 
|  | 657   } | 
|  | 658 } | 
|  | 659 | 
|  | 660 | 
|  | 661 Instruction* DebugStepCheckInstr::Canonicalize(FlowGraph* flow_graph) { | 
|  | 662   if (compiler->is_optimizing()) { | 
|  | 663     return NULL; | 
|  | 664   } | 
|  | 665 } | 
|  | 666 | 
|  | 667 | 
| 643 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { | 668 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { | 
| 644   if (!index->definition()->IsConstant()) return false; | 669   if (!index->definition()->IsConstant()) return false; | 
| 645   const Object& constant = index->definition()->AsConstant()->value(); | 670   const Object& constant = index->definition()->AsConstant()->value(); | 
| 646   if (!constant.IsSmi()) return false; | 671   if (!constant.IsSmi()) return false; | 
| 647   const Smi& smi_const = Smi::Cast(constant); | 672   const Smi& smi_const = Smi::Cast(constant); | 
| 648   const intptr_t scale = FlowGraphCompiler::ElementSizeFor(cid); | 673   const intptr_t scale = FlowGraphCompiler::ElementSizeFor(cid); | 
| 649   const intptr_t data_offset = FlowGraphCompiler::DataOffsetFor(cid); | 674   const intptr_t data_offset = FlowGraphCompiler::DataOffsetFor(cid); | 
| 650   const int64_t disp = smi_const.AsInt64Value() * scale + data_offset; | 675   const int64_t disp = smi_const.AsInt64Value() * scale + data_offset; | 
| 651   return Utils::IsInt(32, disp); | 676   return Utils::IsInt(32, disp); | 
| 652 } | 677 } | 
| (...skipping 4311 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4964                          PcDescriptors::kOther, | 4989                          PcDescriptors::kOther, | 
| 4965                          locs()); | 4990                          locs()); | 
| 4966   __ Drop(2);  // Discard type arguments and receiver. | 4991   __ Drop(2);  // Discard type arguments and receiver. | 
| 4967 } | 4992 } | 
| 4968 | 4993 | 
| 4969 }  // namespace dart | 4994 }  // namespace dart | 
| 4970 | 4995 | 
| 4971 #undef __ | 4996 #undef __ | 
| 4972 | 4997 | 
| 4973 #endif  // defined TARGET_ARCH_X64 | 4998 #endif  // defined TARGET_ARCH_X64 | 
| OLD | NEW | 
|---|