Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 2793163002: Do not embed is_auto_setup_scope into the compilation of native calls. (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/stub_code_ia32.cc
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 219afeaaf0a77b8857a9dc006bd3ec6516b5d6c7..22b494a30d9e8c0454a7387a5ca05a99f6e44a6b 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -120,7 +120,8 @@ void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
// EAX : address of first argument in argument array.
// ECX : address of the native function to call.
// EDX : argc_tag including number of arguments and function kind.
-void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
+static void GenerateCallNativeWithWrapperStub(Assembler* assembler,
+ ExternalLabel* wrapper) {
const intptr_t native_args_struct_offset =
NativeEntry::kNumCallWrapperArguments * kWordSize;
const intptr_t thread_offset =
@@ -172,8 +173,7 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
__ movl(Address(ESP, 0), EAX); // Pass the pointer to the NativeArguments.
__ movl(Address(ESP, kWordSize), ECX); // Function to call.
- ExternalLabel label(NativeEntry::NativeCallWrapperEntry());
- __ call(&label);
+ __ call(wrapper);
__ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
@@ -185,13 +185,25 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
}
+void StubCode::GenerateCallNoScopeNativeStub(Assembler* assembler) {
+ ExternalLabel wrapper(NativeEntry::NoScopeNativeCallWrapperEntry());
+ GenerateCallNativeWithWrapperStub(assembler, &wrapper);
+}
+
+
+void StubCode::GenerateCallAutoScopeNativeStub(Assembler* assembler) {
+ ExternalLabel wrapper(NativeEntry::AutoScopeNativeCallWrapperEntry());
+ GenerateCallNativeWithWrapperStub(assembler, &wrapper);
+}
+
+
// Input parameters:
// ESP : points to return address.
// ESP + 4 : address of return value.
// EAX : address of first argument in argument array.
// ECX : address of the native function to call.
// EDX : argc_tag including number of arguments and function kind.
-void StubCode::GenerateCallBootstrapCFunctionStub(Assembler* assembler) {
+void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) {
const intptr_t native_args_struct_offset = kWordSize;
const intptr_t thread_offset =
NativeArguments::thread_offset() + native_args_struct_offset;

Powered by Google App Engine
This is Rietveld 408576698