40 #define IC_UTIL_LIST(ICU) \
42 ICU(KeyedLoadIC_Miss) \
43 ICU(KeyedLoadIC_MissForceGeneric) \
45 ICU(KeyedCallIC_Miss) \
47 ICU(StoreIC_ArrayLength) \
48 ICU(SharedStoreIC_ExtendStorage) \
49 ICU(KeyedStoreIC_Miss) \
50 ICU(KeyedStoreIC_MissForceGeneric) \
51 ICU(KeyedStoreIC_Slow) \
53 ICU(LoadCallbackProperty) \
54 ICU(StoreCallbackProperty) \
55 ICU(LoadPropertyWithInterceptorOnly) \
56 ICU(LoadPropertyWithInterceptorForLoad) \
57 ICU(LoadPropertyWithInterceptorForCall) \
58 ICU(KeyedLoadPropertyWithInterceptor) \
59 ICU(StoreInterceptorProperty) \
72 #define CONST_NAME(name) k##name,
116 if (receiver->IsGlobalObject()) {
125 return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT;
142 #ifdef ENABLE_DEBUGGER_SUPPORT
145 Address OriginalCodeAddress()
const;
152 char TransitionMarkFromState(
IC::State state);
154 void TraceIC(
const char* type,
182 DISALLOW_IMPLICIT_CONSTRUCTORS(
IC);
191 : address_(
IC::AddressFromUtilityId(id)), id_(id) {}
344 bool support_wrappers);
350 void UpdateCaches(LookupResult* lookup,
359 static Code* initialize_stub() {
360 return Isolate::Current()->builtins()->
builtin(
361 Builtins::kLoadIC_Initialize);
363 Handle<Code> pre_monomorphic_stub() {
418 stub_kind =
static_cast<StubKind>(
static_cast<int>(stub_kind) +
462 static bool IsTransitionStubKind(
StubKind stub_kind) {
467 static bool IsGrowStubKind(
StubKind stub_kind) {
472 if (!IsTransitionStubKind(stub_kind))
return stub_kind;
488 bool force_generic_stub);
517 return target() == *generic_stub();
533 void UpdateCaches(LookupResult* lookup,
539 static Code* initialize_stub() {
540 return Isolate::Current()->builtins()->builtin(
541 Builtins::kKeyedLoadIC_Initialize);
546 Handle<Code> generic_stub()
const {
549 Handle<Code> pre_monomorphic_stub() {
552 Handle<Code> indexed_interceptor_stub() {
555 Handle<Code> non_strict_arguments_stub() {
590 void UpdateCaches(LookupResult* lookup,
605 Code* megamorphic_stub() {
607 Builtins::kStoreIC_Megamorphic);
609 Code* megamorphic_stub_strict() {
611 Builtins::kStoreIC_Megamorphic_Strict);
613 static Code* initialize_stub() {
614 return Isolate::Current()->builtins()->builtin(
615 Builtins::kStoreIC_Initialize);
617 static Code* initialize_stub_strict() {
618 return Isolate::Current()->builtins()->builtin(
619 Builtins::kStoreIC_Initialize_Strict);
621 Handle<Code> global_proxy_stub() {
624 Handle<Code> global_proxy_stub_strict() {
678 return target() == *generic_stub() ||
679 target() == *generic_stub_strict();
691 void UpdateCaches(LookupResult* lookup,
698 void set_target(
Code* code) {
706 static Code* initialize_stub() {
707 return Isolate::Current()->builtins()->builtin(
708 Builtins::kKeyedStoreIC_Initialize);
710 static Code* initialize_stub_strict() {
711 return Isolate::Current()->builtins()->builtin(
712 Builtins::kKeyedStoreIC_Initialize_Strict);
714 Handle<Code> megamorphic_stub() {
717 Handle<Code> megamorphic_stub_strict() {
720 Handle<Code> generic_stub()
const {
723 Handle<Code> generic_stub_strict()
const {
726 Handle<Code> non_strict_arguments_stub() {
732 StubKind GetStubKind(Handle<JSObject> receiver,
734 Handle<Object> value);
827 State TargetState(
State state,
bool has_inlined_smi_code,
830 bool strict()
const {
return op_ == Token::EQ_STRICT; }
virtual Handle< Code > string_stub()
static TypeInfo GetTypeInfo(Handle< Object > operand)
static void GenerateTransitionElementsDoubleToObject(MacroAssembler *masm)
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
Code * builtin(Name name)
void UpdateCaches(LookupResult *lookup, State state, Code::ExtraICState extra_ic_state, Handle< Object > object, Handle< String > name)
virtual Code::Kind kind() const
virtual Code::Kind kind() const =0
static void GenerateNormal(MacroAssembler *masm, int argc)
virtual bool IsGeneric() const
static void GenerateGeneric(MacroAssembler *masm, StrictModeFlag strict_mode)
IC_Utility(IC::UtilityId id)
static const char * GetName(TypeInfo type_info)
virtual Handle< Code > GetElementStubWithoutMapCheck(bool is_js_array, ElementsKind elements_kind, KeyedAccessGrowMode grow_mode)
static void GenerateMiss(MacroAssembler *masm, int argc, IC::UtilityId id, Code::ExtraICState extra_state)
MUST_USE_RESULT MaybeObject * LoadFunction(State state, Handle< Object > object, Handle< Object > key)
MUST_USE_RESULT MaybeObject * Load(State state, Handle< Object > object, Handle< String > name)
CompareIC(Isolate *isolate, Token::Value op)
static void GenerateGlobalProxy(MacroAssembler *masm, StrictModeFlag strict_mode)
static const int kGrowICDelta
static void GenerateMegamorphic(MacroAssembler *masm, StrictModeFlag strict_mode)
static void GenerateStringLength(MacroAssembler *masm, bool support_wrappers)
static const int kIsAccessCheckNeeded
static void GenerateMegamorphic(MacroAssembler *masm)
Failure * TypeError(const char *type, Handle< Object > object, Handle< Object > key)
#define ASSERT(condition)
static State StateFrom(Code *target, Object *receiver, Object *name)
static StubKind GetGrowStubKind(StubKind stub_kind)
static TypeInfo GetTypeInfo(Handle< Object > left, Handle< Object > right)
static const char * GetName(TypeInfo type_info)
Isolate * isolate() const
static const ExtraICState kNoExtraICState
KeyedCallIC(Isolate *isolate)
MUST_USE_RESULT MaybeObject * Store(State state, StrictModeFlag strict_mode, Handle< Object > object, Handle< String > name, Handle< Object > value)
static State ToState(TypeInfo type_info)
void ReceiverToObjectIfRequired(Handle< Object > callee, Handle< Object > object)
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check)
static void GenerateArrayLength(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm, int argc, Code::ExtraICState extra_state)
static const int kHasIndexedInterceptor
void UpdateCaches(Handle< Object > x, Handle< Object > y)
KeyedIC(Isolate *isolate)
static Condition ComputeCondition(Token::Value op)
static void PostPatching(Address address, Code *target, Code *old_target)
static void GenerateInitialize(MacroAssembler *masm)
static KeyedAccessGrowMode GetGrowModeFromStubKind(StubKind stub_kind)
IC(FrameDepth depth, Isolate *isolate)
static StrictModeFlag GetStrictMode(ExtraICState extra_ic_state)
static void GeneratePreMonomorphic(MacroAssembler *masm)
static void GenerateGeneric(MacroAssembler *masm)
static Code * GetTargetAtAddress(Address address)
static void GenerateInitialize(MacroAssembler *masm)
KeyedLoadIC(Isolate *isolate)
static void GenerateMiss(MacroAssembler *masm)
static void GenerateNormal(MacroAssembler *masm, int argc)
UnaryOpIC(Isolate *isolate)
ToBooleanIC(Isolate *isolate)
MUST_USE_RESULT MaybeObject * LoadFunction(State state, Code::ExtraICState extra_ic_state, Handle< Object > object, Handle< String > name)
StoreIC(Isolate *isolate)
static void Clear(Address address, Code *target)
static State ToState(TypeInfo type_info)
virtual bool IsGeneric() const
virtual Handle< Code > GetElementStubWithoutMapCheck(bool is_js_array, ElementsKind elements_kind, KeyedAccessGrowMode grow_mode)
STATIC_ASSERT(kGrowICDelta==STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT-STORE_TRANSITION_SMI_TO_OBJECT)
static void GenerateMegamorphic(MacroAssembler *masm, int argc)
virtual Handle< Code > ComputePolymorphicStub(MapHandleList *receiver_maps, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)
static TypeInfo ComputeNewType(TypeInfo type, TypeInfo previous)
Handle< Object > TryCallAsFunction(Handle< Object > object)
static void GenerateSlow(MacroAssembler *masm)
static void GenerateMiss(MacroAssembler *masm, int argc, Code::ExtraICState extra_state)
static void GenerateRuntimeSetProperty(MacroAssembler *masm, StrictModeFlag strict_mode)
MUST_USE_RESULT MaybeObject * Load(State state, Handle< Object > object, Handle< Object > key, bool force_generic_stub)
static const int kSlowCaseBitFieldMask
KeyedStoreIncrementLength
static void GenerateNormal(MacroAssembler *masm, int argc)
#define IC_UTIL_LIST(ICU)
ExtraICState extra_ic_state()
static void GenerateMonomorphicCacheProbe(MacroAssembler *masm, int argc, Code::Kind kind, Code::ExtraICState extra_state)
static void GenerateString(MacroAssembler *masm)
static Token::Value ComputeOperation(Code *target)
static Handle< T > null()
virtual Handle< Code > ComputePolymorphicStub(MapHandleList *receiver_maps, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)
CallICBase(Code::Kind kind, Isolate *isolate)
static JSObject * GetCodeCacheHolder(Object *object, InlineCacheHolderFlag holder)
static void SetTargetAtAddress(Address address, Code *target)
virtual Handle< Code > ComputePolymorphicStub(MapHandleList *receiver_maps, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)=0
static void GenerateNonStrictArguments(MacroAssembler *masm)
static State ComputeState(Code *target)
virtual Handle< Code > string_stub()
static void GenerateMegamorphic(MacroAssembler *masm, int argc, Code::ExtraICState extra_ic_state)
Handle< Code > ComputeMonomorphicStub(LookupResult *lookup, State state, Code::ExtraICState extra_state, Handle< Object > object, Handle< String > name)
Handle< Code > ComputeStub(Handle< JSObject > receiver, StubKind stub_kind, StrictModeFlag strict_mode, Handle< Code > default_stub)
static void GenerateNormal(MacroAssembler *masm)
static void GenerateFunctionPrototype(MacroAssembler *masm)
static void GenerateIndexedInterceptor(MacroAssembler *masm)
bool TryUpdateExtraICState(LookupResult *lookup, Handle< Object > object, Code::ExtraICState *extra_ic_state)
static void GenerateInitialize(MacroAssembler *masm)
void set_target(Code *code)
virtual Handle< Code > GetElementStubWithoutMapCheck(bool is_js_array, ElementsKind elements_kind, KeyedAccessGrowMode grow_mode)=0
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static TypeInfo JoinTypes(TypeInfo x, TypeInfo y)
KeyedStoreIC(Isolate *isolate)
static void GenerateNonStrictArguments(MacroAssembler *masm)
BinaryOpIC(Isolate *isolate)
static void GenerateMiss(MacroAssembler *masm, bool force_generic)
virtual Code::Kind kind() const
static void GenerateMiss(MacroAssembler *masm)
static void GenerateTransitionElementsSmiToDouble(MacroAssembler *masm)
static void GenerateNonStrictArguments(MacroAssembler *masm, int argc)
static void GenerateArrayLength(MacroAssembler *masm)
static const char * GetStateName(State state)
MUST_USE_RESULT MaybeObject * Store(State state, StrictModeFlag strict_mode, Handle< Object > object, Handle< Object > name, Handle< Object > value, bool force_generic)
RelocInfo::Mode ComputeMode()
static Address AddressFromUtilityId(UtilityId id)
static Handle< Code > GetUninitialized(Token::Value op)
void check(i::Vector< const char > string)
static InlineCacheHolderFlag GetCodeCacheForObject(Object *object, JSObject *holder)
bool IsContextual(Handle< Object > receiver)
static void GenerateInitialize(MacroAssembler *masm)
Failure * ReferenceError(const char *type, Handle< String > name)
static void GeneratePreMonomorphic(MacroAssembler *masm)
static void GenerateMiss(MacroAssembler *masm, int argc)
Handle< Code > ComputeMonomorphicStubWithoutMapCheck(Handle< Map > receiver_map, StrictModeFlag strict_mode, KeyedAccessGrowMode grow_mode)
static void Clear(Address address)
virtual bool IsGeneric() const
static void GenerateNormal(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm, int argc)
static void GenerateMiss(MacroAssembler *masm, bool force_generic)