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

Unified Diff: src/mips/code-stubs-mips.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/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index f0314e4d843dfa97dcffb003fe21112928064333..ca9a5fb623ead7ae0394c9673b33ce265ea43f84 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -2515,7 +2515,7 @@ static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
1 << 6 | // a2
1 << 7; // a3
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(a0);
__ MultiPush(kSavedRegs);
@@ -2548,6 +2548,8 @@ 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 t0 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;
Register feedback_map = t1;
Register weak_value = t4;
@@ -2555,13 +2557,12 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ Branch(&done, eq, a1, Operand(weak_value));
__ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
__ Branch(&done, eq, t0, Operand(at));
- __ lw(feedback_map, FieldMemOperand(t0, 0));
+ __ lw(feedback_map, FieldMemOperand(t0, Heap::kMapOffset));
__ LoadRoot(at, Heap::kWeakCellMapRootIndex);
__ Branch(FLAG_pretenuring_call_new ? &miss : &check_allocation_site, ne,
feedback_map, Operand(at));
- // If a1 is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ JumpIfSmi(weak_value, &initialize);
__ jmp(&megamorphic);
@@ -2570,7 +2571,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 a3.
+ // AllocationSite.
__ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
__ Branch(&miss, ne, feedback_map, Operand(at));
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698