Chromium Code Reviews| 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 800 // Push the result place holder initialized to NULL. | 800 // Push the result place holder initialized to NULL. |
| 801 __ PushObject(Object::ZoneHandle()); | 801 __ PushObject(Object::ZoneHandle()); |
| 802 // Pass a pointer to the first argument in EAX. | 802 // Pass a pointer to the first argument in EAX. |
| 803 if (!function().HasOptionalParameters()) { | 803 if (!function().HasOptionalParameters()) { |
| 804 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + | 804 __ leal(EAX, Address(EBP, (kParamEndSlotFromFp + |
| 805 function().NumParameters()) * kWordSize)); | 805 function().NumParameters()) * kWordSize)); |
| 806 } else { | 806 } else { |
| 807 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); | 807 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); |
| 808 } | 808 } |
| 809 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); | 809 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); |
| 810 __ movl(EDX, Immediate(NativeArguments::ComputeArgcTag(function()))); | 810 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); |
| 811 const ExternalLabel* stub_entry = | 811 const bool is_leaf_call = |
|
Ivan Posva
2014/06/05 17:05:29
Can you please move the variable declarations and
Cutch
2014/06/05 18:49:21
Done.
| |
| 812 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : | 812 (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0; |
| 813 &StubCode::CallNativeCFunctionLabel(); | 813 __ movl(EDX, Immediate(argc_tag)); |
| 814 const ExternalLabel* stub_entry = (is_bootstrap_native() || is_leaf_call) ? | |
| 815 &StubCode::CallBootstrapCFunctionLabel() : | |
| 816 &StubCode::CallNativeCFunctionLabel(); | |
| 814 compiler->GenerateCall(token_pos(), | 817 compiler->GenerateCall(token_pos(), |
| 815 stub_entry, | 818 stub_entry, |
| 816 PcDescriptors::kOther, | 819 PcDescriptors::kOther, |
| 817 locs()); | 820 locs()); |
| 818 __ popl(result); | 821 __ popl(result); |
| 819 } | 822 } |
| 820 | 823 |
| 821 | 824 |
| 822 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { | 825 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { |
| 823 ConstantInstr* constant = value->definition()->AsConstant(); | 826 ConstantInstr* constant = value->definition()->AsConstant(); |
| (...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3318 } | 3321 } |
| 3319 | 3322 |
| 3320 | 3323 |
| 3321 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, | 3324 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, |
| 3322 bool opt) const { | 3325 bool opt) const { |
| 3323 intptr_t left_cid = left()->Type()->ToCid(); | 3326 intptr_t left_cid = left()->Type()->ToCid(); |
| 3324 intptr_t right_cid = right()->Type()->ToCid(); | 3327 intptr_t right_cid = right()->Type()->ToCid(); |
| 3325 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); | 3328 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
| 3326 const intptr_t kNumInputs = 2; | 3329 const intptr_t kNumInputs = 2; |
| 3327 const bool need_temp = (left()->definition() != right()->definition()) | 3330 const bool need_temp = (left()->definition() != right()->definition()) |
| 3328 &&(left_cid != kSmiCid) | 3331 && (left_cid != kSmiCid) |
| 3329 && (right_cid != kSmiCid); | 3332 && (right_cid != kSmiCid); |
| 3330 const intptr_t kNumTemps = need_temp ? 1 : 0; | 3333 const intptr_t kNumTemps = need_temp ? 1 : 0; |
| 3331 LocationSummary* summary = new(isolate) LocationSummary( | 3334 LocationSummary* summary = new(isolate) LocationSummary( |
| 3332 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3335 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3333 summary->set_in(0, Location::RequiresRegister()); | 3336 summary->set_in(0, Location::RequiresRegister()); |
| 3334 summary->set_in(1, Location::RequiresRegister()); | 3337 summary->set_in(1, Location::RequiresRegister()); |
| 3335 if (need_temp) summary->set_temp(0, Location::RequiresRegister()); | 3338 if (need_temp) summary->set_temp(0, Location::RequiresRegister()); |
| 3336 return summary; | 3339 return summary; |
| 3337 } | 3340 } |
| 3338 | 3341 |
| (...skipping 2949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6288 PcDescriptors::kOther, | 6291 PcDescriptors::kOther, |
| 6289 locs()); | 6292 locs()); |
| 6290 __ Drop(ArgumentCount()); // Discard arguments. | 6293 __ Drop(ArgumentCount()); // Discard arguments. |
| 6291 } | 6294 } |
| 6292 | 6295 |
| 6293 } // namespace dart | 6296 } // namespace dart |
| 6294 | 6297 |
| 6295 #undef __ | 6298 #undef __ |
| 6296 | 6299 |
| 6297 #endif // defined TARGET_ARCH_IA32 | 6300 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |