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

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

Issue 1057613003: Code cleanup in GenerateRecordCallTarget. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Slight comment improvement. Created 5 years, 9 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/mips64/code-stubs-mips64.cc ('k') | no next file » | 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 49904297febf74a2e61c0d712fd560c29ffce803..97804508fd4bfd220cbea733231eb454932a6f59 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -1785,7 +1785,7 @@ static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
// edi : the function to call
FrameScope scope(masm, StackFrame::INTERNAL);
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ Integer32ToSmi(rax, rax);
__ Push(rax);
__ Push(rdi);
@@ -1822,17 +1822,19 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if rcx is a WeakCell or a Symbol, but it's harmless to read
+ // at this position in a symbol (see static asserts in
+ // type-feedback-vector.h).
Label check_allocation_site;
__ cmpp(rdi, FieldOperand(rcx, WeakCell::kValueOffset));
__ j(equal, &done, Label::kFar);
__ CompareRoot(rcx, Heap::kmegamorphic_symbolRootIndex);
__ j(equal, &done, Label::kFar);
- __ CompareRoot(FieldOperand(rcx, 0), Heap::kWeakCellMapRootIndex);
+ __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
+ Heap::kWeakCellMapRootIndex);
__ j(not_equal, FLAG_pretenuring_call_new ? &miss : &check_allocation_site);
- // If edi is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic. Otherwise, we
- // need to go megamorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ CheckSmi(FieldOperand(rcx, WeakCell::kValueOffset));
__ j(equal, &initialize);
__ jmp(&megamorphic);
@@ -1842,7 +1844,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in rcx.
+ // AllocationSite.
__ CompareRoot(FieldOperand(rcx, 0), Heap::kAllocationSiteMapRootIndex);
__ j(not_equal, &miss);
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698