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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 993 if (!function().HasOptionalParameters()) { | 993 if (!function().HasOptionalParameters()) { |
| 994 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + | 994 __ AddImmediate(R2, FP, (kParamEndSlotFromFp + |
| 995 function().NumParameters()) * kWordSize); | 995 function().NumParameters()) * kWordSize); |
| 996 } else { | 996 } else { |
| 997 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); | 997 __ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize); |
| 998 } | 998 } |
| 999 // Compute the effective address. When running under the simulator, | 999 // Compute the effective address. When running under the simulator, |
| 1000 // this is a redirection address that forces the simulator to call | 1000 // this is a redirection address that forces the simulator to call |
| 1001 // into the runtime system. | 1001 // into the runtime system. |
| 1002 uword entry = reinterpret_cast<uword>(native_c_function()); | 1002 uword entry = reinterpret_cast<uword>(native_c_function()); |
| 1003 const ExternalLabel* stub_entry; | |
| 1004 if (is_bootstrap_native()) { | |
| 1005 stub_entry = &StubCode::CallBootstrapCFunctionLabel(); | |
| 1003 #if defined(USING_SIMULATOR) | 1006 #if defined(USING_SIMULATOR) |
| 1004 entry = Simulator::RedirectExternalReference(entry, | 1007 entry = Simulator::RedirectExternalReference( |
| 1005 Simulator::kNativeCall, | 1008 entry, Simulator::kBootstrapNativeCall, function().NumParameters()); |
| 1006 function().NumParameters()); | |
| 1007 #endif | 1009 #endif |
| 1010 } else { | |
|
regis
2013/08/06 17:01:22
For clarity, I would add a comment explaining that
siva
2013/08/06 19:04:26
Done.
| |
| 1011 stub_entry = &StubCode::CallNativeCFunctionLabel(); | |
| 1012 } | |
| 1008 __ LoadImmediate(R5, entry); | 1013 __ LoadImmediate(R5, entry); |
| 1009 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); | 1014 __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function())); |
| 1010 compiler->GenerateCall(token_pos(), | 1015 compiler->GenerateCall(token_pos(), |
| 1011 &StubCode::CallNativeCFunctionLabel(), | 1016 stub_entry, |
| 1012 PcDescriptors::kOther, | 1017 PcDescriptors::kOther, |
| 1013 locs()); | 1018 locs()); |
| 1014 __ Pop(result); | 1019 __ Pop(result); |
| 1015 } | 1020 } |
| 1016 | 1021 |
| 1017 | 1022 |
| 1018 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { | 1023 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary() const { |
| 1019 const intptr_t kNumInputs = 1; | 1024 const intptr_t kNumInputs = 1; |
| 1020 // TODO(fschneider): Allow immediate operands for the char code. | 1025 // TODO(fschneider): Allow immediate operands for the char code. |
| 1021 return LocationSummary::Make(kNumInputs, | 1026 return LocationSummary::Make(kNumInputs, |
| (...skipping 3394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4416 compiler->GenerateCall(token_pos(), | 4421 compiler->GenerateCall(token_pos(), |
| 4417 &label, | 4422 &label, |
| 4418 PcDescriptors::kOther, | 4423 PcDescriptors::kOther, |
| 4419 locs()); | 4424 locs()); |
| 4420 __ Drop(2); // Discard type arguments and receiver. | 4425 __ Drop(2); // Discard type arguments and receiver. |
| 4421 } | 4426 } |
| 4422 | 4427 |
| 4423 } // namespace dart | 4428 } // namespace dart |
| 4424 | 4429 |
| 4425 #endif // defined TARGET_ARCH_ARM | 4430 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |