| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return locs; | 77 return locs; |
| 78 } | 78 } |
| 79 | 79 |
| 80 | 80 |
| 81 // Attempt optimized compilation at return instruction instead of at the entry. | 81 // Attempt optimized compilation at return instruction instead of at the entry. |
| 82 // The entry needs to be patchable, no inlined objects are allowed in the area | 82 // The entry needs to be patchable, no inlined objects are allowed in the area |
| 83 // that will be overwritten by the patch instruction: a jump). | 83 // that will be overwritten by the patch instruction: a jump). |
| 84 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 84 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 85 Register result = locs()->in(0).reg(); | 85 Register result = locs()->in(0).reg(); |
| 86 ASSERT(result == EAX); | 86 ASSERT(result == EAX); |
| 87 |
| 88 if (is_intrinsic_) { |
| 89 // Intrinsics don't have a frame. |
| 90 __ ret(); |
| 91 return; |
| 92 } |
| 93 |
| 87 #if defined(DEBUG) | 94 #if defined(DEBUG) |
| 88 __ Comment("Stack Check"); | 95 __ Comment("Stack Check"); |
| 89 Label done; | 96 Label done; |
| 90 const intptr_t fp_sp_dist = | 97 const intptr_t fp_sp_dist = |
| 91 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 98 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; |
| 92 ASSERT(fp_sp_dist <= 0); | 99 ASSERT(fp_sp_dist <= 0); |
| 93 __ movl(EDI, ESP); | 100 __ movl(EDI, ESP); |
| 94 __ subl(EDI, EBP); | 101 __ subl(EDI, EBP); |
| 95 __ cmpl(EDI, Immediate(fp_sp_dist)); | 102 __ cmpl(EDI, Immediate(fp_sp_dist)); |
| 96 __ j(EQUAL, &done, Assembler::kNearJump); | 103 __ j(EQUAL, &done, Assembler::kNearJump); |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 ICData::Handle()); | 930 ICData::Handle()); |
| 924 ASSERT(locs()->out(0).reg() == EAX); | 931 ASSERT(locs()->out(0).reg() == EAX); |
| 925 } | 932 } |
| 926 | 933 |
| 927 | 934 |
| 928 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, | 935 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
| 929 bool opt) const { | 936 bool opt) const { |
| 930 const intptr_t kNumInputs = 1; | 937 const intptr_t kNumInputs = 1; |
| 931 return LocationSummary::Make(isolate, | 938 return LocationSummary::Make(isolate, |
| 932 kNumInputs, | 939 kNumInputs, |
| 933 Location::RequiresRegister(), | 940 Location::SameAsFirstInput(), |
| 934 LocationSummary::kNoCall); | 941 LocationSummary::kNoCall); |
| 935 } | 942 } |
| 936 | 943 |
| 937 | 944 |
| 938 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 945 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 939 Register object = locs()->in(0).reg(); | 946 Register object = locs()->in(0).reg(); |
| 940 Register result = locs()->out(0).reg(); | 947 Register result = locs()->out(0).reg(); |
| 941 __ movl(result, FieldAddress(object, offset())); | 948 __ movl(result, FieldAddress(object, offset())); |
| 942 } | 949 } |
| 943 | 950 |
| (...skipping 6085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7029 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 7036 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 7030 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 7037 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 7031 #endif | 7038 #endif |
| 7032 } | 7039 } |
| 7033 | 7040 |
| 7034 } // namespace dart | 7041 } // namespace dart |
| 7035 | 7042 |
| 7036 #undef __ | 7043 #undef __ |
| 7037 | 7044 |
| 7038 #endif // defined TARGET_ARCH_IA32 | 7045 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |