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

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
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.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 716592bd972b3928bf7fccbba0baf08f7b8ef342..8812b6e46ecbcc5ba9e7df6e507ce558662d031f 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) \
@@ -437,6 +468,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>>( // --
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698