Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 9cf02fafd9473b5fd0f7d7ed23fa3bf524a573bf..eea27161b9dd878633d905278882b5c2285e14ff 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -2267,7 +2267,8 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
void CallFunctionStub::Generate(MacroAssembler* masm) { |
// rbx : feedback vector |
- // rdx : (only if rbx is not undefined) slot in feedback vector (Smi) |
+ // rdx : (only if rbx is not the megamorphic symbol) slot in feedback |
+ // vector (Smi) |
// rdi : the function to call |
Isolate* isolate = masm->isolate(); |
Label slow, non_function, wrap, cont; |
@@ -2327,7 +2328,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
if (RecordCallTarget()) { |
// If there is a call target cache, mark it megamorphic in the |
// non-function case. MegamorphicSentinel is an immortal immovable |
- // object (undefined) so no write barrier is needed. |
+ // object (megamorphic symbol) so no write barrier is needed. |
__ SmiToInteger32(rdx, rdx); |
__ Move(FieldOperand(rbx, rdx, times_pointer_size, |
FixedArray::kHeaderSize), |
@@ -2379,7 +2380,8 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
void CallConstructStub::Generate(MacroAssembler* masm) { |
// rax : number of arguments |
// rbx : feedback vector |
- // rdx : (only if rbx is not undefined) slot in feedback vector (Smi) |
+ // rdx : (only if rbx is not the megamorphic symbol) slot in feedback |
+ // vector (Smi) |
// rdi : constructor function |
Label slow, non_function_call; |
@@ -5003,15 +5005,14 @@ void ArrayConstructorStub::GenerateDispatchToArrayStub( |
void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
// -- rax : argc |
- // -- rbx : feedback vector (fixed array or undefined) |
+ // -- rbx : feedback vector (fixed array or megamorphic symbol) |
// -- rdx : slot index (if ebx is fixed array) |
// -- rdi : constructor |
// -- rsp[0] : return address |
// -- rsp[8] : last argument |
// ----------------------------------- |
- Handle<Object> undefined_sentinel( |
- masm->isolate()->heap()->undefined_value(), |
- masm->isolate()); |
+ Handle<Object> megamorphic_sentinel = |
+ TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); |
if (FLAG_debug_code) { |
// The array construct code is only set for the global and natives |
@@ -5026,24 +5027,26 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
__ CmpObjectType(rcx, MAP_TYPE, rcx); |
__ Check(equal, kUnexpectedInitialMapForArrayFunction); |
- // We should either have undefined in rbx or a valid fixed array. |
+ // We should either have the megamorphic symbol in rbx or a valid |
+ // fixed array. |
Label okay_here; |
Handle<Map> fixed_array_map = masm->isolate()->factory()->fixed_array_map(); |
- __ Cmp(rbx, undefined_sentinel); |
+ __ Cmp(rbx, megamorphic_sentinel); |
__ j(equal, &okay_here); |
__ Cmp(FieldOperand(rbx, 0), fixed_array_map); |
__ Assert(equal, kExpectedFixedArrayInRegisterRbx); |
- // rdx should be a smi if we don't have undefined in rbx. |
+ // rdx should be a smi if we don't have the megamorphic symbol in rbx. |
__ AssertSmi(rdx); |
__ bind(&okay_here); |
} |
Label no_info; |
- // If the feedback slot is undefined, or contains anything other than an |
- // AllocationSite, call an array constructor that doesn't use AllocationSites. |
- __ Cmp(rbx, undefined_sentinel); |
+ // If the feedback slot is the megamorphic sentinel, or contains anything |
+ // other than an AllocationSite, call an array constructor that doesn't use |
+ // AllocationSites. |
+ __ Cmp(rbx, megamorphic_sentinel); |
__ j(equal, &no_info); |
__ SmiToInteger32(rdx, rdx); |
__ movp(rbx, FieldOperand(rbx, rdx, times_pointer_size, |