Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: src/compiler/js-operator.cc

Issue 1412223015: [turbofan] Fix receiver binding for inlined callees. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698