V8 Project
v8::internal::Code Class Reference

#include <objects.h>

+ Inheritance diagram for v8::internal::Code:
+ Collaboration diagram for v8::internal::Code:

Classes

class  AllowOSRAtLoopNestingLevelField
 
class  BackEdgeTableOffsetField
 
class  CacheHolderField
 
class  ExtraICStateField
 
class  FindAndReplacePattern
 
class  FullCodeFlagsHasDebugBreakSlotsField
 
class  FullCodeFlagsHasDeoptimizationSupportField
 
class  FullCodeFlagsIsCompiledOptimizable
 
class  HasFunctionCacheField
 
class  ICStateField
 
class  InvalidatedWeakStubField
 
class  IsCrankshaftedField
 
class  IsTurbofannedField
 
class  KindField
 
class  MarkedForDeoptimizationField
 
class  SafepointTableOffsetField
 
class  StackSlotsField
 
class  TypeField
 
class  WeakStubField
 

Public Types

enum  Kind { NUMBER_OF_KINDS }
 
enum  StubType { NORMAL , FAST }
 
enum  Age {
  kNotExecutedCodeAge = -2 , kExecutedOnceCodeAge = -1 , kNoAgeCodeAge = 0 , kAfterLastCodeAge ,
  kFirstCodeAge = kNotExecutedCodeAge , kLastCodeAge = kAfterLastCodeAge - 1 , kCodeAgeCount = kAfterLastCodeAge - kNotExecutedCodeAge - 1 , kIsOldCodeAge = kSexagenarianCodeAge ,
  kPreAgedCodeAge = kIsOldCodeAge - 1
}
 
typedef uint32_t Flags
 
- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 

Public Member Functions

 STATIC_ASSERT (NUMBER_OF_KINDS<=16)
 
int instruction_size () const
 
void set_instruction_size (int value)
 
void InvalidateRelocation ()
 
void InvalidateEmbeddedObjects ()
 
Objecttype_feedback_info ()
 
void set_type_feedback_info (Object *value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
uint32_t stub_key ()
 
void set_stub_key (uint32_t key)
 
void set_ic_age (int count)
 
int ic_age () const
 
int prologue_offset () const
 
void set_prologue_offset (int offset)
 
ByteArrayunchecked_relocation_info ()
 
int relocation_size ()
 
Flags flags ()
 
void set_flags (Flags flags)
 
Kind kind ()
 
InlineCacheState ic_state ()
 
ExtraICState extra_ic_state ()
 
StubType type ()
 
bool is_inline_cache_stub ()
 
bool is_debug_stub ()
 
bool is_handler ()
 
bool is_load_stub ()
 
bool is_keyed_load_stub ()
 
bool is_store_stub ()
 
bool is_keyed_store_stub ()
 
bool is_call_stub ()
 
bool is_binary_op_stub ()
 
bool is_compare_ic_stub ()
 
bool is_compare_nil_ic_stub ()
 
bool is_to_boolean_ic_stub ()
 
bool is_keyed_stub ()
 
bool is_optimized_code ()
 
bool is_weak_stub ()
 
void mark_as_weak_stub ()
 
bool is_invalidated_weak_stub ()
 
void mark_as_invalidated_weak_stub ()
 
bool CanBeWeakStub ()
 
bool IsCodeStubOrIC ()
 
void set_raw_kind_specific_flags1 (int value)
 
void set_raw_kind_specific_flags2 (int value)
 
bool is_crankshafted ()
 
bool is_hydrogen_stub ()
 
void set_is_crankshafted (bool value)
 
bool is_turbofanned ()
 
void set_is_turbofanned (bool value)
 
bool optimizable ()
 
void set_optimizable (bool value)
 
bool has_deoptimization_support ()
 
void set_has_deoptimization_support (bool value)
 
bool has_debug_break_slots ()
 
void set_has_debug_break_slots (bool value)
 
bool is_compiled_optimizable ()
 
void set_compiled_optimizable (bool value)
 
void set_allow_osr_at_loop_nesting_level (int level)
 
int allow_osr_at_loop_nesting_level ()
 
int profiler_ticks ()
 
void set_profiler_ticks (int ticks)
 
int builtin_index ()
 
void set_builtin_index (int id)
 
unsigned stack_slots ()
 
void set_stack_slots (unsigned slots)
 
unsigned safepoint_table_offset ()
 
void set_safepoint_table_offset (unsigned offset)
 
unsigned back_edge_table_offset ()
 
void set_back_edge_table_offset (unsigned offset)
 
bool back_edges_patched_for_osr ()
 
byte to_boolean_state ()
 
bool has_function_cache ()
 
void set_has_function_cache (bool flag)
 
bool marked_for_deoptimization ()
 
void set_marked_for_deoptimization (bool flag)
 
ConstantPoolArrayconstant_pool ()
 
void set_constant_pool (Object *constant_pool)
 
SafepointEntry GetSafepointEntry (Address pc)
 
ObjectFindNthObject (int n, Map *match_map)
 
AllocationSiteFindFirstAllocationSite ()
 
MapFindFirstMap ()
 
void FindAllMaps (MapHandleList *maps)
 
CodeFindFirstHandler ()
 
bool FindHandlers (CodeHandleList *code_list, int length=-1)
 
MaybeHandle< CodeFindHandlerForMap (Map *map)
 
NameFindFirstName ()
 
void FindAndReplace (const FindAndReplacePattern &pattern)
 
void WipeOutHeader ()
 
byteinstruction_start ()
 
byteinstruction_end ()
 
int body_size ()
 
byterelocation_start ()
 
byteentry ()
 
bool contains (byte *pc)
 
void Relocate (intptr_t delta)
 
void CopyFrom (const CodeDesc &desc)
 
int ExecutableSize ()
 
int SourcePosition (Address pc)
 
int SourceStatementPosition (Address pc)
 
int CodeSize ()
 
void CodeIterateBody (ObjectVisitor *v)
 
template<typename StaticVisitor >
void CodeIterateBody (Heap *heap)
 
void ClearInlineCaches ()
 
void ClearInlineCaches (Kind kind)
 
BailoutId TranslatePcOffsetToAstId (uint32_t pc_offset)
 
uint32_t TranslateAstIdToPcOffset (BailoutId ast_id)
 
void MakeOlder (MarkingParity)
 
bool IsOld ()
 
Age GetAge ()
 
Age GetRawAge ()
 
void PrintDeoptLocation (FILE *out, int bailout_id)
 
bool CanDeoptAt (Address pc)
 
bool CanContainWeakObjects ()
 
bool IsWeakObject (Object *object)
 
 STATIC_ASSERT (kStackSlotsFirstBit+kStackSlotsBitCount<=32)
 
 STATIC_ASSERT (kIsTurbofannedBit+1<=32)
 
 STATIC_ASSERT (kSafepointTableOffsetFirstBit+kSafepointTableOffsetBitCount<=32)
 
 STATIC_ASSERT (1+kSafepointTableOffsetBitCount<=32)
 
 STATIC_ASSERT (AllowOSRAtLoopNestingLevelField::kMax >=kMaxLoopNestingMarker)
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static const char * Kind2String (Kind kind)
 
static Flags ComputeFlags (Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
 
static Flags ComputeMonomorphicFlags (Kind kind, ExtraICState extra_ic_state=kNoExtraICState, CacheHolderFlag holder=kCacheOnReceiver, StubType type=NORMAL)
 
static Flags ComputeHandlerFlags (Kind handler_kind, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
 
static InlineCacheState ExtractICStateFromFlags (Flags flags)
 
static StubType ExtractTypeFromFlags (Flags flags)
 
static CacheHolderFlag ExtractCacheHolderFromFlags (Flags flags)
 
static Kind ExtractKindFromFlags (Flags flags)
 
static ExtraICState ExtractExtraICStateFromFlags (Flags flags)
 
static Flags RemoveTypeFromFlags (Flags flags)
 
static Flags RemoveTypeAndHolderFromFlags (Flags flags)
 
static CodeGetCodeFromTargetAddress (Address address)
 
static ObjectGetObjectFromEntryAddress (Address location_of_address)
 
static int SizeFor (int body_size)
 
static void MakeCodeAgeSequenceYoung (byte *sequence, Isolate *isolate)
 
static void MarkCodeAsExecuted (byte *sequence, Isolate *isolate)
 
static bool IsYoungSequence (Isolate *isolate, byte *sequence)
 
static CodeGetPreAgedCodeAgeStub (Isolate *isolate)
 
static bool IsWeakObjectInOptimizedCode (Object *object)
 
static bool IsWeakObjectInIC (Object *object)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 

Static Public Attributes

static const int kPrologueOffsetNotSet = -1
 
static const int kMaxLoopNestingMarker = 6
 
static const int kInstructionSizeOffset = HeapObject::kHeaderSize
 
static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize
 
static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize
 
static const int kDeoptimizationDataOffset
 
static const int kTypeFeedbackInfoOffset
 
static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize
 
static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize
 
static const int kICAgeOffset
 
static const int kFlagsOffset = kICAgeOffset + kIntSize
 
static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize
 
static const int kKindSpecificFlags2Offset
 
static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize
 
static const int kConstantPoolOffset = kPrologueOffset + kPointerSize
 
static const int kHeaderPaddingStart = kConstantPoolOffset + kIntSize
 
static const int kHeaderSize
 
static const int kOptimizableOffset = kKindSpecificFlags1Offset
 
static const int kFullCodeFlags = kOptimizableOffset + 1
 
static const int kProfilerTicksOffset = kFullCodeFlags + 1
 
static const int kStackSlotsFirstBit = 0
 
static const int kStackSlotsBitCount = 24
 
static const int kHasFunctionCacheBit
 
static const int kMarkedForDeoptimizationBit = kHasFunctionCacheBit + 1
 
static const int kWeakStubBit = kMarkedForDeoptimizationBit + 1
 
static const int kInvalidatedWeakStubBit = kWeakStubBit + 1
 
static const int kIsTurbofannedBit = kInvalidatedWeakStubBit + 1
 
static const int kIsCrankshaftedBit = 0
 
static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1
 
static const int kSafepointTableOffsetBitCount = 24
 
static const int kArgumentsBits = 16
 
static const int kMaxArguments = (1 << kArgumentsBits) - 1
 
static const int kFlagsNotUsedInLookup
 
- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 

Private Member Functions

void ClearInlineCaches (Kind *kind)
 
byteFindCodeAgeSequence ()
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (Code)
 

Static Private Member Functions

static void GetCodeAgeAndParity (Code *code, Age *age, MarkingParity *parity)
 
static void GetCodeAgeAndParity (Isolate *isolate, byte *sequence, Age *age, MarkingParity *parity)
 
static CodeGetCodeAgeStub (Isolate *isolate, Age age, MarkingParity parity)
 
static void PatchPlatformCodeAge (Isolate *isolate, byte *sequence, Age age, MarkingParity parity)
 

Friends

class RelocIterator
 
class Deoptimizer
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 

Detailed Description

Definition at line 4925 of file objects.h.

Member Typedef Documentation

◆ Flags

Definition at line 4929 of file objects.h.

Member Enumeration Documentation

◆ Age

Enumerator
kNotExecutedCodeAge 
kExecutedOnceCodeAge 
kNoAgeCodeAge 
kAfterLastCodeAge 
kFirstCodeAge 
kLastCodeAge 
kCodeAgeCount 
kIsOldCodeAge 
kPreAgedCodeAge 

Definition at line 5293 of file objects.h.

5293  {
5294  kNotExecutedCodeAge = -2,
5295  kExecutedOnceCodeAge = -1,
5296  kNoAgeCodeAge = 0,
5302  kIsOldCodeAge = kSexagenarianCodeAge,
5304  };
#define CODE_AGE_LIST(V)
Definition: builtins.h:27
#define DECLARE_CODE_AGE_ENUM(X)
Definition: objects.h:5292

◆ Kind

Enumerator
NUMBER_OF_KINDS 

Definition at line 4954 of file objects.h.

4954  {
4955 #define DEFINE_CODE_KIND_ENUM(name) name,
4957 #undef DEFINE_CODE_KIND_ENUM
4959  };
#define DEFINE_CODE_KIND_ENUM(name)
Definition: objects.h:4955
#define CODE_KIND_LIST(V)
Definition: objects.h:4950

◆ StubType

Enumerator
NORMAL 
FAST 

Definition at line 4968 of file objects.h.

4968  {
4969  NORMAL,
4970  FAST
4971  };

Member Function Documentation

◆ allow_osr_at_loop_nesting_level()

int v8::internal::Code::allow_osr_at_loop_nesting_level ( )
inline

Definition at line 4759 of file objects-inl.h.

4759  {
4760  DCHECK_EQ(FUNCTION, kind());
4761  int fields = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
4763 }
static T decode(U value)
Definition: utils.h:228
static const int kKindSpecificFlags2Offset
Definition: objects.h:5363
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206
#define READ_UINT32_FIELD(p, offset)
Definition: objects-inl.h:1272

References DCHECK_EQ, v8::internal::BitFieldBase< T, shift, size, U >::decode(), kind(), kKindSpecificFlags2Offset, and READ_UINT32_FIELD.

Referenced by back_edges_patched_for_osr(), v8::internal::BackEdgeTable::Patch(), and v8::internal::BackEdgeTable::Revert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ back_edge_table_offset()

unsigned v8::internal::Code::back_edge_table_offset ( )
inline

Definition at line 4834 of file objects-inl.h.

4834  {
4835  DCHECK_EQ(FUNCTION, kind());
4838 }
const int kPointerSizeLog2
Definition: globals.h:147

References DCHECK_EQ, v8::internal::BitFieldBase< T, shift, size, U >::decode(), kind(), kKindSpecificFlags2Offset, v8::internal::kPointerSizeLog2, and READ_UINT32_FIELD.

Referenced by v8::internal::BackEdgeTable::BackEdgeTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ back_edges_patched_for_osr()

bool v8::internal::Code::back_edges_patched_for_osr ( )
inline

Definition at line 4851 of file objects-inl.h.

4851  {
4852  DCHECK_EQ(FUNCTION, kind());
4853  return allow_osr_at_loop_nesting_level() > 0;
4854 }
int allow_osr_at_loop_nesting_level()
Definition: objects-inl.h:4759

References allow_osr_at_loop_nesting_level(), DCHECK_EQ, and kind().

+ Here is the call graph for this function:

◆ body_size()

int v8::internal::Code::body_size ( )
inline

Definition at line 6186 of file objects-inl.h.

6186  {
6188 }
int instruction_size() const
const intptr_t kObjectAlignment
Definition: globals.h:226
static void RoundUp(Vector< char > buffer, int *length, int *decimal_point)
Definition: fixed-dtoa.cc:171

References instruction_size(), v8::internal::kObjectAlignment, and v8::internal::RoundUp().

+ Here is the call graph for this function:

◆ builtin_index()

int v8::internal::Code::builtin_index ( )
inline

Definition at line 4789 of file objects-inl.h.

4789  {
4790  DCHECK_EQ(BUILTIN, kind());
4792 }
static const int kKindSpecificFlags1Offset
Definition: objects.h:5362
#define READ_INT32_FIELD(p, offset)
Definition: objects-inl.h:1278

References v8::internal::BUILTIN, DCHECK_EQ, kind(), kKindSpecificFlags1Offset, and READ_INT32_FIELD.

Referenced by v8::internal::CodeSerializer::SerializeBuiltin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanBeWeakStub()

bool v8::internal::Code::CanBeWeakStub ( )
inline

Definition at line 5065 of file objects.h.

5065  {
5066  Kind k = kind();
5067  return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC ||
5068  k == KEYED_STORE_IC || k == COMPARE_NIL_IC) &&
5069  ic_state() == MONOMORPHIC;
5070  }
InlineCacheState ic_state()
Definition: objects-inl.h:4635

References v8::internal::MONOMORPHIC.

Referenced by is_weak_stub(), and mark_as_weak_stub().

+ Here is the caller graph for this function:

◆ CanContainWeakObjects()

bool v8::internal::Code::CanContainWeakObjects ( )
inline

Definition at line 5331 of file objects.h.

5331  {
5332  return is_optimized_code() || is_weak_stub();
5333  }
bool is_optimized_code()
Definition: objects.h:5059

◆ CanDeoptAt()

bool v8::internal::Code::CanDeoptAt ( Address  pc)

Definition at line 10613 of file objects.cc.

10613  {
10614  DeoptimizationInputData* deopt_data =
10615  DeoptimizationInputData::cast(deoptimization_data());
10616  Address code_start_address = instruction_start();
10617  for (int i = 0; i < deopt_data->DeoptCount(); i++) {
10618  if (deopt_data->Pc(i)->value() == -1) continue;
10619  Address address = code_start_address + deopt_data->Pc(i)->value();
10620  if (address == pc) return true;
10621  }
10622  return false;
10623 }
byte * instruction_start()
Definition: objects-inl.h:6176
const Register pc
byte * Address
Definition: globals.h:101

References v8::internal::HeapObject::address(), v8::internal::DeoptimizationInputData::DeoptCount(), instruction_start(), and v8::internal::pc.

Referenced by v8::internal::MarkCompactCollector::ProcessTopOptimizedFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearInlineCaches() [1/3]

void v8::internal::Code::ClearInlineCaches ( )

Definition at line 10377 of file objects.cc.

10377  {
10379 }
void ClearInlineCaches()
Definition: objects.cc:10377
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References NULL.

Referenced by v8::internal::Heap::ClearAllICsByKind(), ClearInlineCaches(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the caller graph for this function:

◆ ClearInlineCaches() [2/3]

void v8::internal::Code::ClearInlineCaches ( Code::Kind kind)
private

Definition at line 10387 of file objects.cc.

10387  {
10391  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10392  RelocInfo* info = it.rinfo();
10393  Code* target(Code::GetCodeFromTargetAddress(info->target_address()));
10394  if (target->is_inline_cache_stub()) {
10395  if (kind == NULL || *kind == target->kind()) {
10396  IC::Clear(this->GetIsolate(), info->pc(),
10397  info->host()->constant_pool());
10398  }
10399  }
10400  }
10401 }
static Code * GetCodeFromTargetAddress(Address address)
Definition: objects-inl.h:5018
friend class RelocIterator
Definition: objects.h:5452
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
static void Clear(Isolate *isolate, Address address, ConstantPoolArray *constant_pool)
Definition: ic.cc:478
static int ModeMask(Mode mode)
Definition: assembler.h:445

References v8::internal::IC::Clear(), v8::internal::RelocInfo::CODE_TARGET, v8::internal::RelocInfo::CODE_TARGET_WITH_ID, constant_pool(), v8::internal::RelocInfo::CONSTRUCT_CALL, v8::internal::RelocIterator::done(), GetCodeFromTargetAddress(), v8::internal::HeapObject::GetIsolate(), v8::internal::RelocInfo::host(), is_inline_cache_stub(), kind(), v8::internal::RelocInfo::ModeMask(), NULL, and v8::internal::RelocInfo::pc().

+ Here is the call graph for this function:

◆ ClearInlineCaches() [3/3]

void v8::internal::Code::ClearInlineCaches ( Code::Kind  kind)

Definition at line 10382 of file objects.cc.

10382  {
10384 }

References ClearInlineCaches(), and kind().

+ Here is the call graph for this function:

◆ CodeIterateBody() [1/2]

template<typename StaticVisitor >
void v8::internal::Code::CodeIterateBody ( Heap heap)
inline

Definition at line 898 of file objects-visiting-inl.h.

898  {
899  int mode_mask = RelocInfo::kCodeTargetMask |
906 
907  // There are two places where we iterate code bodies: here and the non-
908  // templated CodeIterateBody (above). They should be kept in sync.
909  StaticVisitor::VisitPointer(
910  heap,
911  reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset));
912  StaticVisitor::VisitPointer(
913  heap, reinterpret_cast<Object**>(this->address() + kHandlerTableOffset));
914  StaticVisitor::VisitPointer(
915  heap,
916  reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset));
917  StaticVisitor::VisitPointer(
918  heap,
919  reinterpret_cast<Object**>(this->address() + kTypeFeedbackInfoOffset));
920  StaticVisitor::VisitNextCodeLink(
921  heap, reinterpret_cast<Object**>(this->address() + kNextCodeLinkOffset));
922  StaticVisitor::VisitPointer(
923  heap, reinterpret_cast<Object**>(this->address() + kConstantPoolOffset));
924 
925 
926  RelocIterator it(this, mode_mask);
927  for (; !it.done(); it.next()) {
928  it.rinfo()->template Visit<StaticVisitor>(heap);
929  }
930 }
static const int kNextCodeLinkOffset
Definition: objects.h:5357
static const int kConstantPoolOffset
Definition: objects.h:5367
static const int kTypeFeedbackInfoOffset
Definition: objects.h:5355
static const int kHandlerTableOffset
Definition: objects.h:5351
static const int kRelocationInfoOffset
Definition: objects.h:5350
static const int kDeoptimizationDataOffset
Definition: objects.h:5352
static const int kCodeTargetMask
Definition: assembler.h:587
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::HeapObject::address(), v8::internal::RelocInfo::CELL, v8::internal::RelocInfo::DEBUG_BREAK_SLOT, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::RelocInfo::EXTERNAL_REFERENCE, v8::internal::RelocInfo::JS_RETURN, v8::internal::RelocInfo::kCodeTargetMask, kConstantPoolOffset, kDeoptimizationDataOffset, kHandlerTableOffset, kNextCodeLinkOffset, kRelocationInfoOffset, kTypeFeedbackInfoOffset, v8::internal::RelocInfo::ModeMask(), v8::internal::RelocIterator::next(), v8::internal::RelocIterator::rinfo(), and v8::internal::RelocInfo::RUNTIME_ENTRY.

+ Here is the call graph for this function:

◆ CodeIterateBody() [2/2]

void v8::internal::Code::CodeIterateBody ( ObjectVisitor v)
inline

Definition at line 871 of file objects-visiting-inl.h.

871  {
872  int mode_mask = RelocInfo::kCodeTargetMask |
879 
880  // There are two places where we iterate code bodies: here and the
881  // templated CodeIterateBody (below). They should be kept in sync.
888 
889  RelocIterator it(this, mode_mask);
890  Isolate* isolate = this->GetIsolate();
891  for (; !it.done(); it.next()) {
892  it.rinfo()->Visit(isolate, v);
893  }
894 }
void IterateNextCodeLink(ObjectVisitor *v, int offset)
Definition: objects-inl.h:1510
void IteratePointer(ObjectVisitor *v, int offset)
Definition: objects-inl.h:1505

References v8::internal::RelocInfo::CELL, v8::internal::RelocInfo::DEBUG_BREAK_SLOT, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::RelocInfo::EXTERNAL_REFERENCE, v8::internal::HeapObject::GetIsolate(), v8::internal::HeapObject::IterateNextCodeLink(), v8::internal::HeapObject::IteratePointer(), v8::internal::RelocInfo::JS_RETURN, v8::internal::RelocInfo::kCodeTargetMask, kConstantPoolOffset, kDeoptimizationDataOffset, kHandlerTableOffset, kNextCodeLinkOffset, kRelocationInfoOffset, kTypeFeedbackInfoOffset, v8::internal::RelocInfo::ModeMask(), v8::internal::RelocIterator::next(), v8::internal::RelocIterator::rinfo(), v8::internal::RelocInfo::RUNTIME_ENTRY, and v8::internal::RelocInfo::Visit().

Referenced by v8::internal::MarkCompactCollector::ProcessTopOptimizedFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CodeSize()

int v8::internal::Code::CodeSize ( )
inline

Definition at line 5277 of file objects.h.

5277 { return SizeFor(body_size()); }
static int SizeFor(int body_size)
Definition: objects.h:5256

Referenced by v8::internal::Logger::CodeDeoptEvent(), and v8::internal::RuntimeProfiler::OptimizeNow().

+ Here is the caller graph for this function:

◆ ComputeFlags()

Code::Flags v8::internal::Code::ComputeFlags ( Kind  kind,
InlineCacheState  ic_state = UNINITIALIZED,
ExtraICState  extra_ic_state = kNoExtraICState,
StubType  type = NORMAL,
CacheHolderFlag  holder = kCacheOnReceiver 
)
inlinestatic

Definition at line 4954 of file objects-inl.h.

4956  {
4957  // Compute the bit mask.
4958  unsigned int bits = KindField::encode(kind)
4962  | CacheHolderField::encode(holder);
4963  return static_cast<Flags>(bits);
4964 }
static U encode(T value)
Definition: utils.h:217
ExtraICState extra_ic_state()
Definition: objects-inl.h:4647
uint32_t Flags
Definition: objects.h:4929

References v8::internal::BitFieldBase< T, shift, size, U >::encode(), extra_ic_state(), ic_state(), kind(), and type().

Referenced by ComputeHandlerFlags(), v8::internal::PropertyICCompiler::ComputeKeyedLoadPolymorphic(), v8::internal::PropertyICCompiler::ComputeKeyedStorePolymorphic(), v8::internal::PropertyICCompiler::ComputeLoad(), ComputeMonomorphicFlags(), v8::internal::PropertyICCompiler::ComputeStore(), v8::internal::CompareICStub::FindCodeInSpecialCache(), v8::internal::PropertyICCompiler::FindPreMonomorphic(), v8::internal::CompilationInfo::flags(), v8::internal::PlatformCodeStub::GenerateCode(), v8::internal::HydrogenCodeStub::GenerateLightweightMissCode(), v8::internal::PropertyICCompiler::GetCode(), and v8::internal::FullCodeGenerator::MakeCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeHandlerFlags()

Code::Flags v8::internal::Code::ComputeHandlerFlags ( Kind  handler_kind,
StubType  type = NORMAL,
CacheHolderFlag  holder = kCacheOnReceiver 
)
inlinestatic

Definition at line 4975 of file objects-inl.h.

4976  {
4977  return ComputeFlags(Code::HANDLER, MONOMORPHIC, handler_kind, type, holder);
4978 }
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
Definition: objects-inl.h:4954

References ComputeFlags(), v8::internal::MONOMORPHIC, and type().

Referenced by v8::internal::TypeFeedbackOracle::AssignmentReceiverTypes(), v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub(), v8::internal::PropertyHandlerCompiler::Find(), v8::internal::PropertyHandlerCompiler::GetCode(), and v8::internal::TypeFeedbackOracle::PropertyReceiverTypes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeMonomorphicFlags()

Code::Flags v8::internal::Code::ComputeMonomorphicFlags ( Kind  kind,
ExtraICState  extra_ic_state = kNoExtraICState,
CacheHolderFlag  holder = kCacheOnReceiver,
StubType  type = NORMAL 
)
inlinestatic

Definition at line 4967 of file objects-inl.h.

4970  {
4971  return ComputeFlags(kind, MONOMORPHIC, extra_ic_state, type, holder);
4972 }

References ComputeFlags(), extra_ic_state(), kind(), v8::internal::MONOMORPHIC, and type().

Referenced by v8::internal::PropertyICCompiler::ComputeKeyedLoadMonomorphic(), v8::internal::PropertyICCompiler::ComputeKeyedStoreMonomorphic(), and v8::internal::PropertyICCompiler::Find().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ constant_pool()

◆ contains()

bool v8::internal::Code::contains ( byte pc)
inline

Definition at line 6211 of file objects-inl.h.

6211  {
6212  return (address() <= inner_pointer) && (inner_pointer <= address() + Size());
6213 }

References v8::internal::HeapObject::address(), and v8::internal::HeapObject::Size().

Referenced by v8::internal::Deoptimizer::FindDeoptimizingCode(), v8::internal::Deoptimizer::FindOptimizedCode(), v8::internal::OptimizedFrame::GetDeoptimizationData(), v8::internal::Builtins::Lookup(), v8::internal::StubFailureTrampolineFrame::unchecked_code(), and v8::internal::ActivationsFinder::VisitFrames().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CopyFrom()

void v8::internal::Code::CopyFrom ( const CodeDesc desc)

Definition at line 10134 of file objects.cc.

10134  {
10135  DCHECK(Marking::Color(this) == Marking::WHITE_OBJECT);
10136 
10137  // copy code
10138  CopyBytes(instruction_start(), desc.buffer,
10139  static_cast<size_t>(desc.instr_size));
10140 
10141  // copy reloc info
10143  desc.buffer + desc.buffer_size - desc.reloc_size,
10144  static_cast<size_t>(desc.reloc_size));
10145 
10146  // unbox handles and relocate
10147  intptr_t delta = instruction_start() - desc.buffer;
10148  int mode_mask = RelocInfo::kCodeTargetMask |
10153  // Needed to find target_object and runtime_entry on X64
10154  Assembler* origin = desc.origin;
10155  AllowDeferredHandleDereference embedding_raw_address;
10156  for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
10157  RelocInfo::Mode mode = it.rinfo()->rmode();
10159  Handle<Object> p = it.rinfo()->target_object_handle(origin);
10160  it.rinfo()->set_target_object(*p, SKIP_WRITE_BARRIER, SKIP_ICACHE_FLUSH);
10161  } else if (mode == RelocInfo::CELL) {
10162  Handle<Cell> cell = it.rinfo()->target_cell_handle();
10163  it.rinfo()->set_target_cell(*cell, SKIP_WRITE_BARRIER, SKIP_ICACHE_FLUSH);
10164  } else if (RelocInfo::IsCodeTarget(mode)) {
10165  // rewrite code handles in inline cache targets to direct
10166  // pointers to the first instruction in the code object
10167  Handle<Object> p = it.rinfo()->target_object_handle(origin);
10168  Code* code = Code::cast(*p);
10169  it.rinfo()->set_target_address(code->instruction_start(),
10172  } else if (RelocInfo::IsRuntimeEntry(mode)) {
10173  Address p = it.rinfo()->target_runtime_entry(origin);
10174  it.rinfo()->set_target_runtime_entry(p, SKIP_WRITE_BARRIER,
10176  } else if (mode == RelocInfo::CODE_AGE_SEQUENCE) {
10177  Handle<Object> p = it.rinfo()->code_age_stub_handle(origin);
10178  Code* code = Code::cast(*p);
10179  it.rinfo()->set_code_age_stub(code, SKIP_ICACHE_FLUSH);
10180  } else {
10181  it.rinfo()->apply(delta, SKIP_ICACHE_FLUSH);
10182  }
10183  }
10185 }
byte * relocation_start()
Definition: objects-inl.h:6196
static void FlushICache(void *start, size_t size)
static bool IsRuntimeEntry(Mode mode)
Definition: assembler.h:405
static const int kApplyMask
Definition: assembler.h:591
static bool IsCodeTarget(Mode mode)
Definition: assembler.h:399
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
#define DCHECK(condition)
Definition: logging.h:205
@ SKIP_WRITE_BARRIER
Definition: objects.h:235
@ SKIP_ICACHE_FLUSH
Definition: assembler.h:293
void CopyBytes(uint8_t *target, uint8_t *source)
PerThreadAssertScopeDebugOnly< DEFERRED_HANDLE_DEREFERENCE_ASSERT, true > AllowDeferredHandleDereference
Definition: assert-scope.h:130

References v8::internal::CodeDesc::buffer, v8::internal::CodeDesc::buffer_size, v8::internal::RelocInfo::CELL, v8::internal::RelocInfo::CODE_AGE_SEQUENCE, v8::internal::CopyBytes(), DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::CpuFeatures::FlushICache(), v8::internal::CodeDesc::instr_size, instruction_size(), instruction_start(), v8::internal::RelocInfo::IsCodeTarget(), v8::internal::RelocInfo::IsRuntimeEntry(), v8::internal::RelocInfo::kApplyMask, v8::internal::RelocInfo::kCodeTargetMask, mode(), v8::internal::RelocInfo::ModeMask(), v8::internal::CodeDesc::origin, v8::internal::CodeDesc::reloc_size, relocation_start(), v8::internal::RelocInfo::RUNTIME_ENTRY, v8::internal::SKIP_ICACHE_FLUSH, and v8::internal::SKIP_WRITE_BARRIER.

+ Here is the call graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::Code::DISALLOW_IMPLICIT_CONSTRUCTORS ( Code  )
private

◆ entry()

byte * v8::internal::Code::entry ( )
inline

Definition at line 6206 of file objects-inl.h.

6206  {
6207  return instruction_start();
6208 }

References instruction_start().

Referenced by v8::internal::ConstantPoolArray::ClearPtrEntries(), v8::internal::Deoptimizer::DoComputeCompiledStubFrame(), v8::internal::Deoptimizer::DoComputeJSFrame(), v8::internal::NativeRegExpMacroAssembler::Execute(), v8::internal::JSFunction::set_code(), v8::internal::JSFunction::set_code_no_write_barrier(), and v8::internal::LiveEdit::SetAfterBreakTarget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExecutableSize()

int v8::internal::Code::ExecutableSize ( )
inline

Definition at line 5263 of file objects.h.

5263  {
5264  // Check that the assumptions about the layout of the code object holds.
5265  DCHECK_EQ(static_cast<int>(instruction_start() - address()),
5268  }
static const int kHeaderSize
Definition: objects.h:5373

References DCHECK_EQ, and kHeaderSize.

Referenced by v8::internal::AppendCodeCreateHeader(), v8::internal::CpuProfiler::CodeCreateEvent(), and v8::internal::CpuProfiler::RegExpCodeCreateEvent().

+ Here is the caller graph for this function:

◆ extra_ic_state()

ExtraICState v8::internal::Code::extra_ic_state ( )
inline

Definition at line 4647 of file objects-inl.h.

4647  {
4650 }
bool is_inline_cache_stub()
Definition: objects-inl.h:4921
static ExtraICState ExtractExtraICStateFromFlags(Flags flags)
Definition: objects-inl.h:4991

References DCHECK, v8::internal::DEBUG_STUB, ExtractExtraICStateFromFlags(), flags(), ic_state(), and is_inline_cache_stub().

Referenced by ComputeFlags(), ComputeMonomorphicFlags(), v8::internal::Debug::IsDebugBreak(), v8::internal::LoadIC::set_target(), v8::internal::StoreIC::set_target(), v8::internal::KeyedStoreIC::set_target(), v8::internal::IC::SetTargetAtAddress(), to_boolean_state(), and v8::internal::IC::TraceIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractCacheHolderFromFlags()

CacheHolderFlag v8::internal::Code::ExtractCacheHolderFromFlags ( Flags  flags)
inlinestatic

Definition at line 5001 of file objects-inl.h.

5001  {
5003 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and flags().

Referenced by v8::internal::CommonStubCacheChecks(), and v8::internal::IC::ComputeHandler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractExtraICStateFromFlags()

ExtraICState v8::internal::Code::ExtractExtraICStateFromFlags ( Flags  flags)
inlinestatic

Definition at line 4991 of file objects-inl.h.

4991  {
4993 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and flags().

Referenced by v8::internal::PropertyICCompiler::CompileStoreGeneric(), and extra_ic_state().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractICStateFromFlags()

InlineCacheState v8::internal::Code::ExtractICStateFromFlags ( Flags  flags)
inlinestatic

Definition at line 4986 of file objects-inl.h.

4986  {
4987  return ICStateField::decode(flags);
4988 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and flags().

Referenced by ic_state().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractKindFromFlags()

Code::Kind v8::internal::Code::ExtractKindFromFlags ( Flags  flags)
inlinestatic

Definition at line 4981 of file objects-inl.h.

4981  {
4982  return KindField::decode(flags);
4983 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and flags().

Referenced by v8::internal::CommonStubCacheChecks(), and kind().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ExtractTypeFromFlags()

Code::StubType v8::internal::Code::ExtractTypeFromFlags ( Flags  flags)
inlinestatic

Definition at line 4996 of file objects-inl.h.

4996  {
4997  return TypeField::decode(flags);
4998 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and flags().

Referenced by v8::internal::CommonStubCacheChecks(), and type().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindAllMaps()

void v8::internal::Code::FindAllMaps ( MapHandleList maps)

Definition at line 10300 of file objects.cc.

10300  {
10302  DisallowHeapAllocation no_allocation;
10304  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10305  RelocInfo* info = it.rinfo();
10306  Object* object = info->target_object();
10307  if (object->IsMap()) maps->Add(handle(Map::cast(object)));
10308  }
10309 }
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::List< T, AllocationPolicy >::Add(), DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::handle(), is_inline_cache_stub(), and v8::internal::RelocInfo::ModeMask().

+ Here is the call graph for this function:

◆ FindAndReplace()

void v8::internal::Code::FindAndReplace ( const FindAndReplacePattern pattern)

Definition at line 10279 of file objects.cc.

10279  {
10281  DisallowHeapAllocation no_allocation;
10284  int current_pattern = 0;
10285  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10286  RelocInfo* info = it.rinfo();
10287  Object* object = info->target_object();
10288  if (object->IsHeapObject()) {
10289  Map* map = HeapObject::cast(object)->map();
10290  if (map == *pattern.find_[current_pattern]) {
10291  info->set_target_object(*pattern.replace_[current_pattern]);
10292  if (++current_pattern == pattern.count_) return;
10293  }
10294  }
10295  }
10296  UNREACHABLE();
10297 }
STATIC_ASSERT(NUMBER_OF_KINDS<=16)
#define UNREACHABLE()
Definition: logging.h:30

References v8::internal::Code::FindAndReplacePattern::count_, DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::Code::FindAndReplacePattern::find_, is_handler(), is_inline_cache_stub(), v8::internal::Code::FindAndReplacePattern::kMaxCount, v8::internal::HeapObject::map(), v8::internal::RelocInfo::ModeMask(), v8::internal::Code::FindAndReplacePattern::replace_, STATIC_ASSERT(), and UNREACHABLE.

+ Here is the call graph for this function:

◆ FindCodeAgeSequence()

byte * v8::internal::Code::FindCodeAgeSequence ( )
private

Definition at line 10498 of file objects.cc.

10498  {
10499  return FLAG_age_code &&
10501  (kind() == OPTIMIZED_FUNCTION ||
10502  (kind() == FUNCTION && !has_debug_break_slots()))
10504  : NULL;
10505 }
bool has_debug_break_slots()
Definition: objects-inl.h:4729
static const int kPrologueOffsetNotSet
Definition: objects.h:4973
int prologue_offset() const

References has_debug_break_slots(), instruction_start(), kind(), kPrologueOffsetNotSet, NULL, and prologue_offset().

Referenced by GetRawAge(), MakeOlder(), v8::internal::Deoptimizer::PatchCodeForDeoptimization(), and v8::internal::RelocIterator::RelocIterator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindFirstAllocationSite()

AllocationSite * v8::internal::Code::FindFirstAllocationSite ( )

Definition at line 10267 of file objects.cc.

10267  {
10268  Object* result = FindNthObject(1, GetHeap()->allocation_site_map());
10269  return (result != NULL) ? AllocationSite::cast(result) : NULL;
10270 }
Object * FindNthObject(int n, Map *match_map)
Definition: objects.cc:10250
Heap * GetHeap() const
Definition: objects-inl.h:1379

References FindNthObject(), v8::internal::HeapObject::GetHeap(), and NULL.

+ Here is the call graph for this function:

◆ FindFirstHandler()

Code * v8::internal::Code::FindFirstHandler ( )

Definition at line 10312 of file objects.cc.

10312  {
10314  DisallowHeapAllocation no_allocation;
10316  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10317  RelocInfo* info = it.rinfo();
10318  Code* code = Code::GetCodeFromTargetAddress(info->target_address());
10319  if (code->kind() == Code::HANDLER) return code;
10320  }
10321  return NULL;
10322 }

References v8::internal::RelocInfo::CODE_TARGET, DCHECK, v8::internal::RelocIterator::done(), GetCodeFromTargetAddress(), is_inline_cache_stub(), kind(), v8::internal::RelocInfo::ModeMask(), and NULL.

+ Here is the call graph for this function:

◆ FindFirstMap()

Map * v8::internal::Code::FindFirstMap ( )

Definition at line 10273 of file objects.cc.

10273  {
10274  Object* result = FindNthObject(1, GetHeap()->meta_map());
10275  return (result != NULL) ? Map::cast(result) : NULL;
10276 }

References FindNthObject(), v8::internal::HeapObject::GetHeap(), and NULL.

+ Here is the call graph for this function:

◆ FindFirstName()

Name * v8::internal::Code::FindFirstName ( )

Definition at line 10364 of file objects.cc.

10364  {
10366  DisallowHeapAllocation no_allocation;
10368  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10369  RelocInfo* info = it.rinfo();
10370  Object* object = info->target_object();
10371  if (object->IsName()) return Name::cast(object);
10372  }
10373  return NULL;
10374 }

References DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, is_inline_cache_stub(), v8::internal::RelocInfo::ModeMask(), and NULL.

+ Here is the call graph for this function:

◆ FindHandlerForMap()

MaybeHandle< Code > v8::internal::Code::FindHandlerForMap ( Map map)

Definition at line 10344 of file objects.cc.

10344  {
10348  bool return_next = false;
10349  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10350  RelocInfo* info = it.rinfo();
10351  if (info->rmode() == RelocInfo::EMBEDDED_OBJECT) {
10352  Object* object = info->target_object();
10353  if (object == map) return_next = true;
10354  } else if (return_next) {
10355  Code* code = Code::GetCodeFromTargetAddress(info->target_address());
10356  DCHECK(code->kind() == Code::HANDLER);
10357  return handle(code);
10358  }
10359  }
10360  return MaybeHandle<Code>();
10361 }

References v8::internal::RelocInfo::CODE_TARGET, DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, GetCodeFromTargetAddress(), v8::internal::handle(), is_inline_cache_stub(), kind(), v8::internal::HeapObject::map(), v8::internal::RelocInfo::ModeMask(), and v8::internal::RelocInfo::rmode().

+ Here is the call graph for this function:

◆ FindHandlers()

bool v8::internal::Code::FindHandlers ( CodeHandleList code_list,
int  length = -1 
)

Definition at line 10325 of file objects.cc.

10325  {
10327  DisallowHeapAllocation no_allocation;
10329  int i = 0;
10330  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10331  if (i == length) return true;
10332  RelocInfo* info = it.rinfo();
10333  Code* code = Code::GetCodeFromTargetAddress(info->target_address());
10334  // IC stubs with handlers never contain non-handler code objects before
10335  // handler targets.
10336  if (code->kind() != Code::HANDLER) break;
10337  code_list->Add(Handle<Code>(code));
10338  i++;
10339  }
10340  return i == length;
10341 }

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::RelocInfo::CODE_TARGET, DCHECK, v8::internal::RelocIterator::done(), GetCodeFromTargetAddress(), is_inline_cache_stub(), kind(), and v8::internal::RelocInfo::ModeMask().

+ Here is the call graph for this function:

◆ FindNthObject()

Object * v8::internal::Code::FindNthObject ( int  n,
Map match_map 
)

Definition at line 10250 of file objects.cc.

10250  {
10252  DisallowHeapAllocation no_allocation;
10254  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10255  RelocInfo* info = it.rinfo();
10256  Object* object = info->target_object();
10257  if (object->IsHeapObject()) {
10258  if (HeapObject::cast(object)->map() == match_map) {
10259  if (--n == 0) return object;
10260  }
10261  }
10262  }
10263  return NULL;
10264 }

References DCHECK, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, is_inline_cache_stub(), v8::internal::HeapObject::map(), v8::internal::RelocInfo::ModeMask(), and NULL.

Referenced by FindFirstAllocationSite(), and FindFirstMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flags()

◆ GetAge()

Code::Age v8::internal::Code::GetAge ( )

Definition at line 10508 of file objects.cc.

10508  {
10509  return EffectiveAge(GetRawAge());
10510 }
static Code::Age EffectiveAge(Code::Age age)
Definition: objects.cc:10463

References v8::internal::EffectiveAge(), and GetRawAge().

Referenced by IsOld(), v8::internal::CodeFlusher::ProcessJSFunctionCandidates(), and v8::internal::CodeFlusher::ProcessSharedFunctionInfoCandidates().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCodeAgeAndParity() [1/2]

void v8::internal::Code::GetCodeAgeAndParity ( Code code,
Age age,
MarkingParity parity 
)
staticprivate

Definition at line 10525 of file objects.cc.

10526  {
10527  Isolate* isolate = code->GetIsolate();
10528  Builtins* builtins = isolate->builtins();
10529  Code* stub = NULL;
10530 #define HANDLE_CODE_AGE(AGE) \
10531  stub = *builtins->Make##AGE##CodeYoungAgainEvenMarking(); \
10532  if (code == stub) { \
10533  *age = k##AGE##CodeAge; \
10534  *parity = EVEN_MARKING_PARITY; \
10535  return; \
10536  } \
10537  stub = *builtins->Make##AGE##CodeYoungAgainOddMarking(); \
10538  if (code == stub) { \
10539  *age = k##AGE##CodeAge; \
10540  *parity = ODD_MARKING_PARITY; \
10541  return; \
10542  }
10544 #undef HANDLE_CODE_AGE
10545  stub = *builtins->MarkCodeAsExecutedOnce();
10546  if (code == stub) {
10547  *age = kNotExecutedCodeAge;
10548  *parity = NO_MARKING_PARITY;
10549  return;
10550  }
10551  stub = *builtins->MarkCodeAsExecutedTwice();
10552  if (code == stub) {
10553  *age = kExecutedOnceCodeAge;
10554  *parity = NO_MARKING_PARITY;
10555  return;
10556  }
10557  UNREACHABLE();
10558 }
@ NO_MARKING_PARITY
Definition: objects.h:298
#define HANDLE_CODE_AGE(AGE)

References v8::internal::Isolate::builtins(), CODE_AGE_LIST, v8::internal::HeapObject::GetIsolate(), HANDLE_CODE_AGE, kExecutedOnceCodeAge, kNotExecutedCodeAge, v8::internal::NO_MARKING_PARITY, NULL, and UNREACHABLE.

Referenced by GetRawAge(), and MakeOlder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCodeAgeAndParity() [2/2]

static void v8::internal::Code::GetCodeAgeAndParity ( Isolate isolate,
byte sequence,
Age age,
MarkingParity parity 
)
staticprivate

◆ GetCodeAgeStub()

Code * v8::internal::Code::GetCodeAgeStub ( Isolate isolate,
Age  age,
MarkingParity  parity 
)
staticprivate

Definition at line 10561 of file objects.cc.

10561  {
10562  Builtins* builtins = isolate->builtins();
10563  switch (age) {
10564 #define HANDLE_CODE_AGE(AGE) \
10565  case k##AGE##CodeAge: { \
10566  Code* stub = parity == EVEN_MARKING_PARITY \
10567  ? *builtins->Make##AGE##CodeYoungAgainEvenMarking() \
10568  : *builtins->Make##AGE##CodeYoungAgainOddMarking(); \
10569  return stub; \
10570  }
10572 #undef HANDLE_CODE_AGE
10573  case kNotExecutedCodeAge: {
10574  DCHECK(parity == NO_MARKING_PARITY);
10575  return *builtins->MarkCodeAsExecutedOnce();
10576  }
10577  case kExecutedOnceCodeAge: {
10578  DCHECK(parity == NO_MARKING_PARITY);
10579  return *builtins->MarkCodeAsExecutedTwice();
10580  }
10581  default:
10582  UNREACHABLE();
10583  break;
10584  }
10585  return NULL;
10586 }

References v8::internal::Isolate::builtins(), CODE_AGE_LIST, DCHECK, HANDLE_CODE_AGE, kExecutedOnceCodeAge, kNotExecutedCodeAge, v8::internal::NO_MARKING_PARITY, NULL, and UNREACHABLE.

+ Here is the call graph for this function:

◆ GetCodeFromTargetAddress()

Code * v8::internal::Code::GetCodeFromTargetAddress ( Address  address)
inlinestatic

Definition at line 5018 of file objects-inl.h.

5018  {
5019  HeapObject* code = HeapObject::FromAddress(address - Code::kHeaderSize);
5020  // GetCodeFromTargetAddress might be called when marking objects during mark
5021  // sweep. reinterpret_cast is therefore used instead of the more appropriate
5022  // Code::cast. Code::cast does not work when the object's map is
5023  // marked.
5024  Code* result = reinterpret_cast<Code*>(code);
5025  return result;
5026 }
static HeapObject * FromAddress(Address address)
Definition: objects-inl.h:1464

References v8::internal::HeapObject::address(), v8::internal::HeapObject::FromAddress(), and kHeaderSize.

Referenced by ClearInlineCaches(), FindFirstHandler(), FindHandlerForMap(), FindHandlers(), v8::internal::IC::GetTargetAtAddress(), v8::internal::Debug::IsDebugBreak(), v8::internal::BreakLocationIterator::IsStepInLocation(), v8::internal::BreakLocationIterator::Next(), v8::internal::Debug::PrepareStep(), v8::internal::BreakLocationIterator::PrepareStepIn(), v8::internal::TypeFeedbackOracle::ProcessRelocInfos(), v8::internal::BreakLocationIterator::SetDebugBreakAtIC(), v8::internal::PointersUpdatingVisitor::VisitCodeTarget(), v8::internal::ReplacingVisitor::VisitCodeTarget(), v8::internal::Serializer::ObjectSerializer::VisitCodeTarget(), and v8::internal::PointersUpdatingVisitor::VisitDebugTarget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetObjectFromEntryAddress()

Object * v8::internal::Code::GetObjectFromEntryAddress ( Address  location_of_address)
inlinestatic

Definition at line 5029 of file objects-inl.h.

5029  {
5030  return HeapObject::
5031  FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize);
5032 }
static Address & Address_at(Address addr)
Definition: v8memory.h:56

References v8::internal::Memory::Address_at(), v8::internal::HeapObject::FromAddress(), and kHeaderSize.

Referenced by v8::internal::JSFunction::code(), v8::internal::ScavengingVisitor< marks_handling, logging_and_profiling_mode >::EvacuateJSFunction(), v8::internal::CodeFlusher::ProcessJSFunctionCandidates(), v8::internal::ReplacingVisitor::VisitCodeEntry(), v8::internal::IndexedReferencesExtractor::VisitCodeEntry(), and v8::internal::Serializer::ObjectSerializer::VisitCodeEntry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPreAgedCodeAgeStub()

static Code* v8::internal::Code::GetPreAgedCodeAgeStub ( Isolate isolate)
inlinestatic

Definition at line 5320 of file objects.h.

5320  {
5322  }
static Code * GetCodeAgeStub(Isolate *isolate, Age age, MarkingParity parity)
Definition: objects.cc:10561

References v8::internal::NO_MARKING_PARITY.

◆ GetRawAge()

Code::Age v8::internal::Code::GetRawAge ( )

Definition at line 10513 of file objects.cc.

10513  {
10514  byte* sequence = FindCodeAgeSequence();
10515  if (sequence == NULL) {
10516  return kNoAgeCodeAge;
10517  }
10518  Age age;
10519  MarkingParity parity;
10520  GetCodeAgeAndParity(GetIsolate(), sequence, &age, &parity);
10521  return age;
10522 }
static void GetCodeAgeAndParity(Code *code, Age *age, MarkingParity *parity)
Definition: objects.cc:10525
byte * FindCodeAgeSequence()
Definition: objects.cc:10498

References FindCodeAgeSequence(), GetCodeAgeAndParity(), v8::internal::HeapObject::GetIsolate(), kNoAgeCodeAge, and NULL.

Referenced by GetAge(), and v8::internal::MarkCompactMarkingVisitor::ObjectStatsTracker< MarkCompactMarkingVisitor::kVisitCode >::Visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSafepointEntry()

SafepointEntry v8::internal::Code::GetSafepointEntry ( Address  pc)

Definition at line 10244 of file objects.cc.

10244  {
10245  SafepointTable table(this);
10246  return table.FindEntry(pc);
10247 }

References v8::internal::pc.

Referenced by v8::internal::Deoptimizer::DebuggerInspectableFrame(), v8::internal::Deoptimizer::DeoptimizeMarkedCodeForContext(), and v8::internal::OptimizedFrame::GetDeoptimizationData().

+ Here is the caller graph for this function:

◆ has_debug_break_slots()

bool v8::internal::Code::has_debug_break_slots ( )
inline

Definition at line 4729 of file objects-inl.h.

4729  {
4730  DCHECK_EQ(FUNCTION, kind());
4731  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
4733 }
static const int kFullCodeFlags
Definition: objects.h:5379
#define READ_BYTE_FIELD(p, offset)
Definition: objects-inl.h:1296

References DCHECK_EQ, v8::internal::BitFieldBase< T, shift, size, U >::decode(), flags(), kFullCodeFlags, kind(), and READ_BYTE_FIELD.

Referenced by v8::internal::ComputeCodeOffsetFromPcOffset(), FindCodeAgeSequence(), and v8::internal::Debug::PrepareForBreakPoints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ has_deoptimization_support()

bool v8::internal::Code::has_deoptimization_support ( )
inline

Definition at line 4714 of file objects-inl.h.

4714  {
4715  DCHECK_EQ(FUNCTION, kind());
4716  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
4718 }

References DCHECK_EQ, v8::internal::BitFieldBase< T, shift, size, U >::decode(), flags(), kFullCodeFlags, kind(), and READ_BYTE_FIELD.

Referenced by v8::internal::SharedFunctionInfo::has_deoptimization_support().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ has_function_cache()

bool v8::internal::Code::has_function_cache ( )
inline

Definition at line 4862 of file objects-inl.h.

4862  {
4863  DCHECK(kind() == STUB);
4866 }

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), kind(), kKindSpecificFlags1Offset, READ_UINT32_FIELD, and v8::internal::STUB.

+ Here is the call graph for this function:

◆ ic_age()

int v8::internal::Code::ic_age ( ) const
inline

◆ ic_state()

InlineCacheState v8::internal::Code::ic_state ( )
inline

Definition at line 4635 of file objects-inl.h.

4635  {
4637  // Only allow uninitialized or debugger states for non-IC code
4638  // objects. This is used in the debugger to determine whether or not
4639  // a call to code object has been replaced with a debug break call.
4641  result == UNINITIALIZED ||
4642  result == DEBUG_STUB);
4643  return result;
4644 }
static InlineCacheState ExtractICStateFromFlags(Flags flags)
Definition: objects-inl.h:4986
@ UNINITIALIZED
Definition: globals.h:446

References DCHECK, v8::internal::DEBUG_STUB, ExtractICStateFromFlags(), flags(), is_inline_cache_stub(), and v8::internal::UNINITIALIZED.

Referenced by ComputeFlags(), extra_ic_state(), is_debug_stub(), v8::internal::IC::IsCleared(), v8::internal::IC::PostPatching(), and v8::internal::IC::TraceIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_end()

byte * v8::internal::Code::instruction_end ( )
inline

Definition at line 6181 of file objects-inl.h.

6181  {
6182  return instruction_start() + instruction_size();
6183 }

References instruction_size(), and instruction_start().

Referenced by v8::internal::ComputeCodeOffsetFromPcOffset(), v8::internal::ComputePcOffsetFromCodeOffset(), v8::internal::Heap::CopyCode(), and v8::internal::Deoptimizer::PatchCodeForDeoptimization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instruction_size()

◆ instruction_start()

byte * v8::internal::Code::instruction_start ( )
inline

Definition at line 6176 of file objects-inl.h.

6176  {
6177  return FIELD_ADDR(this, kHeaderSize);
6178 }
#define FIELD_ADDR(p, offset)
Definition: objects-inl.h:1173

References FIELD_ADDR.

Referenced by v8::internal::IC::address(), v8::internal::BackEdgeTable::BackEdgeTable(), CanDeoptAt(), v8::internal::JitLogger::CodeDeleteEvent(), v8::internal::JitLogger::CodeMoveEvent(), v8::internal::ComputeCodeOffsetFromPcOffset(), v8::internal::ComputePcOffsetFromCodeOffset(), CopyFrom(), v8::internal::Deoptimizer::DoComputeAccessorStubFrame(), v8::internal::Deoptimizer::DoComputeArgumentsAdaptorFrame(), v8::internal::Deoptimizer::DoComputeCompiledStubFrame(), v8::internal::Deoptimizer::DoComputeConstructStubFrame(), v8::internal::Deoptimizer::DoComputeJSFrame(), v8::internal::JitLogger::EndCodePosInfoEvent(), entry(), FindCodeAgeSequence(), v8::internal::RecordWriteStub::GetMode(), instruction_end(), v8::internal::IC::InvalidateMaps(), v8::internal::PerfBasicLogger::LogRecordedBuffer(), v8::internal::LowLevelLogger::LogRecordedBuffer(), v8::internal::JitLogger::LogRecordedBuffer(), v8::internal::RecordWriteStub::Patch(), v8::internal::Deoptimizer::PatchCodeForDeoptimization(), v8::internal::JavaScriptFrame::Print(), v8::internal::JavaScriptFrame::PrintFunctionAndOffset(), v8::internal::Debug::RecordEvalCaller(), v8::internal::ProfileGenerator::RecordTickSample(), Relocate(), v8::internal::TypeFeedbackOracle::RelocateRelocInfos(), v8::internal::RelocIterator::RelocIterator(), v8::internal::ReplacingVisitor::VisitCodeEntry(), and v8::internal::ReplacingVisitor::VisitCodeTarget().

+ Here is the caller graph for this function:

◆ InvalidateEmbeddedObjects()

void v8::internal::Code::InvalidateEmbeddedObjects ( )

Definition at line 10110 of file objects.cc.

10110  {
10111  Object* undefined = GetHeap()->undefined_value();
10112  Cell* undefined_cell = GetHeap()->undefined_cell();
10115  for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
10116  RelocInfo::Mode mode = it.rinfo()->rmode();
10118  it.rinfo()->set_target_object(undefined, SKIP_WRITE_BARRIER);
10119  } else if (mode == RelocInfo::CELL) {
10120  it.rinfo()->set_target_cell(undefined_cell, SKIP_WRITE_BARRIER);
10121  }
10122  }
10123 }

References v8::internal::RelocInfo::CELL, v8::internal::RelocIterator::done(), v8::internal::RelocInfo::EMBEDDED_OBJECT, v8::internal::HeapObject::GetHeap(), mode(), v8::internal::RelocInfo::ModeMask(), and v8::internal::SKIP_WRITE_BARRIER.

Referenced by v8::internal::MarkCompactCollector::ClearDependentCode(), and InvalidateRelocation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvalidateRelocation()

void v8::internal::Code::InvalidateRelocation ( )

Definition at line 10104 of file objects.cc.

10104  {
10106  set_relocation_info(GetHeap()->empty_byte_array());
10107 }
void InvalidateEmbeddedObjects()
Definition: objects.cc:10110

References v8::internal::HeapObject::GetHeap(), and InvalidateEmbeddedObjects().

Referenced by v8::internal::Deoptimizer::PatchCodeForDeoptimization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_binary_op_stub()

bool v8::internal::Code::is_binary_op_stub ( )
inline

Definition at line 5054 of file objects.h.

5054 { return kind() == BINARY_OP_IC; }

Referenced by v8::internal::BreakLocationIterator::Next().

+ Here is the caller graph for this function:

◆ is_call_stub()

bool v8::internal::Code::is_call_stub ( )
inline

Definition at line 5053 of file objects.h.

5053 { return kind() == CALL_IC; }

Referenced by v8::internal::Debug::PrepareStep().

+ Here is the caller graph for this function:

◆ is_compare_ic_stub()

bool v8::internal::Code::is_compare_ic_stub ( )
inline

Definition at line 5055 of file objects.h.

5055 { return kind() == COMPARE_IC; }

Referenced by v8::internal::BreakLocationIterator::Next().

+ Here is the caller graph for this function:

◆ is_compare_nil_ic_stub()

bool v8::internal::Code::is_compare_nil_ic_stub ( )
inline

Definition at line 5056 of file objects.h.

5056 { return kind() == COMPARE_NIL_IC; }

◆ is_compiled_optimizable()

bool v8::internal::Code::is_compiled_optimizable ( )
inline

Definition at line 4744 of file objects-inl.h.

4744  {
4745  DCHECK_EQ(FUNCTION, kind());
4746  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
4748 }

References DCHECK_EQ, v8::internal::BitFieldBase< T, shift, size, U >::decode(), flags(), kFullCodeFlags, kind(), and READ_BYTE_FIELD.

+ Here is the call graph for this function:

◆ is_crankshafted()

bool v8::internal::Code::is_crankshafted ( )
inline

Definition at line 4669 of file objects-inl.h.

4669  {
4672 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), kKindSpecificFlags2Offset, and READ_UINT32_FIELD.

Referenced by is_hydrogen_stub(), safepoint_table_offset(), set_safepoint_table_offset(), set_stack_slots(), and stack_slots().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_debug_stub()

bool v8::internal::Code::is_debug_stub ( )
inline

Definition at line 4937 of file objects-inl.h.

4937  {
4938  return ic_state() == DEBUG_STUB;
4939 }

References v8::internal::DEBUG_STUB, and ic_state().

Referenced by v8::internal::DropFrames(), and v8::internal::Debug::IsDebugBreak().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_handler()

bool v8::internal::Code::is_handler ( )
inline

Definition at line 5048 of file objects.h.

5048 { return kind() == HANDLER; }

Referenced by FindAndReplace().

+ Here is the caller graph for this function:

◆ is_hydrogen_stub()

bool v8::internal::Code::is_hydrogen_stub ( )
inline

Definition at line 4675 of file objects-inl.h.

4675  {
4676  return is_crankshafted() && kind() != OPTIMIZED_FUNCTION;
4677 }

References is_crankshafted(), and kind().

Referenced by v8::internal::Deoptimizer::DoComputeCompiledStubFrame(), and v8::internal::Deoptimizer::DoComputeOutputFrames().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_inline_cache_stub()

bool v8::internal::Code::is_inline_cache_stub ( )
inline

Definition at line 4921 of file objects-inl.h.

4921  {
4922  Kind kind = this->kind();
4923  switch (kind) {
4924 #define CASE(name) case name: return true;
4926 #undef CASE
4927  default: return false;
4928  }
4929 }
#define CASE(name)
#define IC_KIND_LIST(V)
Definition: objects.h:4939

References CASE, IC_KIND_LIST, and kind().

Referenced by ClearInlineCaches(), v8::internal::DropFrames(), extra_ic_state(), FindAllMaps(), FindAndReplace(), FindFirstHandler(), FindFirstName(), FindHandlerForMap(), FindHandlers(), FindNthObject(), v8::internal::IC::GetTargetAtAddress(), ic_state(), mark_as_invalidated_weak_stub(), v8::internal::BreakLocationIterator::Next(), v8::internal::IC::PostPatching(), and v8::internal::Debug::PrepareStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_invalidated_weak_stub()

bool v8::internal::Code::is_invalidated_weak_stub ( )
inline

Definition at line 4907 of file objects-inl.h.

4907  {
4910 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), is_weak_stub(), kKindSpecificFlags1Offset, and READ_UINT32_FIELD.

+ Here is the call graph for this function:

◆ is_keyed_load_stub()

bool v8::internal::Code::is_keyed_load_stub ( )
inline

Definition at line 5050 of file objects.h.

5050 { return kind() == KEYED_LOAD_IC; }

Referenced by is_keyed_stub().

+ Here is the caller graph for this function:

◆ is_keyed_store_stub()

bool v8::internal::Code::is_keyed_store_stub ( )
inline

Definition at line 5052 of file objects.h.

5052 { return kind() == KEYED_STORE_IC; }

Referenced by is_keyed_stub().

+ Here is the caller graph for this function:

◆ is_keyed_stub()

bool v8::internal::Code::is_keyed_stub ( )
inline

Definition at line 4932 of file objects-inl.h.

4932  {
4934 }
bool is_keyed_store_stub()
Definition: objects.h:5052
bool is_keyed_load_stub()
Definition: objects.h:5050

References is_keyed_load_stub(), and is_keyed_store_stub().

Referenced by v8::internal::IC::TraceIC().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_load_stub()

bool v8::internal::Code::is_load_stub ( )
inline

Definition at line 5049 of file objects.h.

5049 { return kind() == LOAD_IC; }

◆ is_optimized_code()

bool v8::internal::Code::is_optimized_code ( )
inline

Definition at line 5059 of file objects.h.

5059 { return kind() == OPTIMIZED_FUNCTION; }

Referenced by v8::internal::MarkCompactCollector::WillBeDeoptimized().

+ Here is the caller graph for this function:

◆ is_store_stub()

bool v8::internal::Code::is_store_stub ( )
inline

Definition at line 5051 of file objects.h.

5051 { return kind() == STORE_IC; }

◆ is_to_boolean_ic_stub()

bool v8::internal::Code::is_to_boolean_ic_stub ( )
inline

Definition at line 5057 of file objects.h.

5057 { return kind() == TO_BOOLEAN_IC; }

Referenced by v8::internal::BreakLocationIterator::Next().

+ Here is the caller graph for this function:

◆ is_turbofanned()

bool v8::internal::Code::is_turbofanned ( )
inline

Definition at line 4687 of file objects-inl.h.

4687  {
4688  DCHECK(kind() == OPTIMIZED_FUNCTION || kind() == STUB);
4691 }

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), kind(), kKindSpecificFlags1Offset, READ_UINT32_FIELD, and v8::internal::STUB.

Referenced by v8::internal::Deoptimizer::DeoptimizeMarkedCodeForContext(), v8::internal::Deoptimizer::DoComputeJSFrame(), and v8::internal::StaticMarkingVisitor< StaticVisitor >::MarkInlinedFunctionsCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_weak_stub()

bool v8::internal::Code::is_weak_stub ( )
inline

Definition at line 4893 of file objects-inl.h.

4893  {
4896 }
bool CanBeWeakStub()
Definition: objects.h:5065

References CanBeWeakStub(), v8::internal::BitFieldBase< T, shift, size, U >::decode(), kKindSpecificFlags1Offset, and READ_UINT32_FIELD.

Referenced by v8::internal::MarkCompactCollector::ClearDependentICList(), v8::internal::IC::InvalidateMaps(), and is_invalidated_weak_stub().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsCodeStubOrIC()

bool v8::internal::Code::IsCodeStubOrIC ( )
inline

Definition at line 4626 of file objects-inl.h.

4626  {
4627  return kind() == STUB || kind() == HANDLER || kind() == LOAD_IC ||
4628  kind() == KEYED_LOAD_IC || kind() == CALL_IC || kind() == STORE_IC ||
4629  kind() == KEYED_STORE_IC || kind() == BINARY_OP_IC ||
4630  kind() == COMPARE_IC || kind() == COMPARE_NIL_IC ||
4631  kind() == TO_BOOLEAN_IC;
4632 }

References kind(), and v8::internal::STUB.

Referenced by set_stub_key(), and stub_key().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsOld()

bool v8::internal::Code::IsOld ( )

Definition at line 10493 of file objects.cc.

10493  {
10494  return GetAge() >= kIsOldCodeAge;
10495 }

References GetAge(), and kIsOldCodeAge.

+ Here is the call graph for this function:

◆ IsWeakObject()

bool v8::internal::Code::IsWeakObject ( Object object)
inline

Definition at line 5335 of file objects.h.

5335  {
5336  return (is_optimized_code() && !is_turbofanned() &&
5337  IsWeakObjectInOptimizedCode(object)) ||
5338  (is_weak_stub() && IsWeakObjectInIC(object));
5339  }
static bool IsWeakObjectInOptimizedCode(Object *object)
Definition: objects-inl.h:5035
static bool IsWeakObjectInIC(Object *object)
Definition: objects-inl.h:5067

◆ IsWeakObjectInIC()

bool v8::internal::Code::IsWeakObjectInIC ( Object object)
inlinestatic

Definition at line 5067 of file objects-inl.h.

5067  {
5068  return object->IsMap() && Map::cast(object)->CanTransition() &&
5069  FLAG_collect_maps &&
5070  FLAG_weak_embedded_maps_in_ic;
5071 }

◆ IsWeakObjectInOptimizedCode()

bool v8::internal::Code::IsWeakObjectInOptimizedCode ( Object object)
inlinestatic

Definition at line 5035 of file objects-inl.h.

5035  {
5036  if (!FLAG_collect_maps) return false;
5037  if (object->IsMap()) {
5038  return Map::cast(object)->CanTransition() &&
5039  FLAG_weak_embedded_maps_in_optimized_code;
5040  }
5041  if (object->IsJSObject() ||
5042  (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) {
5043  return FLAG_weak_embedded_objects_in_optimized_code;
5044  }
5045  return false;
5046 }

◆ IsYoungSequence()

static bool v8::internal::Code::IsYoungSequence ( Isolate isolate,
byte sequence 
)
static

Referenced by v8::internal::RelocIterator::RelocIterator().

+ Here is the caller graph for this function:

◆ kind()

Code::Kind v8::internal::Code::kind ( )
inline

Definition at line 4621 of file objects-inl.h.

4621  {
4622  return ExtractKindFromFlags(flags());
4623 }
static Kind ExtractKindFromFlags(Flags flags)
Definition: objects-inl.h:4981

References ExtractKindFromFlags(), and flags().

Referenced by v8::internal::Context::AddOptimizedCode(), allow_osr_at_loop_nesting_level(), v8::internal::AppendCodeCreateHeader(), back_edge_table_offset(), back_edges_patched_for_osr(), v8::internal::BackEdgeTable::BackEdgeTable(), builtin_index(), v8::internal::Heap::ClearAllICsByKind(), ClearInlineCaches(), v8::internal::ComputeCodeOffsetFromPcOffset(), ComputeFlags(), v8::internal::Deoptimizer::ComputeInputFrameSize(), v8::internal::ComputeMarker(), ComputeMonomorphicFlags(), v8::internal::ComputePcOffsetFromCodeOffset(), v8::internal::Deoptimizer::DeoptimizeFunction(), v8::internal::Deoptimizer::DeoptimizeMarkedCodeForContext(), v8::internal::Deoptimizer::Deoptimizer(), v8::internal::Deoptimizer::DoComputeOutputFrames(), v8::internal::DropFrames(), v8::internal::V8HeapExplorer::ExtractCodeReferences(), FindCodeAgeSequence(), v8::internal::Deoptimizer::FindDeoptimizingCode(), FindFirstHandler(), FindHandlerForMap(), FindHandlers(), v8::internal::OptimizedFrame::GetDeoptimizationData(), v8::internal::Deoptimizer::GetDeoptimizedCodeCount(), has_debug_break_slots(), has_deoptimization_support(), v8::internal::SharedFunctionInfo::has_deoptimization_support(), has_function_cache(), v8::internal::HeapObject::HeapObjectShortPrint(), is_compiled_optimizable(), is_hydrogen_stub(), is_inline_cache_stub(), is_turbofanned(), IsCodeStubOrIC(), v8::internal::IsJSFunctionCode(), v8::internal::JSFunction::IsOptimizable(), v8::internal::JSFunction::IsOptimized(), Kind2String(), v8::internal::Logger::LogCodeObject(), v8::internal::Deoptimizer::MarkAllCodeForContext(), marked_for_deoptimization(), v8::internal::BreakLocationIterator::Next(), v8::internal::IC::OnTypeFeedbackChanged(), optimizable(), v8::internal::RuntimeProfiler::OptimizeNow(), v8::internal::Debug::PrepareForBreakPoints(), v8::internal::Debug::PrepareStep(), v8::internal::JavaScriptFrame::Print(), v8::internal::Deoptimizer::PrintFunctionName(), v8::internal::TypeFeedbackOracle::ProcessRelocInfos(), profiler_ticks(), v8::internal::JSFunction::ReplaceCode(), v8::internal::RUNTIME_FUNCTION(), v8::internal::CodeSerializer::SerializeObject(), set_allow_osr_at_loop_nesting_level(), set_back_edge_table_offset(), set_builtin_index(), set_compiled_optimizable(), set_has_debug_break_slots(), set_has_deoptimization_support(), set_has_function_cache(), set_is_turbofanned(), set_marked_for_deoptimization(), set_optimizable(), set_profiler_ticks(), set_type_feedback_info(), v8::internal::IC::SetTargetAtAddress(), v8::internal::V8HeapExplorer::TagCodeObject(), v8::internal::IC::TraceIC(), TranslateAstIdToPcOffset(), TranslatePcOffsetToAstId(), type_feedback_info(), and v8::internal::MarkCompactMarkingVisitor::ObjectStatsTracker< MarkCompactMarkingVisitor::kVisitCode >::Visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Kind2String()

const char * v8::internal::Code::Kind2String ( Kind  kind)
static

Definition at line 10627 of file objects.cc.

10627  {
10628  switch (kind) {
10629 #define CASE(name) case name: return #name;
10631 #undef CASE
10632  case NUMBER_OF_KINDS: break;
10633  }
10634  UNREACHABLE();
10635  return NULL;
10636 }
#define CASE(name)

References CASE, CODE_KIND_LIST, kind(), NULL, NUMBER_OF_KINDS, and UNREACHABLE.

Referenced by v8::internal::V8HeapExplorer::ExtractSharedFunctionInfoReferences(), v8::internal::HeapObject::HeapObjectShortPrint(), and v8::internal::Deoptimizer::PrintFunctionName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeCodeAgeSequenceYoung()

void v8::internal::Code::MakeCodeAgeSequenceYoung ( byte sequence,
Isolate isolate 
)
static

Definition at line 10452 of file objects.cc.

10452  {
10454 }
static void PatchPlatformCodeAge(Isolate *isolate, byte *sequence, Age age, MarkingParity parity)

References kNoAgeCodeAge, v8::internal::NO_MARKING_PARITY, and PatchPlatformCodeAge().

+ Here is the call graph for this function:

◆ MakeOlder()

void v8::internal::Code::MakeOlder ( MarkingParity  current_parity)

Definition at line 10475 of file objects.cc.

10475  {
10476  byte* sequence = FindCodeAgeSequence();
10477  if (sequence != NULL) {
10478  Age age;
10479  MarkingParity code_parity;
10480  Isolate* isolate = GetIsolate();
10481  GetCodeAgeAndParity(isolate, sequence, &age, &code_parity);
10482  age = EffectiveAge(age);
10483  if (age != kLastCodeAge && code_parity != current_parity) {
10484  PatchPlatformCodeAge(isolate,
10485  sequence,
10486  static_cast<Age>(age + 1),
10487  current_parity);
10488  }
10489  }
10490 }

References v8::internal::EffectiveAge(), FindCodeAgeSequence(), GetCodeAgeAndParity(), v8::internal::HeapObject::GetIsolate(), kLastCodeAge, NULL, and PatchPlatformCodeAge().

+ Here is the call graph for this function:

◆ mark_as_invalidated_weak_stub()

void v8::internal::Code::mark_as_invalidated_weak_stub ( )
inline

Definition at line 4913 of file objects-inl.h.

4913  {
4915  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
4916  int updated = InvalidatedWeakStubField::update(previous, true);
4918 }
static U update(U previous, T value)
Definition: utils.h:223
#define WRITE_UINT32_FIELD(p, offset, value)
Definition: objects-inl.h:1275

References DCHECK, is_inline_cache_stub(), kKindSpecificFlags1Offset, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

Referenced by v8::internal::IC::InvalidateMaps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mark_as_weak_stub()

void v8::internal::Code::mark_as_weak_stub ( )
inline

Definition at line 4899 of file objects-inl.h.

4899  {
4900  DCHECK(CanBeWeakStub());
4901  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
4902  int updated = WeakStubField::update(previous, true);
4904 }

References CanBeWeakStub(), DCHECK, kKindSpecificFlags1Offset, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ MarkCodeAsExecuted()

void v8::internal::Code::MarkCodeAsExecuted ( byte sequence,
Isolate isolate 
)
static

Definition at line 10457 of file objects.cc.

10457  {
10458  PatchPlatformCodeAge(isolate, sequence, kExecutedOnceCodeAge,
10460 }

References kExecutedOnceCodeAge, v8::internal::NO_MARKING_PARITY, and PatchPlatformCodeAge().

+ Here is the call graph for this function:

◆ marked_for_deoptimization()

bool v8::internal::Code::marked_for_deoptimization ( )
inline

Definition at line 4877 of file objects-inl.h.

4877  {
4878  DCHECK(kind() == OPTIMIZED_FUNCTION);
4881 }

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), kind(), kKindSpecificFlags1Offset, and READ_UINT32_FIELD.

Referenced by v8::internal::MarkCompactCollector::ClearDependentCode(), v8::internal::Deoptimizer::DeoptimizeMarkedCodeForContext(), v8::internal::DependentCode::MarkCodeForDeoptimization(), and v8::internal::MarkCompactCollector::WillBeDeoptimized().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ optimizable()

bool v8::internal::Code::optimizable ( )
inline

Definition at line 4702 of file objects-inl.h.

4702  {
4703  DCHECK_EQ(FUNCTION, kind());
4704  return READ_BYTE_FIELD(this, kOptimizableOffset) == 1;
4705 }
static const int kOptimizableOffset
Definition: objects.h:5377

References DCHECK_EQ, kind(), kOptimizableOffset, and READ_BYTE_FIELD.

Referenced by v8::internal::ComputeMarker(), and v8::internal::JSFunction::IsOptimizable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PatchPlatformCodeAge()

static void v8::internal::Code::PatchPlatformCodeAge ( Isolate isolate,
byte sequence,
Age  age,
MarkingParity  parity 
)
staticprivate

Referenced by MakeCodeAgeSequenceYoung(), MakeOlder(), and MarkCodeAsExecuted().

+ Here is the caller graph for this function:

◆ PrintDeoptLocation()

void v8::internal::Code::PrintDeoptLocation ( FILE *  out,
int  bailout_id 
)

Definition at line 10589 of file objects.cc.

10589  {
10590  const char* last_comment = NULL;
10593  for (RelocIterator it(this, mask); !it.done(); it.next()) {
10594  RelocInfo* info = it.rinfo();
10595  if (info->rmode() == RelocInfo::COMMENT) {
10596  last_comment = reinterpret_cast<const char*>(info->data());
10597  } else if (last_comment != NULL) {
10598  if ((bailout_id == Deoptimizer::GetDeoptimizationId(
10599  GetIsolate(), info->target_address(), Deoptimizer::EAGER)) ||
10600  (bailout_id == Deoptimizer::GetDeoptimizationId(
10601  GetIsolate(), info->target_address(), Deoptimizer::SOFT)) ||
10602  (bailout_id == Deoptimizer::GetDeoptimizationId(
10603  GetIsolate(), info->target_address(), Deoptimizer::LAZY))) {
10604  CHECK(RelocInfo::IsRuntimeEntry(info->rmode()));
10605  PrintF(out, " %s\n", last_comment);
10606  return;
10607  }
10608  }
10609  }
10610 }
static int GetDeoptimizationId(Isolate *isolate, Address addr, BailoutType type)
Definition: deoptimizer.cc:690
#define CHECK(condition)
Definition: logging.h:36
void PrintF(const char *format,...)
Definition: utils.cc:80

References CHECK, v8::internal::RelocInfo::COMMENT, v8::internal::RelocInfo::data(), v8::internal::RelocIterator::done(), v8::internal::Deoptimizer::EAGER, v8::internal::Deoptimizer::GetDeoptimizationId(), v8::internal::HeapObject::GetIsolate(), v8::internal::RelocInfo::IsRuntimeEntry(), v8::internal::Deoptimizer::LAZY, v8::internal::RelocInfo::ModeMask(), NULL, v8::internal::PrintF(), v8::internal::RelocInfo::rmode(), v8::internal::RelocInfo::RUNTIME_ENTRY, and v8::internal::Deoptimizer::SOFT.

Referenced by v8::internal::Deoptimizer::DoComputeOutputFrames().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ profiler_ticks()

int v8::internal::Code::profiler_ticks ( )
inline

Definition at line 4775 of file objects-inl.h.

4775  {
4776  DCHECK_EQ(FUNCTION, kind());
4777  return READ_BYTE_FIELD(this, kProfilerTicksOffset);
4778 }
static const int kProfilerTicksOffset
Definition: objects.h:5385

References DCHECK_EQ, kind(), kProfilerTicksOffset, and READ_BYTE_FIELD.

Referenced by v8::internal::RuntimeProfiler::OptimizeNow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prologue_offset()

int v8::internal::Code::prologue_offset ( ) const
inline

Referenced by FindCodeAgeSequence().

+ Here is the caller graph for this function:

◆ Relocate()

void v8::internal::Code::Relocate ( intptr_t  delta)

Definition at line 10126 of file objects.cc.

10126  {
10127  for (RelocIterator it(this, RelocInfo::kApplyMask); !it.done(); it.next()) {
10128  it.rinfo()->apply(delta, SKIP_ICACHE_FLUSH);
10129  }
10131 }

References v8::internal::RelocIterator::done(), v8::internal::CpuFeatures::FlushICache(), instruction_size(), instruction_start(), v8::internal::RelocInfo::kApplyMask, and v8::internal::SKIP_ICACHE_FLUSH.

Referenced by v8::internal::Heap::CopyCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ relocation_size()

int v8::internal::Code::relocation_size ( )
inline

Definition at line 6201 of file objects-inl.h.

6201  {
6202  return unchecked_relocation_info()->length();
6203 }
ByteArray * unchecked_relocation_info()
Definition: objects-inl.h:6191

References v8::internal::FixedArrayBase::length(), and unchecked_relocation_info().

Referenced by v8::internal::RelocIterator::RelocIterator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ relocation_start()

byte * v8::internal::Code::relocation_start ( )
inline

Definition at line 6196 of file objects-inl.h.

6196  {
6198 }

References v8::internal::ByteArray::GetDataStartAddress(), and unchecked_relocation_info().

Referenced by v8::internal::Heap::CopyCode(), CopyFrom(), and v8::internal::RelocIterator::RelocIterator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveTypeAndHolderFromFlags()

Code::Flags v8::internal::Code::RemoveTypeAndHolderFromFlags ( Flags  flags)
inlinestatic

Definition at line 5012 of file objects-inl.h.

5012  {
5013  int bits = flags & ~TypeField::kMask & ~CacheHolderField::kMask;
5014  return static_cast<Flags>(bits);
5015 }

References flags().

Referenced by v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeStub(), v8::internal::CommonStubCacheChecks(), and v8::internal::StubCache::Set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveTypeFromFlags()

Code::Flags v8::internal::Code::RemoveTypeFromFlags ( Flags  flags)
inlinestatic

Definition at line 5006 of file objects-inl.h.

5006  {
5007  int bits = flags & ~TypeField::kMask;
5008  return static_cast<Flags>(bits);
5009 }

References flags().

Referenced by v8::internal::CodeCache::Lookup(), v8::internal::CodeCache::LookupDefaultCache(), and v8::internal::CodeCache::UpdateDefaultCache().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ safepoint_table_offset()

unsigned v8::internal::Code::safepoint_table_offset ( )
inline

Definition at line 4817 of file objects-inl.h.

4817  {
4821 }

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), is_crankshafted(), kKindSpecificFlags2Offset, and READ_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_allow_osr_at_loop_nesting_level()

void v8::internal::Code::set_allow_osr_at_loop_nesting_level ( int  level)
inline

Definition at line 4766 of file objects-inl.h.

4766  {
4767  DCHECK_EQ(FUNCTION, kind());
4768  DCHECK(level >= 0 && level <= kMaxLoopNestingMarker);
4769  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
4770  int updated = AllowOSRAtLoopNestingLevelField::update(previous, level);
4772 }
static const int kMaxLoopNestingMarker
Definition: objects.h:5346

References DCHECK, DCHECK_EQ, kind(), kKindSpecificFlags2Offset, kMaxLoopNestingMarker, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

Referenced by v8::internal::BackEdgeTable::Patch(), and v8::internal::BackEdgeTable::Revert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_back_edge_table_offset()

void v8::internal::Code::set_back_edge_table_offset ( unsigned  offset)
inline

Definition at line 4841 of file objects-inl.h.

4841  {
4842  DCHECK_EQ(FUNCTION, kind());
4843  DCHECK(IsAligned(offset, static_cast<unsigned>(kPointerSize)));
4844  offset = offset >> kPointerSizeLog2;
4845  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
4846  int updated = BackEdgeTableOffsetField::update(previous, offset);
4848 }
const int kPointerSize
Definition: globals.h:129
bool IsAligned(T value, U alignment)
Definition: utils.h:123

References DCHECK, DCHECK_EQ, v8::internal::IsAligned(), kind(), kKindSpecificFlags2Offset, v8::internal::kPointerSize, v8::internal::kPointerSizeLog2, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_builtin_index()

void v8::internal::Code::set_builtin_index ( int  id)
inline

Definition at line 4795 of file objects-inl.h.

4795  {
4796  DCHECK_EQ(BUILTIN, kind());
4798 }
#define WRITE_INT32_FIELD(p, offset, value)
Definition: objects-inl.h:1281

References v8::internal::BUILTIN, DCHECK_EQ, kind(), kKindSpecificFlags1Offset, and WRITE_INT32_FIELD.

+ Here is the call graph for this function:

◆ set_compiled_optimizable()

void v8::internal::Code::set_compiled_optimizable ( bool  value)
inline

Definition at line 4751 of file objects-inl.h.

4751  {
4752  DCHECK_EQ(FUNCTION, kind());
4753  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
4756 }
#define WRITE_BYTE_FIELD(p, offset, value)
Definition: objects-inl.h:1303

References DCHECK_EQ, flags(), kFullCodeFlags, kind(), READ_BYTE_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_BYTE_FIELD.

+ Here is the call graph for this function:

◆ set_constant_pool()

void v8::internal::Code::set_constant_pool ( Object constant_pool)
inline

Definition at line 4947 of file objects-inl.h.

4947  {
4948  DCHECK(value->IsConstantPoolArray());
4949  WRITE_FIELD(this, kConstantPoolOffset, value);
4950  WRITE_BARRIER(GetHeap(), this, kConstantPoolOffset, value);
4951 }
#define WRITE_FIELD(p, offset, value)
Definition: objects-inl.h:1190
#define WRITE_BARRIER(heap, object, offset, value)
Definition: objects-inl.h:1203

References DCHECK, v8::internal::HeapObject::GetHeap(), kConstantPoolOffset, WRITE_BARRIER, and WRITE_FIELD.

Referenced by v8::internal::Heap::CopyCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_flags()

void v8::internal::Code::set_flags ( Code::Flags  flags)
inline

Definition at line 4615 of file objects-inl.h.

4615  {
4618 }
static const T kMax
Definition: utils.h:209
#define WRITE_INT_FIELD(p, offset, value)
Definition: objects-inl.h:1263

References flags(), kFlagsOffset, v8::internal::BitFieldBase< T, shift, size, U >::kMax, NUMBER_OF_KINDS, STATIC_ASSERT(), and WRITE_INT_FIELD.

+ Here is the call graph for this function:

◆ set_has_debug_break_slots()

void v8::internal::Code::set_has_debug_break_slots ( bool  value)
inline

Definition at line 4736 of file objects-inl.h.

4736  {
4737  DCHECK_EQ(FUNCTION, kind());
4738  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
4741 }

References DCHECK_EQ, flags(), kFullCodeFlags, kind(), READ_BYTE_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_BYTE_FIELD.

+ Here is the call graph for this function:

◆ set_has_deoptimization_support()

void v8::internal::Code::set_has_deoptimization_support ( bool  value)
inline

Definition at line 4721 of file objects-inl.h.

4721  {
4722  DCHECK_EQ(FUNCTION, kind());
4723  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
4726 }

References DCHECK_EQ, flags(), kFullCodeFlags, kind(), READ_BYTE_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_BYTE_FIELD.

Referenced by v8::internal::SharedFunctionInfo::EnableDeoptimizationSupport().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_has_function_cache()

void v8::internal::Code::set_has_function_cache ( bool  flag)
inline

Definition at line 4869 of file objects-inl.h.

4869  {
4870  DCHECK(kind() == STUB);
4871  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
4872  int updated = HasFunctionCacheField::update(previous, flag);
4874 }
kFeedbackVectorOffset flag
Definition: objects-inl.h:5418

References DCHECK, v8::internal::flag, kind(), kKindSpecificFlags1Offset, READ_UINT32_FIELD, v8::internal::STUB, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_ic_age()

void v8::internal::Code::set_ic_age ( int  count)
inline

Referenced by v8::internal::Heap::AllocateCode().

+ Here is the caller graph for this function:

◆ set_instruction_size()

void v8::internal::Code::set_instruction_size ( int  value)
inline

◆ set_is_crankshafted()

void v8::internal::Code::set_is_crankshafted ( bool  value)
inline

Definition at line 4680 of file objects-inl.h.

4680  {
4681  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
4682  int updated = IsCrankshaftedField::update(previous, value);
4684 }

References kKindSpecificFlags2Offset, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_is_turbofanned()

void v8::internal::Code::set_is_turbofanned ( bool  value)
inline

Definition at line 4694 of file objects-inl.h.

4694  {
4695  DCHECK(kind() == OPTIMIZED_FUNCTION || kind() == STUB);
4696  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
4697  int updated = IsTurbofannedField::update(previous, value);
4699 }

References DCHECK, kind(), kKindSpecificFlags1Offset, READ_UINT32_FIELD, v8::internal::STUB, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_marked_for_deoptimization()

void v8::internal::Code::set_marked_for_deoptimization ( bool  flag)
inline

Definition at line 4884 of file objects-inl.h.

4884  {
4885  DCHECK(kind() == OPTIMIZED_FUNCTION);
4886  DCHECK(!flag || AllowDeoptimization::IsAllowed(GetIsolate()));
4887  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
4888  int updated = MarkedForDeoptimizationField::update(previous, flag);
4890 }

References DCHECK, v8::internal::flag, v8::internal::HeapObject::GetIsolate(), kind(), kKindSpecificFlags1Offset, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

Referenced by v8::internal::Deoptimizer::DeoptimizeFunction(), v8::internal::Deoptimizer::MarkAllCodeForContext(), and v8::internal::DependentCode::SetMarkedForDeoptimization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_optimizable()

void v8::internal::Code::set_optimizable ( bool  value)
inline

Definition at line 4708 of file objects-inl.h.

4708  {
4709  DCHECK_EQ(FUNCTION, kind());
4710  WRITE_BYTE_FIELD(this, kOptimizableOffset, value ? 1 : 0);
4711 }

References DCHECK_EQ, kind(), kOptimizableOffset, and WRITE_BYTE_FIELD.

+ Here is the call graph for this function:

◆ set_profiler_ticks()

void v8::internal::Code::set_profiler_ticks ( int  ticks)
inline

Definition at line 4781 of file objects-inl.h.

4781  {
4782  DCHECK(ticks < 256);
4783  if (kind() == FUNCTION) {
4784  WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks);
4785  }
4786 }

References DCHECK, kind(), kProfilerTicksOffset, and WRITE_BYTE_FIELD.

Referenced by v8::internal::IC::OnTypeFeedbackChanged(), and v8::internal::RuntimeProfiler::OptimizeNow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_prologue_offset()

void v8::internal::Code::set_prologue_offset ( int  offset)
inline

◆ set_raw_kind_specific_flags1()

void v8::internal::Code::set_raw_kind_specific_flags1 ( int  value)
inline

Definition at line 4659 of file objects-inl.h.

4659  {
4661 }

References kKindSpecificFlags1Offset, and WRITE_INT_FIELD.

◆ set_raw_kind_specific_flags2()

void v8::internal::Code::set_raw_kind_specific_flags2 ( int  value)
inline

Definition at line 4664 of file objects-inl.h.

4664  {
4666 }

References kKindSpecificFlags2Offset, and WRITE_INT_FIELD.

◆ set_safepoint_table_offset()

void v8::internal::Code::set_safepoint_table_offset ( unsigned  offset)
inline

Definition at line 4824 of file objects-inl.h.

4824  {
4825  CHECK(offset <= (1 << kSafepointTableOffsetBitCount));
4827  DCHECK(IsAligned(offset, static_cast<unsigned>(kIntSize)));
4828  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
4829  int updated = SafepointTableOffsetField::update(previous, offset);
4831 }
static const int kSafepointTableOffsetBitCount
Definition: objects.h:5427
const int kIntSize
Definition: globals.h:124

References CHECK, DCHECK, is_crankshafted(), v8::internal::IsAligned(), v8::internal::kIntSize, kKindSpecificFlags2Offset, kSafepointTableOffsetBitCount, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_stack_slots()

void v8::internal::Code::set_stack_slots ( unsigned  slots)
inline

Definition at line 4808 of file objects-inl.h.

4808  {
4809  CHECK(slots <= (1 << kStackSlotsBitCount));
4811  int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
4812  int updated = StackSlotsField::update(previous, slots);
4814 }
static const int kStackSlotsBitCount
Definition: objects.h:5397

References CHECK, DCHECK, is_crankshafted(), kKindSpecificFlags1Offset, kStackSlotsBitCount, READ_UINT32_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_UINT32_FIELD.

+ Here is the call graph for this function:

◆ set_stub_key()

void v8::internal::Code::set_stub_key ( uint32_t  key)
inline

Definition at line 6166 of file objects-inl.h.

6166  {
6168  set_raw_type_feedback_info(Smi::FromInt(key));
6169 }
static Smi * FromInt(int value)
Definition: objects-inl.h:1321

References DCHECK, v8::internal::Smi::FromInt(), and IsCodeStubOrIC().

+ Here is the call graph for this function:

◆ set_type_feedback_info()

void v8::internal::Code::set_type_feedback_info ( Object value,
WriteBarrierMode  mode = UPDATE_WRITE_BARRIER 
)
inline

Definition at line 6151 of file objects-inl.h.

6151  {
6152  DCHECK(kind() == FUNCTION);
6153  set_raw_type_feedback_info(value, mode);
6155  value, mode);
6156 }
#define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode)
Definition: objects-inl.h:1210

References CONDITIONAL_WRITE_BARRIER, DCHECK, v8::internal::HeapObject::GetHeap(), kind(), kTypeFeedbackInfoOffset, and mode().

+ Here is the call graph for this function:

◆ SizeFor()

static int v8::internal::Code::SizeFor ( int  body_size)
inlinestatic

Definition at line 5256 of file objects.h.

5256  {
5259  }
#define DCHECK_SIZE_TAG_ALIGNED(size)
Definition: checks.h:60
const intptr_t kCodeAlignment
Definition: globals.h:240

References DCHECK_SIZE_TAG_ALIGNED, v8::internal::kCodeAlignment, v8::internal::Object::kHeaderSize, and v8::internal::RoundUp().

Referenced by v8::internal::Heap::CopyCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SourcePosition()

int v8::internal::Code::SourcePosition ( Address  pc)

Definition at line 10192 of file objects.cc.

10192  {
10193  int distance = kMaxInt;
10194  int position = RelocInfo::kNoPosition; // Initially no position found.
10195  // Run through all the relocation info to find the best matching source
10196  // position. All the code needs to be considered as the sequence of the
10197  // instructions in the code does not necessarily follow the same order as the
10198  // source.
10200  while (!it.done()) {
10201  // Only look at positions after the current pc.
10202  if (it.rinfo()->pc() < pc) {
10203  // Get position and distance.
10204 
10205  int dist = static_cast<int>(pc - it.rinfo()->pc());
10206  int pos = static_cast<int>(it.rinfo()->data());
10207  // If this position is closer than the current candidate or if it has the
10208  // same distance as the current candidate and the position is higher then
10209  // this position is the new candidate.
10210  if ((dist < distance) ||
10211  (dist == distance && pos > position)) {
10212  position = pos;
10213  distance = dist;
10214  }
10215  }
10216  it.next();
10217  }
10218  return position;
10219 }
static const int kPositionMask
Definition: assembler.h:588
static const int kNoPosition
Definition: assembler.h:317
const int kMaxInt
Definition: globals.h:109

References v8::internal::RelocInfo::data(), v8::internal::RelocIterator::done(), v8::internal::kMaxInt, v8::internal::RelocInfo::kNoPosition, v8::internal::RelocInfo::kPositionMask, v8::internal::RelocIterator::next(), v8::internal::pc, v8::internal::RelocInfo::pc(), and v8::internal::RelocIterator::rinfo().

Referenced by v8::internal::DeoptimizedFrameInfo::DeoptimizedFrameInfo(), v8::internal::JavaScriptFrame::Print(), v8::internal::JavaScriptFrame::PrintFunctionAndOffset(), and SourceStatementPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SourceStatementPosition()

int v8::internal::Code::SourceStatementPosition ( Address  pc)

Definition at line 10224 of file objects.cc.

10224  {
10225  // First find the position as close as possible using all position
10226  // information.
10227  int position = SourcePosition(pc);
10228  // Now find the closest statement position before the position.
10229  int statement_position = 0;
10231  while (!it.done()) {
10232  if (RelocInfo::IsStatementPosition(it.rinfo()->rmode())) {
10233  int p = static_cast<int>(it.rinfo()->data());
10234  if (statement_position < p && p <= position) {
10235  statement_position = p;
10236  }
10237  }
10238  it.next();
10239  }
10240  return statement_position;
10241 }
int SourcePosition(Address pc)
Definition: objects.cc:10192
static bool IsStatementPosition(Mode mode)
Definition: assembler.h:427

References v8::internal::RelocInfo::data(), v8::internal::RelocIterator::done(), v8::internal::RelocInfo::IsStatementPosition(), v8::internal::RelocInfo::kPositionMask, v8::internal::RelocIterator::next(), v8::internal::pc, v8::internal::RelocIterator::rinfo(), v8::internal::RelocInfo::rmode(), and SourcePosition().

Referenced by v8::internal::Debug::StepNextContinue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stack_slots()

unsigned v8::internal::Code::stack_slots ( )
inline

Definition at line 4801 of file objects-inl.h.

4801  {
4803  return StackSlotsField::decode(
4805 }

References DCHECK, v8::internal::BitFieldBase< T, shift, size, U >::decode(), is_crankshafted(), kKindSpecificFlags1Offset, and READ_UINT32_FIELD.

Referenced by v8::internal::Deoptimizer::ComputeInputFrameSize(), and v8::internal::Deoptimizer::DebuggerInspectableFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ STATIC_ASSERT() [1/6]

v8::internal::Code::STATIC_ASSERT ( 1+kSafepointTableOffsetBitCount<=  32)

◆ STATIC_ASSERT() [2/6]

v8::internal::Code::STATIC_ASSERT ( AllowOSRAtLoopNestingLevelField::kMax >=  kMaxLoopNestingMarker)

◆ STATIC_ASSERT() [3/6]

v8::internal::Code::STATIC_ASSERT ( kIsTurbofannedBit+1<=  32)

◆ STATIC_ASSERT() [4/6]

v8::internal::Code::STATIC_ASSERT ( kSafepointTableOffsetFirstBit+kSafepointTableOffsetBitCount<=  32)

◆ STATIC_ASSERT() [5/6]

v8::internal::Code::STATIC_ASSERT ( kStackSlotsFirstBit+kStackSlotsBitCount<=  32)

◆ STATIC_ASSERT() [6/6]

v8::internal::Code::STATIC_ASSERT ( NUMBER_OF_KINDS<=  16)

Referenced by FindAndReplace(), and set_flags().

+ Here is the caller graph for this function:

◆ stub_key()

uint32_t v8::internal::Code::stub_key ( )
inline

Definition at line 6159 of file objects-inl.h.

6159  {
6161  Smi* smi_key = Smi::cast(raw_type_feedback_info());
6162  return static_cast<uint32_t>(smi_key->value());
6163 }

References DCHECK, IsCodeStubOrIC(), and v8::internal::Smi::value().

Referenced by v8::internal::Deoptimizer::DoComputeCompiledStubFrame(), v8::internal::BASE_EMBEDDED< Visitor >::GetMajorKey(), and v8::internal::CodeSerializer::SerializeCodeStub().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ to_boolean_state()

byte v8::internal::Code::to_boolean_state ( )
inline

Definition at line 4857 of file objects-inl.h.

4857  {
4858  return extra_ic_state();
4859 }

References extra_ic_state().

+ Here is the call graph for this function:

◆ TranslateAstIdToPcOffset()

uint32_t v8::internal::Code::TranslateAstIdToPcOffset ( BailoutId  ast_id)

Definition at line 10440 of file objects.cc.

10440  {
10441  DisallowHeapAllocation no_gc;
10442  DCHECK(kind() == FUNCTION);
10443  BackEdgeTable back_edges(this, &no_gc);
10444  for (uint32_t i = 0; i < back_edges.length(); i++) {
10445  if (back_edges.ast_id(i) == ast_id) return back_edges.pc_offset(i);
10446  }
10447  UNREACHABLE(); // We expect to find the back edge.
10448  return 0;
10449 }

References v8::internal::BackEdgeTable::ast_id(), DCHECK, kind(), v8::internal::BackEdgeTable::length(), v8::internal::BackEdgeTable::pc_offset(), and UNREACHABLE.

+ Here is the call graph for this function:

◆ TranslatePcOffsetToAstId()

BailoutId v8::internal::Code::TranslatePcOffsetToAstId ( uint32_t  pc_offset)

Definition at line 10429 of file objects.cc.

10429  {
10430  DisallowHeapAllocation no_gc;
10431  DCHECK(kind() == FUNCTION);
10432  BackEdgeTable back_edges(this, &no_gc);
10433  for (uint32_t i = 0; i < back_edges.length(); i++) {
10434  if (back_edges.pc_offset(i) == pc_offset) return back_edges.ast_id(i);
10435  }
10436  return BailoutId::None();
10437 }
static BailoutId None()
Definition: utils.h:960

References v8::internal::BackEdgeTable::ast_id(), DCHECK, kind(), v8::internal::BackEdgeTable::length(), v8::internal::BailoutId::None(), and v8::internal::BackEdgeTable::pc_offset().

+ Here is the call graph for this function:

◆ type()

Code::StubType v8::internal::Code::type ( )
inline

Definition at line 4653 of file objects-inl.h.

4653  {
4654  return ExtractTypeFromFlags(flags());
4655 }
static StubType ExtractTypeFromFlags(Flags flags)
Definition: objects-inl.h:4996

References ExtractTypeFromFlags(), and flags().

Referenced by ComputeFlags(), ComputeHandlerFlags(), ComputeMonomorphicFlags(), v8::internal::CodeCache::GetIndex(), and v8::internal::CodeCache::RemoveByIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ type_feedback_info()

Object * v8::internal::Code::type_feedback_info ( )
inline

Definition at line 6145 of file objects-inl.h.

6145  {
6146  DCHECK(kind() == FUNCTION);
6147  return raw_type_feedback_info();
6148 }

References DCHECK, and kind().

Referenced by v8::internal::V8HeapExplorer::ExtractCodeReferences(), v8::internal::GetICCounts(), and v8::internal::IC::OnTypeFeedbackChanged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unchecked_relocation_info()

ByteArray * v8::internal::Code::unchecked_relocation_info ( )
inline

Definition at line 6191 of file objects-inl.h.

6191  {
6192  return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset));
6193 }

References kRelocationInfoOffset, and READ_FIELD.

Referenced by relocation_size(), and relocation_start().

+ Here is the caller graph for this function:

◆ WipeOutHeader()

void v8::internal::Code::WipeOutHeader ( )
inline

Definition at line 6133 of file objects-inl.h.

6133  {
6138  // Do not wipe out major/minor keys on a code stub or IC
6139  if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) {
6141  }
6142 }

References NULL, READ_FIELD, and WRITE_FIELD.

Referenced by v8::internal::Serializer::ObjectSerializer::OutputRawData().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Deoptimizer

friend class Deoptimizer
friend

Definition at line 5453 of file objects.h.

◆ RelocIterator

friend class RelocIterator
friend

Definition at line 5452 of file objects.h.

Member Data Documentation

◆ kArgumentsBits

const int v8::internal::Code::kArgumentsBits = 16
static

Definition at line 5444 of file objects.h.

◆ kConstantPoolOffset

const int v8::internal::Code::kConstantPoolOffset = kPrologueOffset + kPointerSize
static

◆ kDeoptimizationDataOffset

const int v8::internal::Code::kDeoptimizationDataOffset
static

◆ kFlagsNotUsedInLookup

const int v8::internal::Code::kFlagsNotUsedInLookup
static

◆ kFlagsOffset

const int v8::internal::Code::kFlagsOffset = kICAgeOffset + kIntSize
static

Definition at line 5361 of file objects.h.

Referenced by flags(), and set_flags().

◆ kFullCodeFlags

◆ kGCMetadataOffset

const int v8::internal::Code::kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize
static

Definition at line 5358 of file objects.h.

Referenced by v8::internal::V8HeapExplorer::ExtractCodeReferences().

◆ kHandlerTableOffset

const int v8::internal::Code::kHandlerTableOffset = kRelocationInfoOffset + kPointerSize
static

◆ kHasFunctionCacheBit

const int v8::internal::Code::kHasFunctionCacheBit
static
Initial value:

Definition at line 5398 of file objects.h.

◆ kHeaderPaddingStart

const int v8::internal::Code::kHeaderPaddingStart = kConstantPoolOffset + kIntSize
static

Definition at line 5369 of file objects.h.

◆ kHeaderSize

◆ kICAgeOffset

const int v8::internal::Code::kICAgeOffset
static
Initial value:

Definition at line 5359 of file objects.h.

◆ kInstructionSizeOffset

const int v8::internal::Code::kInstructionSizeOffset = HeapObject::kHeaderSize
static

Definition at line 5349 of file objects.h.

◆ kInvalidatedWeakStubBit

const int v8::internal::Code::kInvalidatedWeakStubBit = kWeakStubBit + 1
static

Definition at line 5402 of file objects.h.

◆ kIsCrankshaftedBit

const int v8::internal::Code::kIsCrankshaftedBit = 0
static

Definition at line 5421 of file objects.h.

◆ kIsTurbofannedBit

const int v8::internal::Code::kIsTurbofannedBit = kInvalidatedWeakStubBit + 1
static

Definition at line 5403 of file objects.h.

◆ kKindSpecificFlags1Offset

◆ kKindSpecificFlags2Offset

◆ kMarkedForDeoptimizationBit

const int v8::internal::Code::kMarkedForDeoptimizationBit = kHasFunctionCacheBit + 1
static

Definition at line 5400 of file objects.h.

◆ kMaxArguments

◆ kMaxLoopNestingMarker

◆ kNextCodeLinkOffset

◆ kOptimizableOffset

const int v8::internal::Code::kOptimizableOffset = kKindSpecificFlags1Offset
static

Definition at line 5377 of file objects.h.

Referenced by optimizable(), and set_optimizable().

◆ kProfilerTicksOffset

const int v8::internal::Code::kProfilerTicksOffset = kFullCodeFlags + 1
static

Definition at line 5385 of file objects.h.

Referenced by profiler_ticks(), and set_profiler_ticks().

◆ kPrologueOffset

const int v8::internal::Code::kPrologueOffset = kKindSpecificFlags2Offset + kIntSize
static

Definition at line 5366 of file objects.h.

◆ kPrologueOffsetNotSet

◆ kRelocationInfoOffset

const int v8::internal::Code::kRelocationInfoOffset = kInstructionSizeOffset + kIntSize
static

◆ kSafepointTableOffsetBitCount

const int v8::internal::Code::kSafepointTableOffsetBitCount = 24
static

Definition at line 5427 of file objects.h.

Referenced by set_safepoint_table_offset().

◆ kSafepointTableOffsetFirstBit

const int v8::internal::Code::kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1
static

Definition at line 5426 of file objects.h.

◆ kStackSlotsBitCount

const int v8::internal::Code::kStackSlotsBitCount = 24
static

Definition at line 5397 of file objects.h.

Referenced by set_stack_slots().

◆ kStackSlotsFirstBit

const int v8::internal::Code::kStackSlotsFirstBit = 0
static

Definition at line 5396 of file objects.h.

◆ kTypeFeedbackInfoOffset

const int v8::internal::Code::kTypeFeedbackInfoOffset
static

◆ kWeakStubBit

const int v8::internal::Code::kWeakStubBit = kMarkedForDeoptimizationBit + 1
static

Definition at line 5401 of file objects.h.


The documentation for this class was generated from the following files: