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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 2676583002: [ic] Encode [Keyed]StoreIC's language mode in slot kind instead of code object's flags. (Closed)
Patch Set: Rebasing Created 3 years, 10 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/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 9d77056c5c4215d11a15b200cef858102941aa34..9fb47ac8f89af5b5973e0e8e3d2669f16d840ceb 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -21,6 +21,7 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(
int locals_count, FunctionLiteral* literal,
SourcePositionTableBuilder::RecordingMode source_position_mode)
: zone_(zone),
+ literal_(literal),
bytecode_generated_(false),
constant_array_builder_(zone, isolate->factory()->the_hole_value()),
handler_table_builder_(zone),
@@ -564,6 +565,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty(
Register object, const Handle<Name> name, int feedback_slot,
LanguageMode language_mode) {
size_t name_index = GetConstantPoolEntry(name);
+ // Ensure that language mode is in sync with the IC slot kind if the function
+ // literal is available (not a unit test case).
+ // TODO(ishell): check only in debug mode.
+ if (literal_) {
+ FeedbackVectorSlot slot = TypeFeedbackVector::ToSlot(feedback_slot);
+ CHECK_EQ(GetLanguageModeFromICKind(feedback_vector_spec()->GetKind(slot)),
+ language_mode);
+ }
if (language_mode == SLOPPY) {
OutputStaNamedPropertySloppy(object, name_index, feedback_slot);
} else {
@@ -576,6 +585,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty(
BytecodeArrayBuilder& BytecodeArrayBuilder::StoreKeyedProperty(
Register object, Register key, int feedback_slot,
LanguageMode language_mode) {
+ // Ensure that language mode is in sync with the IC slot kind if the function
+ // literal is available (not a unit test case).
+ // TODO(ishell): check only in debug mode.
+ if (literal_) {
+ FeedbackVectorSlot slot = TypeFeedbackVector::ToSlot(feedback_slot);
+ CHECK_EQ(GetLanguageModeFromICKind(feedback_vector_spec()->GetKind(slot)),
+ language_mode);
+ }
if (language_mode == SLOPPY) {
OutputStaKeyedPropertySloppy(object, key, feedback_slot);
} else {

Powered by Google App Engine
This is Rietveld 408576698