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

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

Issue 1107883002: [turbofan] Add language mode to JSCallFunction operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/ast-graph-builder.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 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);
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698