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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 2472653002: [compiler] Sanitize IC counts for vector based ICs. (Closed)
Patch Set: Fix compile. Created 4 years, 1 month 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/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 0e3192868943825853572e2c45d1db9ce234dd5c..e9be01fd3d4502b94237a7d232f77c3d655cd3b4 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -223,20 +223,25 @@ void FullCodeGenerator::PrepareForBailout(Expression* node,
PrepareForBailoutForId(node->id(), state);
}
-void FullCodeGenerator::CallLoadIC(FeedbackVectorSlot slot, Handle<Object> name,
- TypeFeedbackId id) {
+void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) {
+ ic_total_count_++;
+ __ Call(code, RelocInfo::CODE_TARGET, ast_id);
+}
+
+void FullCodeGenerator::CallLoadIC(FeedbackVectorSlot slot,
+ Handle<Object> name) {
DCHECK(name->IsName());
__ Move(LoadDescriptor::NameRegister(), name);
EmitLoadSlot(LoadDescriptor::SlotRegister(), slot);
- Handle<Code> ic = CodeFactory::LoadIC(isolate()).code();
- CallIC(ic, id);
+ Handle<Code> code = CodeFactory::LoadIC(isolate()).code();
+ __ Call(code, RelocInfo::CODE_TARGET);
if (FLAG_tf_load_ic_stub) RestoreContext();
}
void FullCodeGenerator::CallStoreIC(FeedbackVectorSlot slot,
- Handle<Object> name, TypeFeedbackId id) {
+ Handle<Object> name) {
DCHECK(name->IsName());
__ Move(StoreDescriptor::NameRegister(), name);
@@ -249,8 +254,8 @@ void FullCodeGenerator::CallStoreIC(FeedbackVectorSlot slot,
EmitLoadSlot(StoreDescriptor::SlotRegister(), slot);
}
- Handle<Code> ic = CodeFactory::StoreIC(isolate(), language_mode()).code();
- CallIC(ic, id);
+ Handle<Code> code = CodeFactory::StoreIC(isolate(), language_mode()).code();
+ __ Call(code, RelocInfo::CODE_TARGET);
RestoreContext();
}
@@ -264,9 +269,9 @@ void FullCodeGenerator::CallKeyedStoreIC(FeedbackVectorSlot slot) {
EmitLoadSlot(StoreDescriptor::SlotRegister(), slot);
}
- Handle<Code> ic =
+ Handle<Code> code =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
- CallIC(ic);
+ __ Call(code, RelocInfo::CODE_TARGET);
RestoreContext();
}
@@ -503,8 +508,8 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
#endif
EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(),
proxy->VariableFeedbackSlot());
- Handle<Code> ic = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code();
- CallIC(ic);
+ Handle<Code> code = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code();
+ __ Call(code, RelocInfo::CODE_TARGET);
}
void FullCodeGenerator::VisitSloppyBlockFunctionStatement(
@@ -1122,8 +1127,8 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
EmitLoadSlot(LoadDescriptor::SlotRegister(), prop->PropertyFeedbackSlot());
- Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
- CallIC(ic);
+ Handle<Code> code = CodeFactory::KeyedLoadIC(isolate()).code();
+ __ Call(code, RelocInfo::CODE_TARGET);
RestoreContext();
}
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698