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

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

Issue 633423002: Teach TurboFan to call vector-based ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nits. Created 6 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-operator.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('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 e0ce3de2b3aca08c7076eb852b9e145411d44a4a..cf7d65e2de763d850e66802a700361c432a90541 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -108,10 +108,23 @@ ContextAccess const& ContextAccessOf(Operator const* op) {
}
+bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs) {
+ return lhs.slot() == rhs.slot() && lhs.vector().is_identical_to(rhs.vector());
+}
+
+
+size_t hash_value(VectorSlotPair const& p) {
+ // TODO(mvstanton): include the vector in the hash.
+ base::hash<int> h;
+ return h(p.slot());
+}
+
+
bool operator==(LoadNamedParameters const& lhs,
LoadNamedParameters const& rhs) {
return lhs.name() == rhs.name() &&
- lhs.contextual_mode() == rhs.contextual_mode();
+ lhs.contextual_mode() == rhs.contextual_mode() &&
+ lhs.feedback() == rhs.feedback();
}
@@ -122,7 +135,7 @@ bool operator!=(LoadNamedParameters const& lhs,
size_t hash_value(LoadNamedParameters const& p) {
- return base::hash_combine(p.name(), p.contextual_mode());
+ return base::hash_combine(p.name(), p.contextual_mode(), p.feedback());
}
@@ -131,6 +144,35 @@ std::ostream& operator<<(std::ostream& os, LoadNamedParameters const& p) {
}
+std::ostream& operator<<(std::ostream& os, LoadPropertyParameters const& p) {
+ // Nothing special to print.
+ return os;
+}
+
+
+bool operator==(LoadPropertyParameters const& lhs,
+ LoadPropertyParameters const& rhs) {
+ return lhs.feedback() == rhs.feedback();
+}
+
+
+bool operator!=(LoadPropertyParameters const& lhs,
+ LoadPropertyParameters const& rhs) {
+ return !(lhs == rhs);
+}
+
+
+const LoadPropertyParameters& LoadPropertyParametersOf(const Operator* op) {
+ DCHECK_EQ(IrOpcode::kJSLoadProperty, op->opcode());
+ return OpParameter<LoadPropertyParameters>(op);
+}
+
+
+size_t hash_value(LoadPropertyParameters const& p) {
+ return hash_value(p.feedback());
+}
+
+
const LoadNamedParameters& LoadNamedParametersOf(const Operator* op) {
DCHECK_EQ(IrOpcode::kJSLoadNamed, op->opcode());
return OpParameter<LoadNamedParameters>(op);
@@ -193,7 +235,6 @@ const StoreNamedParameters& StoreNamedParametersOf(const Operator* op) {
V(ToObject, Operator::kNoProperties, 1, 1) \
V(Yield, Operator::kNoProperties, 1, 1) \
V(Create, Operator::kEliminatable, 0, 1) \
- V(LoadProperty, Operator::kNoProperties, 2, 1) \
V(HasProperty, Operator::kNoProperties, 2, 1) \
V(TypeOf, Operator::kPure, 1, 1) \
V(InstanceOf, Operator::kNoProperties, 2, 1) \
@@ -261,14 +302,24 @@ const Operator* JSOperatorBuilder::CallConstruct(int arguments) {
const Operator* JSOperatorBuilder::LoadNamed(const Unique<Name>& name,
+ const VectorSlotPair& feedback,
ContextualMode contextual_mode) {
- LoadNamedParameters parameters(name, contextual_mode);
+ LoadNamedParameters parameters(name, feedback, contextual_mode);
return new (zone()) Operator1<LoadNamedParameters>(
IrOpcode::kJSLoadNamed, Operator::kNoProperties, 1, 1, "JSLoadNamed",
parameters);
}
+const Operator* JSOperatorBuilder::LoadProperty(
+ const VectorSlotPair& feedback) {
+ LoadPropertyParameters parameters(feedback);
+ return new (zone()) Operator1<LoadPropertyParameters>(
+ IrOpcode::kJSLoadProperty, Operator::kNoProperties, 2, 1,
+ "JSLoadProperty", parameters);
+}
+
+
const Operator* JSOperatorBuilder::StoreProperty(StrictMode strict_mode) {
return new (zone())
Operator1<StrictMode>(IrOpcode::kJSStoreProperty, Operator::kNoProperties,
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698