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

Side by Side Diff: runtime/vm/native_arguments.h

Issue 23745008: Follow-up fix to my change to IsPowerOfTwo: Alignment of one means no alignment, not zero. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_x64_test.cc ('k') | runtime/vm/os.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_NATIVE_ARGUMENTS_H_ 5 #ifndef VM_NATIVE_ARGUMENTS_H_
6 #define VM_NATIVE_ARGUMENTS_H_ 6 #define VM_NATIVE_ARGUMENTS_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/handles_impl.h" 10 #include "vm/handles_impl.h"
(...skipping 11 matching lines...) Expand all
22 class Isolate; 22 class Isolate;
23 class Object; 23 class Object;
24 class RawObject; 24 class RawObject;
25 class Simulator; 25 class Simulator;
26 26
27 #if defined(TESTING) || defined(DEBUG) 27 #if defined(TESTING) || defined(DEBUG)
28 28
29 #if defined(USING_SIMULATOR) 29 #if defined(USING_SIMULATOR)
30 #define CHECK_STACK_ALIGNMENT { \ 30 #define CHECK_STACK_ALIGNMENT { \
31 uword current_sp = Simulator::Current()->get_register(SPREG); \ 31 uword current_sp = Simulator::Current()->get_register(SPREG); \
32 ASSERT((OS::ActivationFrameAlignment() == 0) || \ 32 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \
33 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \
34 } 33 }
35 #elif defined(TARGET_OS_WINDOWS) 34 #elif defined(TARGET_OS_WINDOWS)
36 // The compiler may dynamically align the stack on Windows, so do not check. 35 // The compiler may dynamically align the stack on Windows, so do not check.
37 #define CHECK_STACK_ALIGNMENT { } 36 #define CHECK_STACK_ALIGNMENT { }
38 #else 37 #else
39 #define CHECK_STACK_ALIGNMENT { \ 38 #define CHECK_STACK_ALIGNMENT { \
40 uword (*func)() = \ 39 uword (*func)() = \
41 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \ 40 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); \
42 uword current_sp = func(); \ 41 uword current_sp = func(); \
43 ASSERT((OS::ActivationFrameAlignment() == 0) || \ 42 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \
44 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \
45 } 43 }
46 #endif 44 #endif
47 45
48 #define VERIFY_ON_TRANSITION \ 46 #define VERIFY_ON_TRANSITION \
49 if (FLAG_verify_on_transition) { \ 47 if (FLAG_verify_on_transition) { \
50 VerifyPointersVisitor::VerifyPointers(); \ 48 VerifyPointersVisitor::VerifyPointers(); \
51 Isolate::Current()->heap()->Verify(); \ 49 Isolate::Current()->heap()->Verify(); \
52 } 50 }
53 #define TRACE_NATIVES(name) \ 51 #define TRACE_NATIVES(name) \
54 if (FLAG_trace_natives) { \ 52 if (FLAG_trace_natives) { \
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 191
194 Isolate* isolate_; // Current isolate pointer. 192 Isolate* isolate_; // Current isolate pointer.
195 int argc_tag_; // Encodes argument count and invoked native call type. 193 int argc_tag_; // Encodes argument count and invoked native call type.
196 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. 194 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call.
197 RawObject** retval_; // Pointer to the return value area. 195 RawObject** retval_; // Pointer to the return value area.
198 }; 196 };
199 197
200 } // namespace dart 198 } // namespace dart
201 199
202 #endif // VM_NATIVE_ARGUMENTS_H_ 200 #endif // VM_NATIVE_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64_test.cc ('k') | runtime/vm/os.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698