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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1423593005: [interpreter] Fix U16 macro in test-bytecode-generator.cc. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index 2f547721abd82aa375d34d877eaa9655d642a8da..984ea496b4e23fbf67eb7fec5fccf94edbe20d5f 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -81,17 +81,21 @@ class BytecodeGeneratorHelper {
// Helper macros for handcrafting bytecode sequences.
+int u16_temp;
+
#define B(x) static_cast<uint8_t>(Bytecode::k##x)
#define U8(x) static_cast<uint8_t>((x) & 0xff)
#define R(x) static_cast<uint8_t>(-(x) & 0xff)
#define A(x, n) R(helper.kLastParamIndex - (n) + 1 + (x))
#define THIS(n) A(0, n)
#if defined(V8_TARGET_LITTLE_ENDIAN)
-#define U16(x) static_cast<uint8_t>((x) & 0xff), \
- static_cast<uint8_t>(((x) >> kBitsPerByte) & 0xff)
+#define U16(x) \
+ static_cast<uint8_t>((u16_temp = (x)) & 0xff), \
+ static_cast<uint8_t>(((u16_temp) >> kBitsPerByte) & 0xff)
#elif defined(V8_TARGET_BIG_ENDIAN)
-#define U16(x) static_cast<uint8_t>(((x) >> kBitsPerByte) & 0xff), \
- static_cast<uint8_t>((x) & 0xff)
+#define U16(x) \
+ static_cast<uint8_t>(((u16_temp = (x)) >> kBitsPerByte) & 0xff), \
+ static_cast<uint8_t>((u16_temp)&0xff)
#else
#error Unknown byte ordering
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698