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

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

Issue 1105513002: [turbofan] Use FastNewClosureStub if possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. 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
Index: src/compiler/js-operator.cc
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
index aeb317bcc9c4f87685bd54b585f67c845041037a..5541eafd0c29628433a76be0760e3c1e36c1ea6f 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -208,6 +208,37 @@ const StoreNamedParameters& StoreNamedParametersOf(const Operator* op) {
}
+bool operator==(CreateClosureParameters const& lhs,
+ CreateClosureParameters const& rhs) {
+ return lhs.pretenure() == rhs.pretenure() &&
+ lhs.shared_info().is_identical_to(rhs.shared_info());
+}
+
+
+bool operator!=(CreateClosureParameters const& lhs,
+ CreateClosureParameters const& rhs) {
+ return !(lhs == rhs);
+}
+
+
+size_t hash_value(CreateClosureParameters const& p) {
+ // TODO(mstarzinger): Include hash of the SharedFunctionInfo here.
+ base::hash<PretenureFlag> h;
+ return h(p.pretenure());
+}
+
+
+std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) {
+ return os << p.pretenure() << ", " << Brief(*p.shared_info());
+}
+
+
+const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) {
+ DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode());
+ return OpParameter<CreateClosureParameters>(op);
+}
+
+
#define CACHED_OP_LIST(V) \
V(Equal, Operator::kNoProperties, 2, 1) \
V(NotEqual, Operator::kNoProperties, 2, 1) \
@@ -401,6 +432,17 @@ const Operator* JSOperatorBuilder::StoreContext(size_t depth, size_t index) {
}
+const Operator* JSOperatorBuilder::CreateClosure(
+ Handle<SharedFunctionInfo> shared_info, PretenureFlag pretenure) {
+ CreateClosureParameters parameters(shared_info, pretenure);
+ return new (zone()) Operator1<CreateClosureParameters>( // --
+ IrOpcode::kJSCreateClosure, Operator::kNoThrow, // opcode
+ "JSCreateClosure", // name
+ 1, 1, 1, 1, 1, 0, // counts
+ parameters); // parameter
+}
+
+
const Operator* JSOperatorBuilder::CreateCatchContext(
const Unique<String>& name) {
return new (zone()) Operator1<Unique<String>>( // --

Powered by Google App Engine
This is Rietveld 408576698