summaryrefslogtreecommitdiff
path: root/deps/v8/src/interpreter/bytecode-traits.h
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2016-04-07 14:06:55 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2016-04-14 10:03:39 -0700
commit52af5c4eebf4de8638aef0338bd826656312a02a (patch)
tree628dc9fb0b558c3a73a2160706fef368876fe548 /deps/v8/src/interpreter/bytecode-traits.h
parent6e3e8acc7cc7ebd3d67db5ade1247b8b558efe09 (diff)
downloadnode-new-52af5c4eebf4de8638aef0338bd826656312a02a.tar.gz
deps: upgrade V8 to 5.0.71.32
* Pick up the branch head for V8 5.0 stable [1] * Edit v8 gitignore to allow trace_event copy * Update V8 DEP trace_event as per deps/v8/DEPS [2] [1] https://chromium.googlesource.com/v8/v8.git/+/3c67831 [2] https://chromium.googlesource.com/chromium/src/base/trace_event/common/+/4b09207e447ae5bd34643b4c6321bee7b76d35f9 Ref: https://github.com/nodejs/node/pull/5945 PR-URL: https://github.com/nodejs/node/pull/6111 Reviewed-By: targos - Michaƫl Zasso <mic.besace@gmail.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'deps/v8/src/interpreter/bytecode-traits.h')
-rw-r--r--deps/v8/src/interpreter/bytecode-traits.h69
1 files changed, 68 insertions, 1 deletions
diff --git a/deps/v8/src/interpreter/bytecode-traits.h b/deps/v8/src/interpreter/bytecode-traits.h
index fd778d7c92..b8136051bb 100644
--- a/deps/v8/src/interpreter/bytecode-traits.h
+++ b/deps/v8/src/interpreter/bytecode-traits.h
@@ -28,6 +28,18 @@ struct OperandTraits {};
OPERAND_TYPE_LIST(DECLARE_OPERAND_SIZE)
#undef DECLARE_OPERAND_SIZE
+template <OperandType>
+struct RegisterOperandTraits {
+ static const int kIsRegisterOperand = 0;
+};
+
+#define DECLARE_REGISTER_OPERAND(Name, _) \
+ template <> \
+ struct RegisterOperandTraits<OperandType::k##Name> { \
+ static const int kIsRegisterOperand = 1; \
+ };
+REGISTER_OPERAND_TYPE_LIST(DECLARE_REGISTER_OPERAND)
+#undef DECLARE_REGISTER_OPERAND
template <OperandType... Args>
struct BytecodeTraits {};
@@ -63,13 +75,28 @@ struct BytecodeTraits<operand_0, operand_1, operand_2, operand_3,
return kOperandOffsets[i];
}
+ template <OperandType ot>
+ static inline bool HasAnyOperandsOfType() {
+ return operand_0 == ot || operand_1 == ot || operand_2 == ot ||
+ operand_3 == ot;
+ }
+
static const int kOperandCount = 4;
+ static const int kRegisterOperandCount =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand +
+ RegisterOperandTraits<operand_1>::kIsRegisterOperand +
+ RegisterOperandTraits<operand_2>::kIsRegisterOperand +
+ RegisterOperandTraits<operand_3>::kIsRegisterOperand;
+ static const int kRegisterOperandBitmap =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand +
+ (RegisterOperandTraits<operand_1>::kIsRegisterOperand << 1) +
+ (RegisterOperandTraits<operand_2>::kIsRegisterOperand << 2) +
+ (RegisterOperandTraits<operand_3>::kIsRegisterOperand << 3);
static const int kSize =
1 + OperandTraits<operand_0>::kSize + OperandTraits<operand_1>::kSize +
OperandTraits<operand_2>::kSize + OperandTraits<operand_3>::kSize;
};
-
template <OperandType operand_0, OperandType operand_1, OperandType operand_2>
struct BytecodeTraits<operand_0, operand_1, operand_2, OPERAND_TERM> {
static inline OperandType GetOperandType(int i) {
@@ -96,7 +123,20 @@ struct BytecodeTraits<operand_0, operand_1, operand_2, OPERAND_TERM> {
return kOperandOffsets[i];
}
+ template <OperandType ot>
+ static inline bool HasAnyOperandsOfType() {
+ return operand_0 == ot || operand_1 == ot || operand_2 == ot;
+ }
+
static const int kOperandCount = 3;
+ static const int kRegisterOperandCount =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand +
+ RegisterOperandTraits<operand_1>::kIsRegisterOperand +
+ RegisterOperandTraits<operand_2>::kIsRegisterOperand;
+ static const int kRegisterOperandBitmap =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand +
+ (RegisterOperandTraits<operand_1>::kIsRegisterOperand << 1) +
+ (RegisterOperandTraits<operand_2>::kIsRegisterOperand << 2);
static const int kSize =
1 + OperandTraits<operand_0>::kSize + OperandTraits<operand_1>::kSize +
OperandTraits<operand_2>::kSize;
@@ -126,7 +166,18 @@ struct BytecodeTraits<operand_0, operand_1, OPERAND_TERM> {
return kOperandOffsets[i];
}
+ template <OperandType ot>
+ static inline bool HasAnyOperandsOfType() {
+ return operand_0 == ot || operand_1 == ot;
+ }
+
static const int kOperandCount = 2;
+ static const int kRegisterOperandCount =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand +
+ RegisterOperandTraits<operand_1>::kIsRegisterOperand;
+ static const int kRegisterOperandBitmap =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand +
+ (RegisterOperandTraits<operand_1>::kIsRegisterOperand << 1);
static const int kSize =
1 + OperandTraits<operand_0>::kSize + OperandTraits<operand_1>::kSize;
};
@@ -148,7 +199,16 @@ struct BytecodeTraits<operand_0, OPERAND_TERM> {
return 1;
}
+ template <OperandType ot>
+ static inline bool HasAnyOperandsOfType() {
+ return operand_0 == ot;
+ }
+
static const int kOperandCount = 1;
+ static const int kRegisterOperandCount =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand;
+ static const int kRegisterOperandBitmap =
+ RegisterOperandTraits<operand_0>::kIsRegisterOperand;
static const int kSize = 1 + OperandTraits<operand_0>::kSize;
};
@@ -169,7 +229,14 @@ struct BytecodeTraits<OperandType::kNone, OPERAND_TERM> {
return 1;
}
+ template <OperandType ot>
+ static inline bool HasAnyOperandsOfType() {
+ return false;
+ }
+
static const int kOperandCount = 0;
+ static const int kRegisterOperandCount = 0;
+ static const int kRegisterOperandBitmap = 0;
static const int kSize = 1 + OperandTraits<OperandType::kNone>::kSize;
};