Merge V8 5.2.361.47 DO NOT MERGE
https://chromium.googlesource.com/v8/v8/+/5.2.361.47
FPIIM-449
Change-Id: Ibec421b85a9b88cb3a432ada642e469fe7e78346
(cherry picked from commit bcf72ee8e3b26f1d0726869c7ddb3921c68b09a8)
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index 1f12579..105298e 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -28,10 +28,7 @@
: CallDescriptor::kNoFlags;
}
-
-JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph)
- : is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {}
-
+JSGenericLowering::JSGenericLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
JSGenericLowering::~JSGenericLowering() {}
@@ -44,40 +41,12 @@
break;
JS_OP_LIST(DECLARE_CASE)
#undef DECLARE_CASE
- case IrOpcode::kBranch:
- case IrOpcode::kDeoptimizeIf:
- case IrOpcode::kDeoptimizeUnless:
- // TODO(mstarzinger): If typing is enabled then simplified lowering will
- // have inserted the correct ChangeBoolToBit, otherwise we need to perform
- // poor-man's representation inference here and insert manual change.
- if (!is_typing_enabled_) {
- Node* condition = node->InputAt(0);
- Node* test = graph()->NewNode(machine()->WordEqual(), condition,
- jsgraph()->TrueConstant());
- node->ReplaceInput(0, test);
- }
- // Fall-through.
default:
// Nothing to see.
return NoChange();
}
return Changed(node);
}
-
-#define REPLACE_BINARY_OP_IC_CALL(Op, token) \
- void JSGenericLowering::Lower##Op(Node* node) { \
- CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); \
- ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \
- CallDescriptor::kPatchableCallSiteWithNop | flags); \
- }
-REPLACE_BINARY_OP_IC_CALL(JSShiftLeft, Token::SHL)
-REPLACE_BINARY_OP_IC_CALL(JSShiftRight, Token::SAR)
-REPLACE_BINARY_OP_IC_CALL(JSShiftRightLogical, Token::SHR)
-REPLACE_BINARY_OP_IC_CALL(JSMultiply, Token::MUL)
-REPLACE_BINARY_OP_IC_CALL(JSDivide, Token::DIV)
-REPLACE_BINARY_OP_IC_CALL(JSModulus, Token::MOD)
-#undef REPLACE_BINARY_OP_IC_CALL
-
#define REPLACE_RUNTIME_CALL(op, fun) \
void JSGenericLowering::Lower##op(Node* node) { \
ReplaceWithRuntimeCall(node, fun); \
@@ -95,18 +64,22 @@
}
REPLACE_STUB_CALL(Add)
REPLACE_STUB_CALL(Subtract)
+REPLACE_STUB_CALL(Multiply)
+REPLACE_STUB_CALL(Divide)
+REPLACE_STUB_CALL(Modulus)
REPLACE_STUB_CALL(BitwiseAnd)
REPLACE_STUB_CALL(BitwiseOr)
REPLACE_STUB_CALL(BitwiseXor)
+REPLACE_STUB_CALL(ShiftLeft)
+REPLACE_STUB_CALL(ShiftRight)
+REPLACE_STUB_CALL(ShiftRightLogical)
REPLACE_STUB_CALL(LessThan)
REPLACE_STUB_CALL(LessThanOrEqual)
REPLACE_STUB_CALL(GreaterThan)
REPLACE_STUB_CALL(GreaterThanOrEqual)
+REPLACE_STUB_CALL(HasProperty)
REPLACE_STUB_CALL(Equal)
REPLACE_STUB_CALL(NotEqual)
-REPLACE_STUB_CALL(StrictEqual)
-REPLACE_STUB_CALL(StrictNotEqual)
-REPLACE_STUB_CALL(ToBoolean)
REPLACE_STUB_CALL(ToInteger)
REPLACE_STUB_CALL(ToLength)
REPLACE_STUB_CALL(ToNumber)
@@ -117,7 +90,12 @@
void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
CallDescriptor::Flags flags) {
- Operator::Properties properties = node->op()->properties();
+ ReplaceWithStubCall(node, callable, flags, node->op()->properties());
+}
+
+void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
+ CallDescriptor::Flags flags,
+ Operator::Properties properties) {
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 0, flags, properties);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
@@ -143,11 +121,32 @@
NodeProperties::ChangeOp(node, common()->Call(desc));
}
+void JSGenericLowering::LowerJSStrictEqual(Node* node) {
+ Callable callable = CodeFactory::StrictEqual(isolate());
+ node->AppendInput(zone(), graph()->start());
+ ReplaceWithStubCall(node, callable, CallDescriptor::kNoFlags,
+ Operator::kEliminatable);
+}
+
+void JSGenericLowering::LowerJSStrictNotEqual(Node* node) {
+ Callable callable = CodeFactory::StrictNotEqual(isolate());
+ node->AppendInput(zone(), graph()->start());
+ ReplaceWithStubCall(node, callable, CallDescriptor::kNoFlags,
+ Operator::kEliminatable);
+}
+
+void JSGenericLowering::LowerJSToBoolean(Node* node) {
+ Callable callable = CodeFactory::ToBoolean(isolate());
+ node->AppendInput(zone(), graph()->start());
+ ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate,
+ Operator::kEliminatable);
+}
void JSGenericLowering::LowerJSTypeOf(Node* node) {
- CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
Callable callable = CodeFactory::Typeof(isolate());
- ReplaceWithStubCall(node, callable, flags);
+ node->AppendInput(zone(), graph()->start());
+ ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate,
+ Operator::kEliminatable);
}
@@ -344,11 +343,6 @@
}
-void JSGenericLowering::LowerJSHasProperty(Node* node) {
- ReplaceWithRuntimeCall(node, Runtime::kHasProperty);
-}
-
-
void JSGenericLowering::LowerJSInstanceOf(Node* node) {
CallDescriptor::Flags flags = AdjustFrameStatesForCall(node);
Callable callable = CodeFactory::InstanceOf(isolate());
@@ -686,9 +680,6 @@
}
-void JSGenericLowering::LowerJSYield(Node* node) { UNIMPLEMENTED(); }
-
-
void JSGenericLowering::LowerJSStackCheck(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);