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

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

Issue 1168093002: [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 6 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.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 83bf5573811841044b7d9ff3386435b97641c8f3..8a2c6fe269315c504e15a60115fd1e9fe7729f38 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -190,6 +190,7 @@ size_t hash_value(ResolvedFeedbackSlot const& p) {
bool operator==(LoadNamedParameters const& lhs,
LoadNamedParameters const& rhs) {
return lhs.name() == rhs.name() &&
+ lhs.language_mode() == rhs.language_mode() &&
lhs.contextual_mode() == rhs.contextual_mode() &&
lhs.feedback() == rhs.feedback();
}
@@ -202,24 +203,26 @@ bool operator!=(LoadNamedParameters const& lhs,
size_t hash_value(LoadNamedParameters const& p) {
- return base::hash_combine(p.name(), p.contextual_mode(), p.feedback());
+ return base::hash_combine(p.name(), p.language_mode(), p.contextual_mode(),
+ p.feedback());
}
std::ostream& operator<<(std::ostream& os, LoadNamedParameters const& p) {
- return os << Brief(*p.name().handle()) << ", " << p.contextual_mode();
+ return os << Brief(*p.name().handle()) << ", " << p.language_mode() << ", "
+ << p.contextual_mode();
}
std::ostream& operator<<(std::ostream& os, LoadPropertyParameters const& p) {
- // Nothing special to print.
- return os;
+ return os << p.language_mode();
}
bool operator==(LoadPropertyParameters const& lhs,
LoadPropertyParameters const& rhs) {
- return lhs.feedback() == rhs.feedback();
+ return lhs.language_mode() == rhs.language_mode() &&
+ lhs.feedback() == rhs.feedback();
}
@@ -236,7 +239,7 @@ const LoadPropertyParameters& LoadPropertyParametersOf(const Operator* op) {
size_t hash_value(LoadPropertyParameters const& p) {
- return hash_value(p.feedback());
+ return base::hash_combine(p.language_mode(), p.feedback());
}
@@ -459,8 +462,9 @@ const Operator* JSOperatorBuilder::CallConstruct(int arguments) {
const Operator* JSOperatorBuilder::LoadNamed(
const Unique<Name>& name, const ResolvedFeedbackSlot& feedback,
- ContextualMode contextual_mode) {
- LoadNamedParameters parameters(name, feedback, contextual_mode);
+ LanguageMode language_mode, ContextualMode contextual_mode) {
+ LoadNamedParameters parameters(name, feedback, language_mode,
+ contextual_mode);
return new (zone()) Operator1<LoadNamedParameters>( // --
IrOpcode::kJSLoadNamed, Operator::kNoProperties, // opcode
"JSLoadNamed", // name
@@ -470,8 +474,8 @@ const Operator* JSOperatorBuilder::LoadNamed(
const Operator* JSOperatorBuilder::LoadProperty(
- const ResolvedFeedbackSlot& feedback) {
- LoadPropertyParameters parameters(feedback);
+ const ResolvedFeedbackSlot& feedback, LanguageMode language_mode) {
+ LoadPropertyParameters parameters(feedback, language_mode);
return new (zone()) Operator1<LoadPropertyParameters>( // --
IrOpcode::kJSLoadProperty, Operator::kNoProperties, // opcode
"JSLoadProperty", // name
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698