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

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

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-intrinsic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.h
diff --git a/src/compiler/js-operator.h b/src/compiler/js-operator.h
index 60a20ad0145b25fc95e90e959bd6abe1921305e2..cc50cc23a56df9ab224b8bc96254ec965c8e90a8 100644
--- a/src/compiler/js-operator.h
+++ b/src/compiler/js-operator.h
@@ -41,8 +41,26 @@ bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
size_t hash_value(VectorSlotPair const&);
+
+// Defines hints about receiver values based on structural knowledge. This is
+// used as a parameter by JSConvertReceiver operators.
+enum class ConvertReceiverMode {
+ kNullOrUndefined, // Guaranteed to be null or undefined.
+ kNotNullOrUndefined, // Guaranteed to never be null or undefined.
+ kAny // No specific knowledge about receiver.
+};
+
+size_t hash_value(ConvertReceiverMode const&);
+
+std::ostream& operator<<(std::ostream&, ConvertReceiverMode const&);
+
+const ConvertReceiverMode& ConvertReceiverModeOf(const Operator* op);
+
+
+// Defines whether tail call optimization is allowed.
enum TailCallMode { NO_TAIL_CALLS, ALLOW_TAIL_CALLS };
+
// Defines the arity and the call flags for a JavaScript function call. This is
// used as a parameter by JSCallFunction operators.
class CallFunctionParameters final {
@@ -50,22 +68,27 @@ class CallFunctionParameters final {
CallFunctionParameters(size_t arity, CallFunctionFlags flags,
LanguageMode language_mode,
VectorSlotPair const& feedback,
- TailCallMode tail_call_mode)
+ TailCallMode tail_call_mode,
+ ConvertReceiverMode convert_mode)
: bit_field_(ArityField::encode(arity) | FlagsField::encode(flags) |
LanguageModeField::encode(language_mode)),
feedback_(feedback),
- tail_call_mode_(tail_call_mode) {}
+ tail_call_mode_(tail_call_mode),
+ convert_mode_(convert_mode) {}
size_t arity() const { return ArityField::decode(bit_field_); }
CallFunctionFlags flags() const { return FlagsField::decode(bit_field_); }
LanguageMode language_mode() const {
return LanguageModeField::decode(bit_field_);
}
+ ConvertReceiverMode convert_mode() const { return convert_mode_; }
VectorSlotPair const& feedback() const { return feedback_; }
bool operator==(CallFunctionParameters const& that) const {
return this->bit_field_ == that.bit_field_ &&
- this->feedback_ == that.feedback_;
+ this->feedback_ == that.feedback_ &&
+ this->tail_call_mode_ == that.tail_call_mode_ &&
+ this->convert_mode_ == that.convert_mode_;
}
bool operator!=(CallFunctionParameters const& that) const {
return !(*this == that);
@@ -75,7 +98,7 @@ class CallFunctionParameters final {
private:
friend size_t hash_value(CallFunctionParameters const& p) {
- return base::hash_combine(p.bit_field_, p.feedback_);
+ return base::hash_combine(p.bit_field_, p.feedback_, p.convert_mode_);
}
typedef BitField<size_t, 0, 28> ArityField;
@@ -84,7 +107,8 @@ class CallFunctionParameters final {
const uint32_t bit_field_;
const VectorSlotPair feedback_;
- bool tail_call_mode_;
+ TailCallMode tail_call_mode_;
+ ConvertReceiverMode convert_mode_;
};
size_t hash_value(CallFunctionParameters const&);
@@ -440,11 +464,13 @@ class JSOperatorBuilder final : public ZoneObject {
const Operator* CallFunction(
size_t arity, CallFunctionFlags flags, LanguageMode language_mode,
VectorSlotPair const& feedback = VectorSlotPair(),
+ ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
TailCallMode tail_call_mode = NO_TAIL_CALLS);
const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
-
const Operator* CallConstruct(int arguments);
+ const Operator* ConvertReceiver(ConvertReceiverMode convert_mode);
+
const Operator* LoadProperty(LanguageMode language_mode,
VectorSlotPair const& feedback);
const Operator* LoadNamed(LanguageMode language_mode, Handle<Name> name,
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698