@@ -2083,7 +2083,10 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub(
20832083 Optimized optimized,
20842084 CallType type,
20852085 Exactness exactness) {
2086- GenerateRecordEntryPoint (assembler);
2086+ const bool save_entry_point = kind == Token::kILLEGAL ;
2087+ if (save_entry_point) {
2088+ GenerateRecordEntryPoint (assembler);
2089+ }
20872090
20882091 if (optimized == kOptimized ) {
20892092 GenerateOptimizedUsageCounterIncrement (assembler);
@@ -2205,8 +2208,10 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub(
22052208 __ movq (RAX, FieldAddress (R10, target::ArgumentsDescriptor::count_offset ()));
22062209 __ leaq (RAX, Address (RSP, RAX, TIMES_4, 0 )); // RAX is Smi.
22072210 __ EnterStubFrame ();
2208- __ SmiTag (R8); // Entry-point offset is not Smi.
2209- __ pushq (R8); // Preserve entry point.
2211+ if (save_entry_point) {
2212+ __ SmiTag (R8); // Entry-point offset is not Smi.
2213+ __ pushq (R8); // Preserve entry point.
2214+ }
22102215 __ pushq (R10); // Preserve arguments descriptor array.
22112216 __ pushq (RBX); // Preserve IC data object.
22122217 __ pushq (Immediate (0 )); // Result slot.
@@ -2221,11 +2226,13 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub(
22212226 for (intptr_t i = 0 ; i < num_args + 1 ; i++) {
22222227 __ popq (RAX);
22232228 }
2224- __ popq (RAX); // Pop returned function object into RAX.
2225- __ popq (RBX); // Restore IC data array.
2226- __ popq (R10); // Restore arguments descriptor array.
2227- __ popq (R8); // Restore entry point.
2228- __ SmiUntag (R8); // Entry-point offset is not Smi.
2229+ __ popq (RAX); // Pop returned function object into RAX.
2230+ __ popq (RBX); // Restore IC data array.
2231+ __ popq (R10); // Restore arguments descriptor array.
2232+ if (save_entry_point) {
2233+ __ popq (R8); // Restore entry point.
2234+ __ SmiUntag (R8); // Entry-point offset is not Smi.
2235+ }
22292236 __ RestoreCodePointer ();
22302237 __ LeaveStubFrame ();
22312238 Label call_target_function;
@@ -2277,8 +2284,12 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub(
22772284 __ Bind (&call_target_function);
22782285 // RAX: Target function.
22792286 __ movq (CODE_REG, FieldAddress (RAX, target::Function::code_offset ()));
2280- __ addq (R8, RAX);
2281- __ jmp (Address (R8, 0 ));
2287+ if (save_entry_point) {
2288+ __ addq (R8, RAX);
2289+ __ jmp (Address (R8, 0 ));
2290+ } else {
2291+ __ jmp (FieldAddress (RAX, target::Function::entry_point_offset ()));
2292+ }
22822293
22832294 if (exactness == kCheckExactness ) {
22842295 __ Bind (&call_target_function_through_unchecked_entry);
@@ -2301,11 +2312,15 @@ void StubCodeCompiler::GenerateNArgsCheckInlineCacheStub(
23012312 __ pushq (RDX); // Preserve receiver.
23022313 }
23032314 __ pushq (RBX); // Preserve ICData.
2304- __ SmiTag (R8); // Entry-point offset is not Smi.
2305- __ pushq (R8); // Preserve entry point.
2315+ if (save_entry_point) {
2316+ __ SmiTag (R8); // Entry-point offset is not Smi.
2317+ __ pushq (R8); // Preserve entry point.
2318+ }
23062319 __ CallRuntime (kSingleStepHandlerRuntimeEntry , 0 );
2307- __ popq (R8); // Restore entry point.
2308- __ SmiUntag (R8);
2320+ if (save_entry_point) {
2321+ __ popq (R8); // Restore entry point.
2322+ __ SmiUntag (R8);
2323+ }
23092324 __ popq (RBX); // Restore ICData.
23102325 if (type == kInstanceCall ) {
23112326 __ popq (RDX); // Restore receiver.
0 commit comments