Index: src/compiler/js-operator.cc |
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc |
index 2f727ac24f5935c725ecd2a0125f68a8e4cecc62..ad2369da92a460de60905aa5ddf8267b14eb25c3 100644 |
--- a/src/compiler/js-operator.cc |
+++ b/src/compiler/js-operator.cc |
@@ -40,6 +40,25 @@ size_t hash_value(VectorSlotPair const& p) { |
} |
+size_t hash_value(ConvertReceiverMode const& mode) { |
+ return base::hash_value(static_cast<int>(mode)); |
+} |
+ |
+ |
+std::ostream& operator<<(std::ostream& os, ConvertReceiverMode const& mode) { |
+ switch (mode) { |
+ case ConvertReceiverMode::kNullOrUndefined: |
+ return os << "NULL_OR_UNDEFINED"; |
+ case ConvertReceiverMode::kNotNullOrUndefined: |
+ return os << "NOT_NULL_OR_UNDEFINED"; |
+ case ConvertReceiverMode::kAny: |
+ return os << "ANY"; |
+ } |
+ UNREACHABLE(); |
+ return os; |
+} |
+ |
+ |
std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { |
os << p.arity() << ", " << p.flags() << ", " << p.language_mode(); |
if (p.AllowTailCalls()) { |
@@ -496,13 +515,12 @@ CACHED_OP_LIST_WITH_LANGUAGE_MODE(CACHED_WITH_LANGUAGE_MODE) |
#undef CACHED_WITH_LANGUAGE_MODE |
-const Operator* JSOperatorBuilder::CallFunction(size_t arity, |
- CallFunctionFlags flags, |
- LanguageMode language_mode, |
- VectorSlotPair const& feedback, |
- TailCallMode tail_call_mode) { |
+const Operator* JSOperatorBuilder::CallFunction( |
+ size_t arity, CallFunctionFlags flags, LanguageMode language_mode, |
+ VectorSlotPair const& feedback, ConvertReceiverMode convert_mode, |
+ TailCallMode tail_call_mode) { |
CallFunctionParameters parameters(arity, flags, language_mode, feedback, |
- tail_call_mode); |
+ tail_call_mode, convert_mode); |
return new (zone()) Operator1<CallFunctionParameters>( // -- |
IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode |
"JSCallFunction", // name |
@@ -533,6 +551,16 @@ const Operator* JSOperatorBuilder::CallConstruct(int arguments) { |
} |
+const Operator* JSOperatorBuilder::ConvertReceiver( |
+ ConvertReceiverMode convert_mode) { |
+ return new (zone()) Operator1<ConvertReceiverMode>( // -- |
+ IrOpcode::kJSConvertReceiver, Operator::kNoThrow, // opcode |
+ "JSConvertReceiver", // name |
+ 1, 1, 1, 1, 1, 0, // counts |
+ convert_mode); // parameter |
+} |
+ |
+ |
const Operator* JSOperatorBuilder::LoadNamed(LanguageMode language_mode, |
Handle<Name> name, |
const VectorSlotPair& feedback) { |