Index: src/compiler/js-operator.h |
diff --git a/src/compiler/js-operator.h b/src/compiler/js-operator.h |
index bdb0c9c7d4411912e8ca2e0e3721223ccd66ed48..c30da196aa134057f317868b1f39af3df1daa938 100644 |
--- a/src/compiler/js-operator.h |
+++ b/src/compiler/js-operator.h |
@@ -21,19 +21,35 @@ struct JSOperatorGlobalCache; |
// used as a parameter by JSCallFunction operators. |
class CallFunctionParameters final { |
public: |
- CallFunctionParameters(size_t arity, CallFunctionFlags flags) |
- : arity_(arity), flags_(flags) {} |
- |
- size_t arity() const { return arity_; } |
- CallFunctionFlags flags() const { return flags_; } |
+ CallFunctionParameters(size_t arity, CallFunctionFlags flags, |
+ LanguageMode language_mode) |
+ : bit_field_(ArityField::encode(arity) | FlagsField::encode(flags) | |
+ LanguageModeField::encode(language_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_); |
+ } |
+ |
+ bool operator==(CallFunctionParameters const& that) const { |
+ return this->bit_field_ == that.bit_field_; |
+ } |
+ bool operator!=(CallFunctionParameters const& that) const { |
+ return !(*this == that); |
+ } |
private: |
- const size_t arity_; |
- const CallFunctionFlags flags_; |
-}; |
+ friend size_t hash_value(CallFunctionParameters const& p) { |
+ return p.bit_field_; |
+ } |
+ |
+ typedef BitField<unsigned, 0, 28> ArityField; |
+ typedef BitField<CallFunctionFlags, 28, 2> FlagsField; |
+ typedef BitField<LanguageMode, 30, 2> LanguageModeField; |
-bool operator==(CallFunctionParameters const&, CallFunctionParameters const&); |
-bool operator!=(CallFunctionParameters const&, CallFunctionParameters const&); |
+ const uint32_t bit_field_; |
+}; |
size_t hash_value(CallFunctionParameters const&); |
@@ -271,7 +287,8 @@ class JSOperatorBuilder final : public ZoneObject { |
const Operator* CreateClosure(Handle<SharedFunctionInfo> shared_info, |
PretenureFlag pretenure); |
- const Operator* CallFunction(size_t arity, CallFunctionFlags flags); |
+ const Operator* CallFunction(size_t arity, CallFunctionFlags flags, |
+ LanguageMode language_mode); |
const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); |
const Operator* CallConstruct(int arguments); |