 Chromium Code Reviews
 Chromium Code Reviews Issue 2793163002:
  Do not embed is_auto_setup_scope into the compilation of native calls.  (Closed)
    
  
    Issue 2793163002:
  Do not embed is_auto_setup_scope into the compilation of native calls.  (Closed) 
  | 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. | 
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) | 
| 7 | 7 | 
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" | 
| 9 | 9 | 
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" | 
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1027 } else { | 1027 } else { | 
| 1028 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); | 1028 __ AddImmediate(A2, FP, kFirstLocalSlotFromFp * kWordSize); | 
| 1029 } | 1029 } | 
| 1030 // Compute the effective address. When running under the simulator, | 1030 // Compute the effective address. When running under the simulator, | 
| 1031 // this is a redirection address that forces the simulator to call | 1031 // this is a redirection address that forces the simulator to call | 
| 1032 // into the runtime system. | 1032 // into the runtime system. | 
| 1033 uword entry; | 1033 uword entry; | 
| 1034 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); | 1034 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); | 
| 1035 const StubEntry* stub_entry; | 1035 const StubEntry* stub_entry; | 
| 1036 if (link_lazily()) { | 1036 if (link_lazily()) { | 
| 1037 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 1037 stub_entry = StubCode::CallBootstrapNative_entry(); | 
| 1038 entry = NativeEntry::LinkNativeCallEntry(); | 1038 entry = NativeEntry::LinkNativeCallEntry(); | 
| 1039 } else { | 1039 } else { | 
| 1040 entry = reinterpret_cast<uword>(native_c_function()); | 1040 entry = reinterpret_cast<uword>(native_c_function()); | 
| 1041 if (is_bootstrap_native()) { | 1041 if (is_bootstrap_native()) { | 
| 1042 stub_entry = StubCode::CallBootstrapCFunction_entry(); | 1042 stub_entry = StubCode::CallBootstrapNative_entry(); | 
| 1043 #if defined(USING_SIMULATOR) | 1043 #if defined(USING_SIMULATOR) | 
| 1044 entry = Simulator::RedirectExternalReference( | 1044 entry = Simulator::RedirectExternalReference( | 
| 1045 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); | 1045 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); | 
| 
zra
2017/04/04 15:00:45
ditto
 | |
| 1046 #endif | 1046 #endif | 
| 1047 } else if (is_auto_scope()) { | |
| 1048 // In the case of non bootstrap native methods the CallNativeCFunction | |
| 1049 // stub generates the redirection address when running under the simulator | |
| 1050 // and hence we do not change 'entry' here. | |
| 1051 stub_entry = StubCode::CallAutoScopeNative_entry(); | |
| 1047 } else { | 1052 } else { | 
| 1048 // In the case of non bootstrap native methods the CallNativeCFunction | 1053 // In the case of non bootstrap native methods the CallNativeCFunction | 
| 1049 // stub generates the redirection address when running under the simulator | 1054 // stub generates the redirection address when running under the simulator | 
| 1050 // and hence we do not change 'entry' here. | 1055 // and hence we do not change 'entry' here. | 
| 1051 stub_entry = StubCode::CallNativeCFunction_entry(); | 1056 stub_entry = StubCode::CallNoScopeNative_entry(); | 
| 1052 } | 1057 } | 
| 1053 } | 1058 } | 
| 1054 __ LoadImmediate(A1, argc_tag); | 1059 __ LoadImmediate(A1, argc_tag); | 
| 1055 ExternalLabel label(entry); | 1060 ExternalLabel label(entry); | 
| 1056 __ LoadNativeEntry(T5, &label, kNotPatchable); | 1061 __ LoadNativeEntry(T5, &label, kNotPatchable); | 
| 1057 if (link_lazily()) { | 1062 if (link_lazily()) { | 
| 1058 compiler->GeneratePatchableCall(token_pos(), *stub_entry, | 1063 compiler->GeneratePatchableCall(token_pos(), *stub_entry, | 
| 1059 RawPcDescriptors::kOther, locs()); | 1064 RawPcDescriptors::kOther, locs()); | 
| 1060 } else { | 1065 } else { | 
| 1061 compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther, | 1066 compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther, | 
| (...skipping 4984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6046 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6051 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 
| 6047 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6052 kGrowRegExpStackRuntimeEntry, 1, locs()); | 
| 6048 __ lw(result, Address(SP, 1 * kWordSize)); | 6053 __ lw(result, Address(SP, 1 * kWordSize)); | 
| 6049 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 6054 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 
| 6050 } | 6055 } | 
| 6051 | 6056 | 
| 6052 | 6057 | 
| 6053 } // namespace dart | 6058 } // namespace dart | 
| 6054 | 6059 | 
| 6055 #endif // defined TARGET_ARCH_MIPS | 6060 #endif // defined TARGET_ARCH_MIPS | 
| OLD | NEW |