V8 Project
ic.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_IC_H_
6 #define V8_IC_H_
7 
8 #include "src/ic/ic-state.h"
9 #include "src/macro-assembler.h"
10 
11 namespace v8 {
12 namespace internal {
13 
14 
15 // IC_UTIL_LIST defines all utility functions called from generated
16 // inline caching code. The argument for the macro, ICU, is the function name.
17 #define IC_UTIL_LIST(ICU) \
18  ICU(LoadIC_Miss) \
19  ICU(KeyedLoadIC_Miss) \
20  ICU(CallIC_Miss) \
21  ICU(CallIC_Customization_Miss) \
22  ICU(StoreIC_Miss) \
23  ICU(StoreIC_Slow) \
24  ICU(SharedStoreIC_ExtendStorage) \
25  ICU(KeyedStoreIC_Miss) \
26  ICU(KeyedStoreIC_Slow) \
27  /* Utilities for IC stubs. */ \
28  ICU(StoreCallbackProperty) \
29  ICU(LoadPropertyWithInterceptorOnly) \
30  ICU(LoadPropertyWithInterceptor) \
31  ICU(LoadElementWithInterceptor) \
32  ICU(StorePropertyWithInterceptor) \
33  ICU(CompareIC_Miss) \
34  ICU(BinaryOpIC_Miss) \
35  ICU(CompareNilIC_Miss) \
36  ICU(Unreachable) \
37  ICU(ToBooleanIC_Miss)
38 //
39 // IC is the base class for LoadIC, StoreIC, KeyedLoadIC, and KeyedStoreIC.
40 //
41 class IC {
42  public:
43  // The ids for utility called from the generated code.
44  enum UtilityId {
45 #define CONST_NAME(name) k##name,
47 #undef CONST_NAME
49  };
50 
51  // Looks up the address of the named utility.
53 
54  // Alias the inline cache state type to make the IC code more readable.
56 
57  // The IC code is either invoked with no extra frames on the stack
58  // or with a single extra frame for supporting calls.
60 
61  // Construct the IC structure with the given number of extra
62  // JavaScript frames on the stack.
63  IC(FrameDepth depth, Isolate* isolate);
64  virtual ~IC() {}
65 
66  State state() const { return state_; }
67  inline Address address() const;
68 
69  // Compute the current IC state based on the target stub, receiver and name.
71 
76  }
77 
78  // If the stub contains weak maps then this function adds the stub to
79  // the dependent code array of each weak map.
80  static void RegisterWeakMapDependency(Handle<Code> stub);
81 
82  // This function is called when a weak map in the stub is dying,
83  // invalidates the stub by setting maps in it to undefined.
84  static void InvalidateMaps(Code* stub);
85 
86  // Clear the inline cache to initial state.
87  static void Clear(Isolate* isolate, Address address,
89 
90 #ifdef DEBUG
91  bool IsLoadStub() const {
92  return target()->is_load_stub() || target()->is_keyed_load_stub();
93  }
94 
95  bool IsStoreStub() const {
96  return target()->is_store_stub() || target()->is_keyed_store_stub();
97  }
98 
99  bool IsCallStub() const { return target()->is_call_stub(); }
100 #endif
101 
102  template <class TypeClass>
103  static JSFunction* GetRootConstructor(TypeClass* type,
104  Context* native_context);
105  static inline Handle<Map> GetHandlerCacheHolder(HeapType* type,
106  bool receiver_is_holder,
107  Isolate* isolate,
109  static inline Handle<Map> GetICCacheHolder(HeapType* type, Isolate* isolate,
111 
112  static bool IsCleared(Code* code) {
113  InlineCacheState state = code->ic_state();
114  return state == UNINITIALIZED || state == PREMONOMORPHIC;
115  }
116 
117  // Utility functions to convert maps to types and back. There are two special
118  // cases:
119  // - The heap_number_map is used as a marker which includes heap numbers as
120  // well as smis.
121  // - The oddball map is only used for booleans.
122  static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate);
123  template <class T>
124  static typename T::TypeHandle MapToType(Handle<Map> map,
125  typename T::Region* region);
126 
128  Isolate* isolate);
129 
130  protected:
131  // Get the call-site target; used for determining the state.
132  Handle<Code> target() const { return target_; }
133 
134  Address fp() const { return fp_; }
135  Address pc() const { return *pc_address_; }
136  Isolate* isolate() const { return isolate_; }
137 
138  // Get the shared function info of the caller.
140  // Get the code object of the caller.
141  Code* GetCode() const;
142  // Get the original (non-breakpointed) code object of the caller.
143  Code* GetOriginalCode() const;
144 
145  // Set the call-site target.
146  inline void set_target(Code* code);
147  bool is_target_set() { return target_set_; }
148 
150  void TraceIC(const char* type, Handle<Object> name);
151  void TraceIC(const char* type, Handle<Object> name, State old_state,
152  State new_state);
153 
154  MaybeHandle<Object> TypeError(const char* type, Handle<Object> object,
155  Handle<Object> key);
157 
158  // Access the target code for the given IC address.
159  static inline Code* GetTargetAtAddress(Address address,
161  static inline void SetTargetAtAddress(Address address, Code* target,
164  State old_state, State new_state,
165  bool target_remains_ic_stub);
166  static void PostPatching(Address address, Code* target, Code* old_target);
167 
168  // Compute the handler either by compiling or by retrieving a cached version.
169  Handle<Code> ComputeHandler(LookupIterator* lookup,
171  virtual Handle<Code> CompileHandler(LookupIterator* lookup,
172  Handle<Object> value,
173  CacheHolderFlag cache_holder) {
174  UNREACHABLE();
175  return Handle<Code>::null();
176  }
177 
180  void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code);
181 
183  bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map);
185  Code::Kind kind() const { return kind_; }
187  if (kind_ == Code::KEYED_LOAD_IC) return Code::LOAD_IC;
188  DCHECK(kind_ == Code::LOAD_IC || kind_ == Code::STORE_IC ||
189  kind_ == Code::KEYED_STORE_IC);
190  return kind_;
191  }
193  UNREACHABLE();
194  return Handle<Code>::null();
195  }
196 
199 
202 
206  }
207 
208  void TargetMaps(MapHandleList* list) {
209  FindTargetMaps();
210  for (int i = 0; i < target_maps_.length(); i++) {
211  list->Add(target_maps_.at(i));
212  }
213  }
214 
216  FindTargetMaps();
217  for (int i = 0; i < target_maps_.length(); i++) {
218  list->Add(MapToType<HeapType>(target_maps_.at(i), isolate_));
219  }
220  }
221 
223  FindTargetMaps();
224  return target_maps_.length() > 0 ? *target_maps_.at(0) : NULL;
225  }
226 
227  protected:
228  inline void UpdateTarget();
229 
230  private:
231  inline Code* raw_target() const;
232  inline ConstantPoolArray* constant_pool() const;
233  inline ConstantPoolArray* raw_constant_pool() const;
234 
235  void FindTargetMaps() {
236  if (target_maps_set_) return;
237  target_maps_set_ = true;
238  if (state_ == MONOMORPHIC) {
239  Map* map = target_->FindFirstMap();
240  if (map != NULL) target_maps_.Add(handle(map));
241  } else if (state_ != UNINITIALIZED && state_ != PREMONOMORPHIC) {
242  target_->FindAllMaps(&target_maps_);
243  }
244  }
245 
246  // Frame pointer for the frame that uses (calls) the IC.
248 
249  // All access to the program counter of an IC structure is indirect
250  // to make the code GC safe. This feature is crucial since
251  // GetProperty and SetProperty are called and they in turn might
252  // invoke the garbage collector.
254 
256 
257  // The constant pool of the code which originally called the IC (which might
258  // be for the breakpointed copy of the original code).
260 
261  // The original code target that missed.
268 
272 
274 };
275 
276 
277 // An IC_Utility encapsulates IC::UtilityId. It exists mainly because you
278 // cannot make forward declarations to an enum.
279 class IC_Utility {
280  public:
282  : address_(IC::AddressFromUtilityId(id)), id_(id) {}
283 
284  Address address() const { return address_; }
285 
286  IC::UtilityId id() const { return id_; }
287 
288  private:
291 };
292 
293 
294 class CallIC : public IC {
295  public:
297 
298  void PatchMegamorphic(Handle<Object> function,
300 
301  void HandleMiss(Handle<Object> receiver, Handle<Object> function,
303 
304  // Returns true if a custom handler was installed.
305  bool DoCustomHandler(Handle<Object> receiver, Handle<Object> function,
307  const CallICState& state);
308 
309  // Code generator routines.
310  static Handle<Code> initialize_stub(Isolate* isolate, int argc,
311  CallICState::CallType call_type);
312 
313  static void Clear(Isolate* isolate, Address address, Code* target,
315 
316  private:
318  Handle<Smi> slot) const;
319 };
320 
321 
322 class LoadIC : public IC {
323  public:
325  return LoadICState(contextual_mode).GetExtraICState();
326  }
327 
329  return LoadICState::GetContextualMode(extra_ic_state());
330  }
331 
332  explicit LoadIC(FrameDepth depth, Isolate* isolate) : IC(depth, isolate) {
333  DCHECK(IsLoadStub());
334  }
335 
336  // Returns if this IC is for contextual (no explicit receiver)
337  // access to properties.
339  if (receiver->IsGlobalObject()) {
340  return contextual_mode() == CONTEXTUAL;
341  } else {
343  return false;
344  }
345  }
346 
347  // Code generator routines.
348  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
350  GenerateMiss(masm);
351  }
352  static void GenerateMiss(MacroAssembler* masm);
353  static void GenerateNormal(MacroAssembler* masm);
355 
357  ExtraICState extra_state);
358 
361 
362  protected:
363  inline void set_target(Code* code);
364 
366  if (kind() == Code::LOAD_IC) {
367  return isolate()->builtins()->LoadIC_Slow();
368  } else {
369  DCHECK_EQ(Code::KEYED_LOAD_IC, kind());
370  return isolate()->builtins()->KeyedLoadIC_Slow();
371  }
372  }
373 
375 
376  // Update the inline cache and the global stub cache based on the
377  // lookup result.
378  void UpdateCaches(LookupIterator* lookup);
379 
380  virtual Handle<Code> CompileHandler(LookupIterator* lookup,
381  Handle<Object> unused,
382  CacheHolderFlag cache_holder);
383 
384  private:
385  virtual Handle<Code> pre_monomorphic_stub() const;
387  ExtraICState extra_state);
388 
389  Handle<Code> SimpleFieldLoad(FieldIndex index);
390 
391  static void Clear(Isolate* isolate, Address address, Code* target,
393 
394  friend class IC;
395 };
396 
397 
398 class KeyedLoadIC : public LoadIC {
399  public:
401  : LoadIC(depth, isolate) {
402  DCHECK(target()->is_keyed_load_stub());
403  }
404 
406  Handle<Object> key);
407 
408  // Code generator routines.
409  static void GenerateMiss(MacroAssembler* masm);
411  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
413  GenerateMiss(masm);
414  }
415  static void GenerateGeneric(MacroAssembler* masm);
416  static void GenerateString(MacroAssembler* masm);
417 
418  // Bit mask to be tested against bit field for the cases when
419  // generic stub should go into slow case.
420  // Access check is necessary explicitly since generic stub does not perform
421  // map checks.
422  static const int kSlowCaseBitFieldMask =
424 
425  static Handle<Code> generic_stub(Isolate* isolate);
427 
428  protected:
429  Handle<Code> LoadElementStub(Handle<JSObject> receiver);
431  return pre_monomorphic_stub(isolate());
432  }
433 
434  private:
437  return isolate()->builtins()->KeyedLoadIC_String();
438  }
439 
440  static void Clear(Isolate* isolate, Address address, Code* target,
442 
443  friend class IC;
444 };
445 
446 
447 class StoreIC : public IC {
448  public:
449  class StrictModeState : public BitField<StrictMode, 1, 1> {};
451  return StrictModeState::encode(flag);
452  }
454  return StrictModeState::decode(state);
455  }
456 
457  // For convenience, a statically declared encoding of strict mode extra
458  // IC state.
459  static const ExtraICState kStrictModeState = 1 << StrictModeState::kShift;
460 
462  DCHECK(IsStoreStub());
463  }
464 
466  return StrictModeState::decode(extra_ic_state());
467  }
468 
469  // Code generators for stub routines. Only called once at startup.
470  static void GenerateSlow(MacroAssembler* masm);
471  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
473  GenerateMiss(masm);
474  }
475  static void GenerateMiss(MacroAssembler* masm);
477  static void GenerateNormal(MacroAssembler* masm);
479  StrictMode strict_mode);
480 
481  static Handle<Code> initialize_stub(Isolate* isolate, StrictMode strict_mode);
482 
485  JSReceiver::StoreFromKeyed store_mode =
487 
488  bool LookupForWrite(LookupIterator* it, Handle<Object> value,
489  JSReceiver::StoreFromKeyed store_mode);
490 
491  protected:
493 
494  // Stub accessors.
495  Handle<Code> generic_stub() const;
496 
497  Handle<Code> slow_stub() const;
498 
499  virtual Handle<Code> pre_monomorphic_stub() const {
500  return pre_monomorphic_stub(isolate(), strict_mode());
501  }
502 
504  StrictMode strict_mode);
505 
506  // Update the inline cache and the global stub cache based on the
507  // lookup result.
508  void UpdateCaches(LookupIterator* lookup, Handle<Object> value,
509  JSReceiver::StoreFromKeyed store_mode);
510  virtual Handle<Code> CompileHandler(LookupIterator* lookup,
511  Handle<Object> value,
512  CacheHolderFlag cache_holder);
513 
514  private:
515  inline void set_target(Code* code);
516 
517  static void Clear(Isolate* isolate, Address address, Code* target,
519 
520  friend class IC;
521 };
522 
523 
525 
526 
528 
529 
530 class KeyedStoreIC : public StoreIC {
531  public:
532  // ExtraICState bits (building on IC)
533  // ExtraICState bits
535  : public BitField<KeyedAccessStoreMode, 2, 4> {}; // NOLINT
536 
539  return StrictModeState::encode(flag) |
540  ExtraICStateKeyedAccessStoreMode::encode(mode);
541  }
542 
544  ExtraICState extra_state) {
545  return ExtraICStateKeyedAccessStoreMode::decode(extra_state);
546  }
547 
549  DCHECK(target()->is_keyed_store_stub());
550  }
551 
554  Handle<Object> value);
555 
556  // Code generators for stub routines. Only called once at startup.
557  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
559  GenerateMiss(masm);
560  }
561  static void GenerateMiss(MacroAssembler* masm);
562  static void GenerateSlow(MacroAssembler* masm);
563  static void GenerateGeneric(MacroAssembler* masm, StrictMode strict_mode);
565 
566  protected:
568  return pre_monomorphic_stub(isolate(), strict_mode());
569  }
571  StrictMode strict_mode) {
572  if (strict_mode == STRICT) {
573  return isolate->builtins()->KeyedStoreIC_PreMonomorphic_Strict();
574  } else {
575  return isolate->builtins()->KeyedStoreIC_PreMonomorphic();
576  }
577  }
578 
580  KeyedAccessStoreMode store_mode);
581 
582  private:
583  inline void set_target(Code* code);
584 
585  // Stub accessors.
587  return isolate()->builtins()->KeyedStoreIC_SloppyArguments();
588  }
589 
590  static void Clear(Isolate* isolate, Address address, Code* target,
592 
593  KeyedAccessStoreMode GetStoreMode(Handle<JSObject> receiver,
594  Handle<Object> key, Handle<Object> value);
595 
596  Handle<Map> ComputeTransitionedMap(Handle<Map> map,
597  KeyedAccessStoreMode store_mode);
598 
599  friend class IC;
600 };
601 
602 
603 // Type Recording BinaryOpIC, that records the types of the inputs and outputs.
604 class BinaryOpIC : public IC {
605  public:
607 
608  static Builtins::JavaScript TokenToJSBuiltin(Token::Value op);
609 
610  MaybeHandle<Object> Transition(Handle<AllocationSite> allocation_site,
611  Handle<Object> left,
613 };
614 
615 
616 class CompareIC : public IC {
617  public:
619  : IC(EXTRA_CALL_FRAME, isolate), op_(op) {}
620 
621  // Update the inline cache for the given operands.
623 
624  // Helper function for computing the condition for a compare operation.
626 
627  // Factory method for getting an uninitialized compare stub.
628  static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op);
629 
630  private:
632 
633  bool strict() const { return op_ == Token::EQ_STRICT; }
634  Condition GetCondition() const { return ComputeCondition(op_); }
635 
636  static Code* GetRawUninitialized(Isolate* isolate, Token::Value op);
637 
638  static void Clear(Isolate* isolate, Address address, Code* target,
640 
642 
643  friend class IC;
644 };
645 
646 
647 class CompareNilIC : public IC {
648  public:
650 
651  Handle<Object> CompareNil(Handle<Object> object);
652 
654 
655  static void Clear(Address address, Code* target,
657 
658  static Handle<Object> DoCompareNilSlow(Isolate* isolate, NilValue nil,
659  Handle<Object> object);
660 };
661 
662 
663 class ToBooleanIC : public IC {
664  public:
666 
667  Handle<Object> ToBoolean(Handle<Object> object);
668 };
669 
670 
671 // Helper for BinaryOpIC and CompareIC.
674 
675 DECLARE_RUNTIME_FUNCTION(KeyedLoadIC_MissFromStubFailure);
676 DECLARE_RUNTIME_FUNCTION(KeyedStoreIC_MissFromStubFailure);
677 DECLARE_RUNTIME_FUNCTION(UnaryOpIC_Miss);
678 DECLARE_RUNTIME_FUNCTION(StoreIC_MissFromStubFailure);
679 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss);
680 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss);
681 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite);
682 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss);
683 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss);
684 DECLARE_RUNTIME_FUNCTION(VectorLoadIC_MissFromStubFailure);
685 DECLARE_RUNTIME_FUNCTION(VectorKeyedLoadIC_MissFromStubFailure);
686 
687 // Support functions for callbacks handlers.
688 DECLARE_RUNTIME_FUNCTION(StoreCallbackProperty);
689 
690 // Support functions for interceptor handlers.
691 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly);
692 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor);
693 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor);
694 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor);
695 }
696 } // namespace v8::internal
697 
698 #endif // V8_IC_H_
BinaryOpIC(Isolate *isolate)
Definition: ic.h:606
void PatchMegamorphic(Handle< Object > function, Handle< TypeFeedbackVector > vector, Handle< Smi > slot)
Definition: ic.cc:1926
bool DoCustomHandler(Handle< Object > receiver, Handle< Object > function, Handle< TypeFeedbackVector > vector, Handle< Smi > slot, const CallICState &state)
Definition: ic.cc:1891
static void Clear(Isolate *isolate, Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic.cc:521
static Handle< Code > initialize_stub(Isolate *isolate, int argc, CallICState::CallType call_type)
Definition: ic.cc:1338
IC::State FeedbackToState(Handle< TypeFeedbackVector > vector, Handle< Smi > slot) const
Definition: ic-inl.h:211
CallIC(Isolate *isolate)
Definition: ic.h:296
void HandleMiss(Handle< Object > receiver, Handle< Object > function, Handle< TypeFeedbackVector > vector, Handle< Smi > slot)
Definition: ic.cc:1953
InlineCacheState ic_state()
Definition: objects-inl.h:4635
static bool HasInlinedSmiCode(Address address)
CompareIC(Isolate *isolate, Token::Value op)
Definition: ic.h:618
static Condition ComputeCondition(Token::Value op)
Token::Value op_
Definition: ic.h:641
Condition GetCondition() const
Definition: ic.h:634
bool strict() const
Definition: ic.h:633
CompareNilIC(Isolate *isolate)
Definition: ic.h:649
static Handle< Code > GetUninitialized()
static Handle< T > null()
Definition: handles.h:123
IC::UtilityId id() const
Definition: ic.h:286
Address address() const
Definition: ic.h:284
IC::UtilityId id_
Definition: ic.h:290
Address address_
Definition: ic.h:289
IC_Utility(IC::UtilityId id)
Definition: ic.h:281
static void PostPatching(Address address, Code *target, Code *old_target)
Definition: ic.cc:422
MaybeHandle< Object > TypeError(const char *type, Handle< Object > object, Handle< Object > key)
Definition: ic.cc:340
State state_
Definition: ic.h:264
MaybeHandle< Code > maybe_handler_
Definition: ic.h:267
void update_receiver_type(Handle< Object > receiver)
Definition: ic.h:204
Code * GetOriginalCode() const
Definition: ic.cc:209
static Address AddressFromUtilityId(UtilityId id)
Definition: ic.cc:2687
static void SetTargetAtAddress(Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic-inl.h:96
void FindTargetMaps()
Definition: ic.h:235
static Handle< Map > TypeToMap(HeapType *type, Isolate *isolate)
Definition: ic.cc:719
Handle< HeapType > receiver_type()
Definition: ic.h:203
Code::Kind kind() const
Definition: ic.h:185
void UpdateTarget()
Definition: ic-inl.h:158
@ kUtilityCount
Definition: ic.h:48
bool IsNameCompatibleWithPrototypeFailure(Handle< Object > name)
Definition: ic.cc:303
static Code * GetTargetAtAddress(Address address, ConstantPoolArray *constant_pool)
Definition: ic-inl.h:84
bool is_target_set()
Definition: ic.h:147
State state() const
Definition: ic.h:66
virtual ~IC()
Definition: ic.h:64
void UpdateState(Handle< Object > receiver, Handle< Object > name)
Definition: ic.cc:315
Handle< Code > target_
Definition: ic.h:262
ConstantPoolArray * constant_pool() const
Definition: ic-inl.h:51
MaybeHandle< Object > ReferenceError(const char *type, Handle< Name > name)
Definition: ic.cc:348
Handle< ConstantPoolArray > raw_constant_pool_
Definition: ic.h:259
void set_extra_ic_state(ExtraICState state)
Definition: ic.h:201
void TargetTypes(TypeHandleList *list)
Definition: ic.h:215
void MarkPrototypeFailure(Handle< Object > name)
Definition: ic.h:73
static T::TypeHandle MapToType(Handle< Map > map, typename T::Region *region)
Definition: ic.cc:733
DISALLOW_IMPLICIT_CONSTRUCTORS(IC)
Isolate * isolate() const
Definition: ic.h:136
ExtraICState extra_ic_state_
Definition: ic.h:269
Code::Kind handler_kind() const
Definition: ic.h:186
bool target_maps_set_
Definition: ic.h:271
SharedFunctionInfo * GetSharedFunctionInfo() const
Definition: ic.cc:187
bool IsTransitionOfMonomorphicTarget(Map *source_map, Map *target_map)
Definition: ic.cc:772
IC(FrameDepth depth, Isolate *isolate)
Definition: ic.cc:141
MapHandleList target_maps_
Definition: ic.h:270
void TargetMaps(MapHandleList *list)
Definition: ic.h:208
static void Clear(Isolate *isolate, Address address, ConstantPoolArray *constant_pool)
Definition: ic.cc:478
virtual Handle< Code > CompileHandler(LookupIterator *lookup, Handle< Object > value, CacheHolderFlag cache_holder)
Definition: ic.h:171
void UpdateMonomorphicIC(Handle< Code > handler, Handle< Name > name)
Definition: ic.cc:753
Code * raw_target() const
Definition: ic-inl.h:154
Code::Kind kind_
Definition: ic.h:265
void PatchCache(Handle< Name > name, Handle< Code > code)
Definition: ic.cc:787
static JSFunction * GetRootConstructor(TypeClass *type, Context *native_context)
Definition: ic-inl.h:162
void CopyICToMegamorphicCache(Handle< Name > name)
Definition: ic.cc:761
Isolate * isolate_
Definition: ic.h:255
bool target_set_
Definition: ic.h:263
Address fp_
Definition: ic.h:247
Map * FirstTargetMap()
Definition: ic.h:222
Address * pc_address_
Definition: ic.h:253
ExtraICState extra_ic_state() const
Definition: ic.h:200
Address address() const
Definition: ic-inl.h:19
char TransitionMarkFromState(IC::State state)
Definition: ic.cc:25
Handle< HeapType > receiver_type_
Definition: ic.h:266
@ NO_EXTRA_FRAME
Definition: ic.h:59
@ EXTRA_CALL_FRAME
Definition: ic.h:59
Handle< Code > target() const
Definition: ic.h:132
void set_target(Code *code)
Definition: ic-inl.h:121
InlineCacheState State
Definition: ic.h:55
static void OnTypeFeedbackChanged(Isolate *isolate, Address address, State old_state, State new_state, bool target_remains_ic_stub)
Definition: ic.cc:392
bool UpdatePolymorphicIC(Handle< Name > name, Handle< Code > code)
Definition: ic.cc:649
static Handle< HeapType > CurrentTypeOf(Handle< Object > object, Isolate *isolate)
Definition: ic.cc:712
static bool IsCleared(Code *code)
Definition: ic.h:112
ConstantPoolArray * raw_constant_pool() const
Definition: ic-inl.h:75
static Handle< Map > GetHandlerCacheHolder(HeapType *type, bool receiver_is_holder, Isolate *isolate, CacheHolderFlag *flag)
Definition: ic-inl.h:177
Address pc() const
Definition: ic.h:135
void UpdateMegamorphicCache(HeapType *type, Name *name, Code *code)
Definition: ic.cc:890
bool TryRemoveInvalidPrototypeDependentStub(Handle< Object > receiver, Handle< String > name)
Definition: ic.cc:251
static Handle< Map > GetICCacheHolder(HeapType *type, Isolate *isolate, CacheHolderFlag *flag)
Definition: ic-inl.h:198
static void RegisterWeakMapDependency(Handle< Code > stub)
Definition: ic.cc:442
Code * GetCode() const
Definition: ic.cc:201
virtual Handle< Code > megamorphic_stub()
Definition: ic.h:192
void TraceIC(const char *type, Handle< Object > name)
Definition: ic.cc:90
static void InvalidateMaps(Code *stub)
Definition: ic.cc:460
Address fp() const
Definition: ic.h:134
Handle< Code > ComputeHandler(LookupIterator *lookup, Handle< Object > value=Handle< Code >::null())
Definition: ic.cc:897
Builtins * builtins()
Definition: isolate.h:947
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:412
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:411
Handle< Code > string_stub()
Definition: ic.h:436
KeyedLoadIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:400
Handle< Code > generic_stub() const
Definition: ic.h:435
static void GenerateMiss(MacroAssembler *masm)
virtual Handle< Code > pre_monomorphic_stub() const
Definition: ic.h:430
static void GenerateString(MacroAssembler *masm)
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
static void GenerateGeneric(MacroAssembler *masm)
static ExtraICState ComputeExtraICState(StrictMode flag, KeyedAccessStoreMode mode)
Definition: ic.h:537
static KeyedAccessStoreMode GetKeyedAccessStoreMode(ExtraICState extra_state)
Definition: ic.h:543
static void GenerateMiss(MacroAssembler *masm)
static Handle< Code > pre_monomorphic_stub(Isolate *isolate, StrictMode strict_mode)
Definition: ic.h:570
Handle< Code > sloppy_arguments_stub()
Definition: ic.h:586
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:558
static void GenerateSlow(MacroAssembler *masm)
static void GenerateSloppyArguments(MacroAssembler *masm)
KeyedStoreIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:548
virtual Handle< Code > pre_monomorphic_stub() const
Definition: ic.h:567
static void GenerateGeneric(MacroAssembler *masm, StrictMode strict_mode)
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:557
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:17
T & at(int i) const
Definition: list.h:69
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:349
void UpdateCaches(LookupIterator *lookup)
Definition: ic.cc:859
static ExtraICState ComputeExtraICState(ContextualMode contextual_mode)
Definition: ic.h:324
static void GenerateNormal(MacroAssembler *masm)
void set_target(Code *code)
Definition: ic-inl.h:130
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
static Handle< Code > initialize_stub(Isolate *isolate, ExtraICState extra_state)
Definition: ic.cc:815
MUST_USE_RESULT MaybeHandle< Object > Load(Handle< Object > object, Handle< Name > name)
Definition: ic.cc:586
LoadIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:332
Handle< Code > SimpleFieldLoad(FieldIndex index)
Definition: ic.cc:853
Handle< Code > slow_stub() const
Definition: ic.h:365
virtual Handle< Code > megamorphic_stub() OVERRIDE
Definition: ic.cc:821
ContextualMode contextual_mode() const
Definition: ic.h:328
virtual Handle< Code > CompileHandler(LookupIterator *lookup, Handle< Object > unused, CacheHolderFlag cache_holder)
Definition: ic.cc:947
static void Clear(Isolate *isolate, Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic.cc:527
static void GenerateMiss(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:348
virtual Handle< Code > pre_monomorphic_stub() const
Definition: ic.cc:843
bool IsUndeclaredGlobal(Handle< Object > receiver)
Definition: ic.h:338
static const int kHasIndexedInterceptor
Definition: objects.h:6243
static const int kIsAccessCheckNeeded
Definition: objects.h:6246
@ CERTAINLY_NOT_STORE_FROM_KEYED
Definition: objects.h:1007
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:472
static void GenerateMiss(MacroAssembler *masm)
StoreIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:461
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:471
static StrictMode GetStrictMode(ExtraICState state)
Definition: ic.h:453
static void GenerateMegamorphic(MacroAssembler *masm)
StrictMode strict_mode() const
Definition: ic.h:465
static ExtraICState ComputeExtraICState(StrictMode flag)
Definition: ic.h:450
static void GenerateRuntimeSetProperty(MacroAssembler *masm, StrictMode strict_mode)
static void GenerateNormal(MacroAssembler *masm)
static void GenerateSlow(MacroAssembler *masm)
ToBooleanIC(Isolate *isolate)
Definition: ic.h:665
#define WARN_UNUSED_RESULT
#define OVERRIDE
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 map
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
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
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
#define CONST_NAME(name)
Definition: ic.h:45
#define IC_UTIL_LIST(ICU)
Definition: ic.h:17
#define UNREACHABLE()
Definition: logging.h:30
#define DCHECK(condition)
Definition: logging.h:205
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206
#define MUST_USE_RESULT
Definition: macros.h:266
DECLARE_RUNTIME_FUNCTION(Debug_Break)
InlinedSmiCheck
Definition: ic.h:672
@ DISABLE_INLINED_SMI_CHECK
Definition: ic.h:672
@ ENABLE_INLINED_SMI_CHECK
Definition: ic.h:672
KeyedAccessStoreMode
Definition: objects.h:153
TypeImpl< HeapTypeConfig > HeapType
Definition: list.h:191
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check)
byte * Address
Definition: globals.h:101
NilValue
Definition: v8.h:97
kFeedbackVectorOffset flag
Definition: objects-inl.h:5418
KeyedStoreCheckMap
Definition: ic.h:524
@ kDontCheckMap
Definition: ic.h:524
@ kCheckMap
Definition: ic.h:524
@ UNINITIALIZED
Definition: globals.h:446
@ PROTOTYPE_FAILURE
Definition: globals.h:452
@ PREMONOMORPHIC
Definition: globals.h:448
KeyedStoreIncrementLength
Definition: ic.h:527
@ kDontIncrementLength
Definition: ic.h:527
@ kIncrementLength
Definition: ic.h:527
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20