Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
index dfbe742..89c0eee 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -9,8 +9,8 @@
#include "src/base/lazy-instance.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"
-#include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker!
-#include "src/type-feedback-vector-inl.h"
+#include "src/handles-inl.h"
+#include "src/type-feedback-vector.h"
namespace v8 {
namespace internal {
@@ -376,34 +376,54 @@
return OpParameter<CreateLiteralParameters>(op);
}
-#define CACHED_OP_LIST(V) \
- V(Equal, Operator::kNoProperties, 2, 1) \
- V(NotEqual, Operator::kNoProperties, 2, 1) \
- V(StrictEqual, Operator::kPure, 2, 1) \
- V(StrictNotEqual, Operator::kPure, 2, 1) \
- V(LessThan, Operator::kNoProperties, 2, 1) \
- V(GreaterThan, Operator::kNoProperties, 2, 1) \
- V(LessThanOrEqual, Operator::kNoProperties, 2, 1) \
- V(GreaterThanOrEqual, Operator::kNoProperties, 2, 1) \
- V(ToInteger, Operator::kNoProperties, 1, 1) \
- V(ToLength, Operator::kNoProperties, 1, 1) \
- V(ToName, Operator::kNoProperties, 1, 1) \
- V(ToNumber, Operator::kNoProperties, 1, 1) \
- V(ToObject, Operator::kFoldable, 1, 1) \
- V(ToString, Operator::kNoProperties, 1, 1) \
- V(Create, Operator::kEliminatable, 2, 1) \
- V(CreateIterResultObject, Operator::kEliminatable, 2, 1) \
- V(HasProperty, Operator::kNoProperties, 2, 1) \
- V(TypeOf, Operator::kPure, 1, 1) \
- V(InstanceOf, Operator::kNoProperties, 2, 1) \
- V(ForInDone, Operator::kPure, 2, 1) \
- V(ForInNext, Operator::kNoProperties, 4, 1) \
- V(ForInPrepare, Operator::kNoProperties, 1, 3) \
- V(ForInStep, Operator::kPure, 1, 1) \
- V(LoadMessage, Operator::kNoThrow, 0, 1) \
- V(StoreMessage, Operator::kNoThrow, 1, 0) \
- V(StackCheck, Operator::kNoProperties, 0, 0) \
- V(CreateWithContext, Operator::kNoProperties, 2, 1) \
+const BinaryOperationHints& BinaryOperationHintsOf(const Operator* op) {
+ DCHECK(op->opcode() == IrOpcode::kJSBitwiseOr ||
+ op->opcode() == IrOpcode::kJSBitwiseXor ||
+ op->opcode() == IrOpcode::kJSBitwiseAnd ||
+ op->opcode() == IrOpcode::kJSShiftLeft ||
+ op->opcode() == IrOpcode::kJSShiftRight ||
+ op->opcode() == IrOpcode::kJSShiftRightLogical ||
+ op->opcode() == IrOpcode::kJSAdd ||
+ op->opcode() == IrOpcode::kJSSubtract ||
+ op->opcode() == IrOpcode::kJSMultiply ||
+ op->opcode() == IrOpcode::kJSDivide ||
+ op->opcode() == IrOpcode::kJSModulus);
+ return OpParameter<BinaryOperationHints>(op);
+}
+
+const CompareOperationHints& CompareOperationHintsOf(const Operator* op) {
+ DCHECK(op->opcode() == IrOpcode::kJSEqual ||
+ op->opcode() == IrOpcode::kJSNotEqual ||
+ op->opcode() == IrOpcode::kJSStrictEqual ||
+ op->opcode() == IrOpcode::kJSStrictNotEqual ||
+ op->opcode() == IrOpcode::kJSLessThan ||
+ op->opcode() == IrOpcode::kJSGreaterThan ||
+ op->opcode() == IrOpcode::kJSLessThanOrEqual ||
+ op->opcode() == IrOpcode::kJSGreaterThanOrEqual);
+ return OpParameter<CompareOperationHints>(op);
+}
+
+#define CACHED_OP_LIST(V) \
+ V(ToInteger, Operator::kNoProperties, 1, 1) \
+ V(ToLength, Operator::kNoProperties, 1, 1) \
+ V(ToName, Operator::kNoProperties, 1, 1) \
+ V(ToNumber, Operator::kNoProperties, 1, 1) \
+ V(ToObject, Operator::kFoldable, 1, 1) \
+ V(ToString, Operator::kNoProperties, 1, 1) \
+ V(Create, Operator::kEliminatable, 2, 1) \
+ V(CreateIterResultObject, Operator::kEliminatable, 2, 1) \
+ V(HasProperty, Operator::kNoProperties, 2, 1) \
+ V(TypeOf, Operator::kPure, 1, 1) \
+ V(InstanceOf, Operator::kNoProperties, 2, 1) \
+ V(ForInDone, Operator::kPure, 2, 1) \
+ V(ForInNext, Operator::kNoProperties, 4, 1) \
+ V(ForInPrepare, Operator::kNoProperties, 1, 3) \
+ V(ForInStep, Operator::kPure, 1, 1) \
+ V(LoadMessage, Operator::kNoThrow, 0, 1) \
+ V(StoreMessage, Operator::kNoThrow, 1, 0) \
+ V(GeneratorRestoreContinuation, Operator::kNoThrow, 1, 1) \
+ V(StackCheck, Operator::kNoProperties, 0, 0) \
+ V(CreateWithContext, Operator::kNoProperties, 2, 1) \
V(CreateModuleContext, Operator::kNoProperties, 2, 1)
struct JSOperatorGlobalCache final {
@@ -537,6 +557,79 @@
hints); // parameter
}
+const Operator* JSOperatorBuilder::Equal(CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSEqual, Operator::kNoProperties, // opcode
+ "JSEqual", // name
+ 2, 1, 1, 1, 1, 2, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::NotEqual(CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSNotEqual, Operator::kNoProperties, // opcode
+ "JSNotEqual", // name
+ 2, 1, 1, 1, 1, 2, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::StrictEqual(CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSStrictEqual, Operator::kPure, // opcode
+ "JSStrictEqual", // name
+ 2, 0, 0, 1, 0, 0, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::StrictNotEqual(CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSStrictNotEqual, Operator::kPure, // opcode
+ "JSStrictNotEqual", // name
+ 2, 0, 0, 1, 0, 0, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::LessThan(CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSLessThan, Operator::kNoProperties, // opcode
+ "JSLessThan", // name
+ 2, 1, 1, 1, 1, 2, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::GreaterThan(CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSGreaterThan, Operator::kNoProperties, // opcode
+ "JSGreaterThan", // name
+ 2, 1, 1, 1, 1, 2, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::LessThanOrEqual(
+ CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSLessThanOrEqual, Operator::kNoProperties, // opcode
+ "JSLessThanOrEqual", // name
+ 2, 1, 1, 1, 1, 2, // inputs/outputs
+ hints); // parameter
+}
+
+const Operator* JSOperatorBuilder::GreaterThanOrEqual(
+ CompareOperationHints hints) {
+ // TODO(turbofan): Cache most important versions of this operator.
+ return new (zone()) Operator1<CompareOperationHints>( //--
+ IrOpcode::kJSGreaterThanOrEqual, Operator::kNoProperties, // opcode
+ "JSGreaterThanOrEqual", // name
+ 2, 1, 1, 1, 1, 2, // inputs/outputs
+ hints); // parameter
+}
const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) {
// TODO(turbofan): Cache most important versions of this operator.
@@ -625,6 +718,21 @@
access); // parameter
}
+const Operator* JSOperatorBuilder::GeneratorStore(int register_count) {
+ return new (zone()) Operator1<int>( // --
+ IrOpcode::kJSGeneratorStore, Operator::kNoThrow, // opcode
+ "JSGeneratorStore", // name
+ 3 + register_count, 1, 1, 0, 1, 0, // counts
+ register_count); // parameter
+}
+
+const Operator* JSOperatorBuilder::GeneratorRestoreRegister(int index) {
+ return new (zone()) Operator1<int>( // --
+ IrOpcode::kJSGeneratorRestoreRegister, Operator::kNoThrow, // opcode
+ "JSGeneratorRestoreRegister", // name
+ 1, 1, 1, 1, 1, 0, // counts
+ index); // parameter
+}
const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
Handle<Name> name,