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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1476413003: Provide call counts for constructor calls, surface them as a vector IC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 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/type-info.cc ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index a4c772f5ba6c47c6e2b91b9ba454944755729676..25c9336e108fce9e108aed50607d318c5cad5cb6 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -1786,6 +1786,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
Isolate* isolate = masm->isolate();
Label initialize, done, miss, megamorphic, not_array_function,
done_no_smi_convert;
+ Label done_increment_count;
// Load the cache state into r11.
__ SmiToInteger32(rdx, rdx);
@@ -1799,7 +1800,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// type-feedback-vector.h).
Label check_allocation_site;
__ cmpp(rdi, FieldOperand(r11, WeakCell::kValueOffset));
- __ j(equal, &done, Label::kFar);
+ __ j(equal, &done_increment_count, Label::kFar);
__ CompareRoot(r11, Heap::kmegamorphic_symbolRootIndex);
__ j(equal, &done, Label::kFar);
__ CompareRoot(FieldOperand(r11, HeapObject::kMapOffset),
@@ -1823,7 +1824,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11);
__ cmpp(rdi, r11);
__ j(not_equal, &megamorphic);
- __ jmp(&done);
+ __ jmp(&done_increment_count);
__ bind(&miss);
@@ -1842,6 +1843,11 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// indicate the ElementsKind if function is the Array constructor.
__ bind(&initialize);
+ // Initialize the call counter.
+ __ Move(FieldOperand(rbx, rdx, times_pointer_size,
+ FixedArray::kHeaderSize + kPointerSize),
+ Smi::FromInt(ConstructICNexus::kCallCountIncrement));
+
// Make sure the function is the Array() function
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11);
__ cmpp(rdi, r11);
@@ -1856,6 +1862,11 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
CallStubInRecordCallTarget(masm, &weak_cell_stub);
__ jmp(&done_no_smi_convert);
+ __ bind(&done_increment_count);
+ __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size,
+ FixedArray::kHeaderSize + kPointerSize),
+ Smi::FromInt(ConstructICNexus::kCallCountIncrement));
+
__ bind(&done);
__ Integer32ToSmi(rdx, rdx);
@@ -1863,7 +1874,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
}
-void CallConstructStub::Generate(MacroAssembler* masm) {
+void ConstructICStub::Generate(MacroAssembler* masm) {
// rax : number of arguments
// rbx : feedback vector
// rdx : slot in feedback vector (Smi)
« no previous file with comments | « src/type-info.cc ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698