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

Unified Diff: runtime/platform/globals.h

Issue 12340086: Force WriteByte to be inlined (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Line re-appeared Created 7 years, 10 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 | « no previous file | runtime/vm/datastream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/globals.h
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 4c5d053bb4de8bd9e034c9784b7a2de21d87af21..f06f04c75c40a3f347c74ac67f1e56933b633625 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -124,6 +124,19 @@ typedef struct {
#error Architecture was not detected as supported by Dart.
#endif
+// DART_FORCE_INLINE strongly hints to the compiler that a function should
+// be inlined. Your function is not guaranteed to be inlined but this is
+// stronger than just using "inline".
+// See: http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx for an
+// explanation of some the cases when a function can never be inlined.
+#ifdef _MSC_VER
+#define DART_FORCE_INLINE __forceinline
+#elif __GNUC__
+#define DART_FORCE_INLINE inline __attribute__((always_inline))
+#else
Søren Gjesse 2013/02/27 12:57:44 Wouldn't an empty define for DART_FORCE_INLINE wor
+#error Automatic compiler detection failed.
+#endif
+
#if !defined(TARGET_ARCH_MIPS)
#if !defined(TARGET_ARCH_ARM)
#if !defined(TARGET_ARCH_X64)
« no previous file with comments | « no previous file | runtime/vm/datastream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698