Reviewers: Mads Ager, Søren Gjesse,
Message:
Guys,
may you have a look?
And yes, inline assembly is evil. Fortunately it should only affect *nix
and
Mac OS and I guess currently it all compiles fine, but I still would think
of
bringing this change to the trunk.
Description:
Proper constraints for inline implementation in assembly.
Please review this at http://codereview.chromium.org/1359002
Affected files:
M src/utils.h
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index
89cc5ef4a5587e6bece7093a2734379e4714fea5..8ff1f9b1c826d2e47c2978c9811257c8ec481f35
100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -581,11 +581,12 @@ static inline void MemsetPointer(T** dest, T* value,
int counter) {
#endif
#if defined(__GNUC__) && defined(STOS)
- asm("cld;"
+ asm volatile(
+ "cld;"
"rep ; " STOS
- : /* no output */
- : "c" (counter), "a" (value), "D" (dest)
- : /* no clobbered list as all inputs are considered clobbered */);
+ : "+&c" (counter), "+&D" (dest)
+ : "a" (value)
+ : "memory", "cc");
#else
for (int i = 0; i < counter; i++) {
dest[i] = value;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
To unsubscribe from this group, send email to v8-dev+unsubscribegooglegroups.com or reply
to this email with the words "REMOVE ME" as the subject.