summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/code-assembler.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2017-06-06 10:28:14 +0200
committerMichaël Zasso <targos@protonmail.com>2017-06-07 10:33:31 +0200
commit3dc8c3bed4cf3a77607edbb0b015e33f8b60fc09 (patch)
tree9dee56e142638b34f1eccbd0ad88c3bce5377c29 /deps/v8/src/compiler/code-assembler.h
parent91a1bbe3055a660194ca4d403795aa0c03e9d056 (diff)
downloadnode-new-3dc8c3bed4cf3a77607edbb0b015e33f8b60fc09.tar.gz
deps: update V8 to 5.9.211.32
PR-URL: https://github.com/nodejs/node/pull/13263 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/code-assembler.h')
-rw-r--r--deps/v8/src/compiler/code-assembler.h73
1 files changed, 71 insertions, 2 deletions
diff --git a/deps/v8/src/compiler/code-assembler.h b/deps/v8/src/compiler/code-assembler.h
index 8808a82f8e..86275ee0a0 100644
--- a/deps/v8/src/compiler/code-assembler.h
+++ b/deps/v8/src/compiler/code-assembler.h
@@ -85,6 +85,8 @@ typedef std::function<void()> CodeAssemblerCallback;
V(Float64Mod) \
V(Float64Atan2) \
V(Float64Pow) \
+ V(Float64Max) \
+ V(Float64Min) \
V(Float64InsertLowWord32) \
V(Float64InsertHighWord32) \
V(IntPtrAddWithOverflow) \
@@ -151,6 +153,7 @@ typedef std::function<void()> CodeAssemblerCallback;
V(TruncateInt64ToInt32) \
V(ChangeFloat32ToFloat64) \
V(ChangeFloat64ToUint32) \
+ V(ChangeFloat64ToUint64) \
V(ChangeInt32ToFloat64) \
V(ChangeInt32ToInt64) \
V(ChangeUint32ToFloat64) \
@@ -164,6 +167,9 @@ typedef std::function<void()> CodeAssemblerCallback;
V(Float64RoundTruncate) \
V(Word32Clz) \
V(Word32Not) \
+ V(Int32AbsWithOverflow) \
+ V(Int64AbsWithOverflow) \
+ V(IntPtrAbsWithOverflow) \
V(Word32BinaryNot)
// A "public" interface used by components outside of compiler directory to
@@ -198,6 +204,9 @@ class V8_EXPORT_PRIVATE CodeAssembler {
bool IsFloat64RoundDownSupported() const;
bool IsFloat64RoundTiesEvenSupported() const;
bool IsFloat64RoundTruncateSupported() const;
+ bool IsInt32AbsWithOverflowSupported() const;
+ bool IsInt64AbsWithOverflowSupported() const;
+ bool IsIntPtrAbsWithOverflowSupported() const;
// Shortened aliases for use in CodeAssembler subclasses.
typedef CodeAssemblerLabel Label;
@@ -234,11 +243,16 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void Return(Node* value1, Node* value2, Node* value3);
void PopAndReturn(Node* pop, Node* value);
+ void ReturnIf(Node* condition, Node* value);
+
void DebugBreak();
void Unreachable();
void Comment(const char* format, ...);
void Bind(Label* label);
+#if DEBUG
+ void Bind(Label* label, AssemblerDebugInfo debug_info);
+#endif // DEBUG
void Goto(Label* label);
void GotoIf(Node* condition, Label* true_label);
void GotoIfNot(Node* condition, Label* false_label);
@@ -272,6 +286,23 @@ class V8_EXPORT_PRIVATE CodeAssembler {
Node* AtomicStore(MachineRepresentation rep, Node* base, Node* offset,
Node* value);
+ // Exchange value at raw memory location
+ Node* AtomicExchange(MachineType type, Node* base, Node* offset, Node* value);
+
+ // Compare and Exchange value at raw memory location
+ Node* AtomicCompareExchange(MachineType type, Node* base, Node* offset,
+ Node* old_value, Node* new_value);
+
+ Node* AtomicAdd(MachineType type, Node* base, Node* offset, Node* value);
+
+ Node* AtomicSub(MachineType type, Node* base, Node* offset, Node* value);
+
+ Node* AtomicAnd(MachineType type, Node* base, Node* offset, Node* value);
+
+ Node* AtomicOr(MachineType type, Node* base, Node* offset, Node* value);
+
+ Node* AtomicXor(MachineType type, Node* base, Node* offset, Node* value);
+
// Store a value to the root array.
Node* StoreRoot(Heap::RootListIndex root_index, Node* value);
@@ -292,6 +323,10 @@ class V8_EXPORT_PRIVATE CodeAssembler {
CODE_ASSEMBLER_UNARY_OP_LIST(DECLARE_CODE_ASSEMBLER_UNARY_OP)
#undef DECLARE_CODE_ASSEMBLER_UNARY_OP
+ // Changes a double to an inptr_t for pointer arithmetic outside of Smi range.
+ // Assumes that the double can be exactly represented as an int.
+ Node* ChangeFloat64ToUintPtr(Node* value);
+
// Changes an intptr_t to a double, e.g. for storing an element index
// outside Smi range in a HeapNumber. Lossless on 32-bit,
// rounds on 64-bit (which doesn't affect valid element indices).
@@ -395,6 +430,11 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void BreakOnNode(int node_id);
+ bool UnalignedLoadSupported(const MachineType& machineType,
+ uint8_t alignment) const;
+ bool UnalignedStoreSupported(const MachineType& machineType,
+ uint8_t alignment) const;
+
protected:
void RegisterCallGenerationCallbacks(
const CodeAssemblerCallback& call_prologue,
@@ -419,6 +459,13 @@ class CodeAssemblerVariable {
MachineRepresentation rep);
CodeAssemblerVariable(CodeAssembler* assembler, MachineRepresentation rep,
Node* initial_value);
+#if DEBUG
+ CodeAssemblerVariable(CodeAssembler* assembler, AssemblerDebugInfo debug_info,
+ MachineRepresentation rep);
+ CodeAssemblerVariable(CodeAssembler* assembler, AssemblerDebugInfo debug_info,
+ MachineRepresentation rep, Node* initial_value);
+#endif // DEBUG
+
~CodeAssemblerVariable();
void Bind(Node* value);
Node* value() const;
@@ -426,13 +473,18 @@ class CodeAssemblerVariable {
bool IsBound() const;
private:
+ class Impl;
friend class CodeAssemblerLabel;
friend class CodeAssemblerState;
- class Impl;
+ friend std::ostream& operator<<(std::ostream&, const Impl&);
+ friend std::ostream& operator<<(std::ostream&, const CodeAssemblerVariable&);
Impl* impl_;
CodeAssemblerState* state_;
};
+std::ostream& operator<<(std::ostream&, const CodeAssemblerVariable&);
+std::ostream& operator<<(std::ostream&, const CodeAssemblerVariable::Impl&);
+
class CodeAssemblerLabel {
public:
enum Type { kDeferred, kNonDeferred };
@@ -448,18 +500,30 @@ class CodeAssemblerLabel {
: CodeAssemblerLabel(assembler, merged_variables.length(),
&(merged_variables[0]), type) {}
CodeAssemblerLabel(
- CodeAssembler* assembler, size_t count, CodeAssemblerVariable** vars,
+ CodeAssembler* assembler, size_t count,
+ CodeAssemblerVariable* const* vars,
CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred);
CodeAssemblerLabel(
+ CodeAssembler* assembler,
+ std::initializer_list<CodeAssemblerVariable*> vars,
+ CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred)
+ : CodeAssemblerLabel(assembler, vars.size(), vars.begin(), type) {}
+ CodeAssemblerLabel(
CodeAssembler* assembler, CodeAssemblerVariable* merged_variable,
CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred)
: CodeAssemblerLabel(assembler, 1, &merged_variable, type) {}
~CodeAssemblerLabel();
+ inline bool is_bound() const { return bound_; }
+
private:
friend class CodeAssembler;
void Bind();
+#if DEBUG
+ void Bind(AssemblerDebugInfo debug_info);
+#endif // DEBUG
+ void UpdateVariablesAfterBind();
void MergeVariables();
bool bound_;
@@ -493,6 +557,11 @@ class V8_EXPORT_PRIVATE CodeAssemblerState {
const char* name() const { return name_; }
int parameter_count() const;
+#if DEBUG
+ void PrintCurrentBlock(std::ostream& os);
+#endif // DEBUG
+ void SetInitialDebugInformation(const char* msg, const char* file, int line);
+
private:
friend class CodeAssembler;
friend class CodeAssemblerLabel;