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

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

Issue 2673383002: [ic] Encode LoadGlobalIC's typeof mode in slot kind instead of code object's flags. (Closed)
Patch Set: Addressed comments and added check to FCG 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
« no previous file with comments | « src/ic/x87/handler-compiler-x87.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 9fb47ac8f89af5b5973e0e8e3d2669f16d840ceb..6f506446ec6bd4fbe9f4f7280098bc22d7bdb7f6 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -448,6 +448,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::MoveRegister(Register from,
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(
const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) {
size_t name_index = GetConstantPoolEntry(name);
+ // Ensure that typeof 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(GetTypeofModeFromICKind(feedback_vector_spec()->GetKind(slot)),
+ typeof_mode);
+ }
if (typeof_mode == INSIDE_TYPEOF) {
OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
} else {
« no previous file with comments | « src/ic/x87/handler-compiler-x87.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698