| 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 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 // Pass a pointer to the first argument in RAX. | 1061 // Pass a pointer to the first argument in RAX. |
| 1062 if (!function().HasOptionalParameters()) { | 1062 if (!function().HasOptionalParameters()) { |
| 1063 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp + | 1063 __ leaq(RAX, Address(RBP, (kParamEndSlotFromFp + |
| 1064 function().NumParameters()) * kWordSize)); | 1064 function().NumParameters()) * kWordSize)); |
| 1065 } else { | 1065 } else { |
| 1066 __ leaq(RAX, | 1066 __ leaq(RAX, |
| 1067 Address(RBP, kFirstLocalSlotFromFp * kWordSize)); | 1067 Address(RBP, kFirstLocalSlotFromFp * kWordSize)); |
| 1068 } | 1068 } |
| 1069 __ movq(RBX, Immediate(reinterpret_cast<uword>(native_c_function()))); | 1069 __ movq(RBX, Immediate(reinterpret_cast<uword>(native_c_function()))); |
| 1070 __ movq(R10, Immediate(NativeArguments::ComputeArgcTag(function()))); | 1070 __ movq(R10, Immediate(NativeArguments::ComputeArgcTag(function()))); |
| 1071 const ExternalLabel* stub_entry = |
| 1072 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : |
| 1073 &StubCode::CallNativeCFunctionLabel(); |
| 1071 compiler->GenerateCall(token_pos(), | 1074 compiler->GenerateCall(token_pos(), |
| 1072 &StubCode::CallNativeCFunctionLabel(), | 1075 stub_entry, |
| 1073 PcDescriptors::kOther, | 1076 PcDescriptors::kOther, |
| 1074 locs()); | 1077 locs()); |
| 1075 __ popq(result); | 1078 __ popq(result); |
| 1076 } | 1079 } |
| 1077 | 1080 |
| 1078 | 1081 |
| 1079 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { | 1082 static bool CanBeImmediateIndex(Value* index, intptr_t cid) { |
| 1080 if (!index->definition()->IsConstant()) return false; | 1083 if (!index->definition()->IsConstant()) return false; |
| 1081 const Object& constant = index->definition()->AsConstant()->value(); | 1084 const Object& constant = index->definition()->AsConstant()->value(); |
| 1082 if (!constant.IsSmi()) return false; | 1085 if (!constant.IsSmi()) return false; |
| (...skipping 3498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4581 PcDescriptors::kOther, | 4584 PcDescriptors::kOther, |
| 4582 locs()); | 4585 locs()); |
| 4583 __ Drop(2); // Discard type arguments and receiver. | 4586 __ Drop(2); // Discard type arguments and receiver. |
| 4584 } | 4587 } |
| 4585 | 4588 |
| 4586 } // namespace dart | 4589 } // namespace dart |
| 4587 | 4590 |
| 4588 #undef __ | 4591 #undef __ |
| 4589 | 4592 |
| 4590 #endif // defined TARGET_ARCH_X64 | 4593 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |