@@ -332,31 +332,30 @@ void TurboAssembler::LoadCodeObjectEntry(Register destination,
332332
333333 if (options ().isolate_independent_code ) {
334334 DCHECK (root_array_available ());
335- Label if_code_is_builtin , out;
335+ Label if_code_is_off_heap , out;
336336
337337 UseScratchRegisterScope temps (this );
338338 Register scratch = temps.Acquire ();
339339
340340 DCHECK (!AreAliased (destination, scratch));
341341 DCHECK (!AreAliased (code_object, scratch));
342342
343- // Check whether the Code object is a builtin. If so, call its (off-heap)
344- // entry point directly without going through the (on-heap) trampoline.
345- // Otherwise, just call the Code object as always.
343+ // Check whether the Code object is an off-heap trampoline. If so, call its
344+ // (off-heap) entry point directly without going through the (on-heap)
345+ // trampoline. Otherwise, just call the Code object as always.
346+ ldr (scratch, FieldMemOperand (code_object, Code::kFlagsOffset ));
347+ tst (scratch, Operand (Code::IsOffHeapTrampoline::kMask ));
348+ b (ne, &if_code_is_off_heap);
346349
347- ldr (scratch, FieldMemOperand (code_object, Code::kBuiltinIndexOffset ));
348- cmp (scratch, Operand (Builtins::kNoBuiltinId ));
349- b (ne, &if_code_is_builtin);
350-
351- // A non-builtin Code object, the entry point is at
350+ // Not an off-heap trampoline, the entry point is at
352351 // Code::raw_instruction_start().
353352 add (destination, code_object, Operand (Code::kHeaderSize - kHeapObjectTag ));
354353 jmp (&out);
355354
356- // A builtin Code object , the entry point is loaded from the builtin entry
355+ // An off-heap trampoline , the entry point is loaded from the builtin entry
357356 // table.
358- // The builtin index is loaded in scratch.
359- bind (&if_code_is_builtin );
357+ bind (&if_code_is_off_heap);
358+ ldr (scratch, FieldMemOperand (code_object, Code:: kBuiltinIndexOffset ) );
360359 lsl (destination, scratch, Operand (kSystemPointerSizeLog2 ));
361360 add (destination, destination, kRootRegister );
362361 ldr (destination,
0 commit comments