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

Unified Diff: src/code-stub-assembler.cc

Issue 2224343002: [interpreter] Collect type feedback in Add, Mul, Div and Mod. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes test-interpreter/InterpreterParameter8. Created 4 years, 4 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/code-stub-assembler.h ('k') | src/code-stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 4479086ed78030baf6af758c894299997090650d..01287b0210861d4208a7a4d16a626e0e0e488fff 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -3217,6 +3217,37 @@ compiler::Node* CodeStubAssembler::LoadTypeFeedbackVectorForStub() {
return LoadObjectField(literals, LiteralsArray::kFeedbackVectorOffset);
}
+void CodeStubAssembler::UpdateFeedback(compiler::Node* feedback,
+ compiler::Node* type_feedback_vector,
+ compiler::Node* slot_id) {
+ Label combine_feedback(this), record_feedback(this), end(this);
+
+ Node* previous_feedback =
+ LoadFixedArrayElement(type_feedback_vector, slot_id);
+ Node* is_uninitialized = WordEqual(
+ previous_feedback,
+ HeapConstant(TypeFeedbackVector::UninitializedSentinel(isolate())));
+ BranchIf(is_uninitialized, &record_feedback, &combine_feedback);
+
+ Bind(&record_feedback);
+ {
+ StoreFixedArrayElement(type_feedback_vector, slot_id, SmiTag(feedback),
+ SKIP_WRITE_BARRIER);
+ Goto(&end);
+ }
+
+ Bind(&combine_feedback);
+ {
+ Node* untagged_previous_feedback = SmiUntag(previous_feedback);
+ Node* combined_feedback = Word32Or(untagged_previous_feedback, feedback);
+ StoreFixedArrayElement(type_feedback_vector, slot_id,
+ SmiTag(combined_feedback), SKIP_WRITE_BARRIER);
+ Goto(&end);
+ }
+
+ Bind(&end);
+}
+
compiler::Node* CodeStubAssembler::LoadReceiverMap(compiler::Node* receiver) {
Variable var_receiver_map(this, MachineRepresentation::kTagged);
// TODO(ishell): defer blocks when it works.
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698