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

Unified Diff: runtime/vm/native_arguments.h

Issue 1858283002: Initial SIMDBC interpreter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_arguments.h
diff --git a/runtime/vm/native_arguments.h b/runtime/vm/native_arguments.h
index 88bc41135611556d53ee378e831bf7753b4f14ac..7035a50b53cfc1c87b2203d711f328c16343390b 100644
--- a/runtime/vm/native_arguments.h
+++ b/runtime/vm/native_arguments.h
@@ -25,7 +25,10 @@ class Thread;
#if defined(TESTING) || defined(DEBUG)
-#if defined(USING_SIMULATOR)
+#if defined(TARGET_ARCH_DBC)
+// C-stack is always aligned on DBC because we don't have any native code.
+#define CHECK_STACK_ALIGNMENT
+#elif defined(USING_SIMULATOR)
#define CHECK_STACK_ALIGNMENT { \
uword current_sp = Simulator::Current()->get_register(SPREG); \
ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \
@@ -92,7 +95,13 @@ class NativeArguments {
RawObject* ArgAt(int index) const {
ASSERT((index >= 0) && (index < ArgCount()));
- RawObject** arg_ptr = &((*argv_)[-index]);
+#if defined(TARGET_ARCH_DBC)
+ // On DBC stack is growing upwards, in reverse direction from all other
+ // architectures.
+ RawObject** arg_ptr = &(argv_[index]);
+#else
+ RawObject** arg_ptr = &(argv_[-index]);
+#endif
// Tell MemorySanitizer the RawObject* was initialized (by generated code).
MSAN_UNPOISON(arg_ptr, kWordSize);
return *arg_ptr;
@@ -204,6 +213,16 @@ class NativeArguments {
friend class BootstrapNatives;
friend class Simulator;
+#if defined(TARGET_ARCH_DBC)
+ // Allow simulator to create NativeArguments on the stack.
+ NativeArguments(Thread* thread,
+ int argc_tag,
+ RawObject** argv,
+ RawObject** retval)
+ : thread_(thread), argc_tag_(argc_tag), argv_(argv), retval_(retval) {
+ }
+#endif
+
// Since this function is passed a RawObject directly, we need to be
// exceedingly careful when we use it. If there are any other side
// effects in the statement that may cause GC, it could lead to
@@ -235,7 +254,7 @@ class NativeArguments {
Thread* thread_; // Current thread pointer.
intptr_t argc_tag_; // Encodes argument count and invoked native call type.
- RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call.
+ RawObject** argv_; // Pointer to an array of arguments to runtime call.
RawObject** retval_; // Pointer to the return value area.
};
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698