v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ic.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_IC_H_
29 #define V8_IC_H_
30 
31 #include "macro-assembler.h"
32 
33 namespace v8 {
34 namespace internal {
35 
36 
37 const int kMaxKeyedPolymorphism = 4;
38 
39 
40 // IC_UTIL_LIST defines all utility functions called from generated
41 // inline caching code. The argument for the macro, ICU, is the function name.
42 #define IC_UTIL_LIST(ICU) \
43  ICU(LoadIC_Miss) \
44  ICU(KeyedLoadIC_Miss) \
45  ICU(StoreIC_Miss) \
46  ICU(StoreIC_ArrayLength) \
47  ICU(StoreIC_Slow) \
48  ICU(SharedStoreIC_ExtendStorage) \
49  ICU(KeyedStoreIC_Miss) \
50  ICU(KeyedStoreIC_Slow) \
51  /* Utilities for IC stubs. */ \
52  ICU(StoreCallbackProperty) \
53  ICU(LoadPropertyWithInterceptorOnly) \
54  ICU(LoadPropertyWithInterceptorForLoad) \
55  ICU(LoadPropertyWithInterceptorForCall) \
56  ICU(KeyedLoadPropertyWithInterceptor) \
57  ICU(StoreInterceptorProperty) \
58  ICU(CompareIC_Miss) \
59  ICU(BinaryOpIC_Miss) \
60  ICU(CompareNilIC_Miss) \
61  ICU(Unreachable) \
62  ICU(ToBooleanIC_Miss)
63 //
64 // IC is the base class for LoadIC, StoreIC, KeyedLoadIC, and KeyedStoreIC.
65 //
66 class IC {
67  public:
68  // The ids for utility called from the generated code.
69  enum UtilityId {
70  #define CONST_NAME(name) k##name,
72  #undef CONST_NAME
74  };
75 
76  // Looks up the address of the named utility.
78 
79  // Alias the inline cache state type to make the IC code more readable.
81 
82  // The IC code is either invoked with no extra frames on the stack
83  // or with a single extra frame for supporting calls.
84  enum FrameDepth {
87  };
88 
89  // Construct the IC structure with the given number of extra
90  // JavaScript frames on the stack.
91  IC(FrameDepth depth, Isolate* isolate);
92  virtual ~IC() {}
93 
94  State state() const { return state_; }
95  inline Address address() const;
96 
97  // Compute the current IC state based on the target stub, receiver and name.
101  }
102 
103  // Clear the inline cache to initial state.
104  static void Clear(Isolate* isolate,
106  ConstantPoolArray* constant_pool);
107 
108 #ifdef DEBUG
109  bool IsLoadStub() const {
110  return target()->is_load_stub() || target()->is_keyed_load_stub();
111  }
112 
113  bool IsStoreStub() const {
114  return target()->is_store_stub() || target()->is_keyed_store_stub();
115  }
116 #endif
117 
118  // Determines which map must be used for keeping the code stub.
119  // These methods should not be called with undefined or null.
120  static inline InlineCacheHolderFlag GetCodeCacheForObject(Object* object);
121  // TODO(verwaest): This currently returns a HeapObject rather than JSObject*
122  // since loading the IC for loading the length from strings are stored on
123  // the string map directly, rather than on the JSObject-typed prototype.
124  static inline HeapObject* GetCodeCacheHolder(Isolate* isolate,
125  Object* object,
126  InlineCacheHolderFlag holder);
127 
128  static inline InlineCacheHolderFlag GetCodeCacheFlag(HeapType* type);
129  static inline Handle<Map> GetCodeCacheHolder(InlineCacheHolderFlag flag,
130  HeapType* type,
131  Isolate* isolate);
132 
133  static bool IsCleared(Code* code) {
134  InlineCacheState state = code->ic_state();
135  return state == UNINITIALIZED || state == PREMONOMORPHIC;
136  }
137 
138  // Utility functions to convert maps to types and back. There are two special
139  // cases:
140  // - The heap_number_map is used as a marker which includes heap numbers as
141  // well as smis.
142  // - The oddball map is only used for booleans.
143  static Handle<Map> TypeToMap(HeapType* type, Isolate* isolate);
144  template <class T>
145  static typename T::TypeHandle MapToType(Handle<Map> map,
146  typename T::Region* region);
147 
149  Isolate* isolate);
150 
151  protected:
152  // Get the call-site target; used for determining the state.
153  Handle<Code> target() const { return target_; }
154 
155  Address fp() const { return fp_; }
156  Address pc() const { return *pc_address_; }
157  Isolate* isolate() const { return isolate_; }
158 
159 #ifdef ENABLE_DEBUGGER_SUPPORT
160  // Get the shared function info of the caller.
161  SharedFunctionInfo* GetSharedFunctionInfo() const;
162  // Get the code object of the caller.
163  Code* GetCode() const;
164  // Get the original (non-breakpointed) code object of the caller.
165  Code* GetOriginalCode() const;
166 #endif
167 
168  // Set the call-site target.
170  SetTargetAtAddress(address(), code, constant_pool());
171  target_set_ = true;
172  }
173 
174  bool is_target_set() { return target_set_; }
175 
176 #ifdef DEBUG
177  char TransitionMarkFromState(IC::State state);
178 
179  void TraceIC(const char* type, Handle<Object> name);
180 #endif
181 
182  Failure* TypeError(const char* type,
183  Handle<Object> object,
184  Handle<Object> key);
185  Failure* ReferenceError(const char* type, Handle<String> name);
186 
187  // Access the target code for the given IC address.
188  static inline Code* GetTargetAtAddress(Address address,
189  ConstantPoolArray* constant_pool);
190  static inline void SetTargetAtAddress(Address address,
191  Code* target,
192  ConstantPoolArray* constant_pool);
193  static void PostPatching(Address address, Code* target, Code* old_target);
194 
195  // Compute the handler either by compiling or by retrieving a cached version.
196  Handle<Code> ComputeHandler(LookupResult* lookup,
197  Handle<Object> object,
200  virtual Handle<Code> CompileHandler(LookupResult* lookup,
201  Handle<Object> object,
202  Handle<String> name,
203  Handle<Object> value,
204  InlineCacheHolderFlag cache_holder) {
205  UNREACHABLE();
206  return Handle<Code>::null();
207  }
208 
210  Handle<Code> handler,
211  Handle<String> name);
212 
214  Handle<String> name,
216 
217  virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code);
218 
220  bool IsTransitionOfMonomorphicTarget(Map* source_map, Map* target_map);
221  void PatchCache(Handle<HeapType> type,
222  Handle<String> name,
224  virtual Code::Kind kind() const {
225  UNREACHABLE();
226  return Code::STUB;
227  }
228  virtual Handle<Code> slow_stub() const {
229  UNREACHABLE();
230  return Handle<Code>::null();
231  }
233  UNREACHABLE();
234  return Handle<Code>::null();
235  }
236  virtual Handle<Code> generic_stub() const {
237  UNREACHABLE();
238  return Handle<Code>::null();
239  }
240 
242  Handle<String> name);
244 
245  ExtraICState extra_ic_state() const { return extra_ic_state_; }
247  extra_ic_state_ = state;
248  }
249 
250  protected:
251  void UpdateTarget() {
252  target_ = handle(raw_target(), isolate_);
253  }
254 
255  private:
256  Code* raw_target() const {
257  return GetTargetAtAddress(address(), constant_pool());
258  }
259  inline ConstantPoolArray* constant_pool() const;
260  inline ConstantPoolArray* raw_constant_pool() const;
261 
262  // Frame pointer for the frame that uses (calls) the IC.
263  Address fp_;
264 
265  // All access to the program counter of an IC structure is indirect
266  // to make the code GC safe. This feature is crucial since
267  // GetProperty and SetProperty are called and they in turn might
268  // invoke the garbage collector.
269  Address* pc_address_;
270 
271  Isolate* isolate_;
272 
273  // The constant pool of the code which originally called the IC (which might
274  // be for the breakpointed copy of the original code).
275  Handle<ConstantPoolArray> raw_constant_pool_;
276 
277  // The original code target that missed.
278  Handle<Code> target_;
279  State state_;
280  bool target_set_;
281 
282  ExtraICState extra_ic_state_;
283 
284  DISALLOW_IMPLICIT_CONSTRUCTORS(IC);
285 };
286 
287 
288 // An IC_Utility encapsulates IC::UtilityId. It exists mainly because you
289 // cannot make forward declarations to an enum.
290 class IC_Utility {
291  public:
293  : address_(IC::AddressFromUtilityId(id)), id_(id) {}
294 
295  Address address() const { return address_; }
296 
297  IC::UtilityId id() const { return id_; }
298  private:
299  Address address_;
300  IC::UtilityId id_;
301 };
302 
303 
304 class LoadIC: public IC {
305  public:
306  // ExtraICState bits
307  class ContextualModeBits: public BitField<ContextualMode, 0, 1> {};
308  STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0);
309 
311  return ContextualModeBits::encode(contextual_mode);
312  }
313 
315  return ContextualModeBits::decode(state);
316  }
317 
320  }
321 
322  explicit LoadIC(FrameDepth depth, Isolate* isolate)
323  : IC(depth, isolate) {
324  ASSERT(IsLoadStub());
325  }
326 
327  // Returns if this IC is for contextual (no explicit receiver)
328  // access to properties.
330  if (receiver->IsGlobalObject()) {
331  return contextual_mode() == CONTEXTUAL;
332  } else {
334  return false;
335  }
336  }
337 
338  // Code generator routines.
339  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
341  GenerateMiss(masm);
342  }
343  static void GenerateMiss(MacroAssembler* masm);
344  static void GenerateMegamorphic(MacroAssembler* masm);
345  static void GenerateNormal(MacroAssembler* masm);
346  static void GenerateRuntimeGetProperty(MacroAssembler* masm);
347 
349  ExtraICState extra_state);
350 
351  MUST_USE_RESULT MaybeObject* Load(Handle<Object> object,
352  Handle<String> name);
353 
354  protected:
355  virtual Code::Kind kind() const { return Code::LOAD_IC; }
356 
358  // The contextual mode must be preserved across IC patching.
360  GetContextualMode(target()->extra_ic_state()));
361 
362  IC::set_target(code);
363  }
364 
365  virtual Handle<Code> slow_stub() const {
366  return isolate()->builtins()->LoadIC_Slow();
367  }
368 
369  virtual Handle<Code> megamorphic_stub();
370 
371  // Update the inline cache and the global stub cache based on the
372  // lookup result.
373  void UpdateCaches(LookupResult* lookup,
374  Handle<Object> object,
375  Handle<String> name);
376 
377  virtual Handle<Code> CompileHandler(LookupResult* lookup,
378  Handle<Object> object,
379  Handle<String> name,
380  Handle<Object> unused,
381  InlineCacheHolderFlag cache_holder);
382 
383  private:
384  // Stub accessors.
385  static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
386  ExtraICState exstra_state);
387 
388  virtual Handle<Code> pre_monomorphic_stub() {
389  return pre_monomorphic_stub(isolate(), extra_ic_state());
390  }
391 
392  Handle<Code> SimpleFieldLoad(int offset,
393  bool inobject = true,
394  Representation representation =
396 
397  static void Clear(Isolate* isolate,
399  Code* target,
400  ConstantPoolArray* constant_pool);
401 
402  friend class IC;
403 };
404 
405 
406 class KeyedLoadIC: public LoadIC {
407  public:
409  : LoadIC(depth, isolate) {
410  ASSERT(target()->is_keyed_load_stub());
411  }
412 
413  MUST_USE_RESULT MaybeObject* Load(Handle<Object> object,
414  Handle<Object> key);
415 
416  // Code generator routines.
417  static void GenerateMiss(MacroAssembler* masm);
418  static void GenerateRuntimeGetProperty(MacroAssembler* masm);
419  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
421  GenerateMiss(masm);
422  }
423  static void GenerateGeneric(MacroAssembler* masm);
424  static void GenerateString(MacroAssembler* masm);
425  static void GenerateIndexedInterceptor(MacroAssembler* masm);
426  static void GenerateSloppyArguments(MacroAssembler* masm);
427 
428  // Bit mask to be tested against bit field for the cases when
429  // generic stub should go into slow case.
430  // Access check is necessary explicitly since generic stub does not perform
431  // map checks.
432  static const int kSlowCaseBitFieldMask =
434 
435  protected:
436  virtual Code::Kind kind() const { return Code::KEYED_LOAD_IC; }
437 
439 
441  return isolate()->builtins()->KeyedLoadIC_Generic();
442  }
443  virtual Handle<Code> generic_stub() const {
444  return isolate()->builtins()->KeyedLoadIC_Generic();
445  }
446  virtual Handle<Code> slow_stub() const {
447  return isolate()->builtins()->KeyedLoadIC_Slow();
448  }
449 
450  virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code) {}
451 
452  private:
453  // Stub accessors.
454  static Handle<Code> pre_monomorphic_stub(Isolate* isolate) {
455  return isolate->builtins()->KeyedLoadIC_PreMonomorphic();
456  }
457  virtual Handle<Code> pre_monomorphic_stub() {
458  return pre_monomorphic_stub(isolate());
459  }
460  Handle<Code> indexed_interceptor_stub() {
461  return isolate()->builtins()->KeyedLoadIC_IndexedInterceptor();
462  }
463  Handle<Code> sloppy_arguments_stub() {
464  return isolate()->builtins()->KeyedLoadIC_SloppyArguments();
465  }
466  Handle<Code> string_stub() {
467  return isolate()->builtins()->KeyedLoadIC_String();
468  }
469 
470  static void Clear(Isolate* isolate,
472  Code* target,
473  ConstantPoolArray* constant_pool);
474 
475  friend class IC;
476 };
477 
478 
479 class StoreIC: public IC {
480  public:
481  class StrictModeState: public BitField<StrictMode, 1, 1> {};
483  return StrictModeState::encode(flag);
484  }
486  return StrictModeState::decode(state);
487  }
488 
489  // For convenience, a statically declared encoding of strict mode extra
490  // IC state.
493 
494  StoreIC(FrameDepth depth, Isolate* isolate)
495  : IC(depth, isolate) {
496  ASSERT(IsStoreStub());
497  }
498 
501  }
502 
503  // Code generators for stub routines. Only called once at startup.
504  static void GenerateSlow(MacroAssembler* masm);
505  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
507  GenerateMiss(masm);
508  }
509  static void GenerateMiss(MacroAssembler* masm);
510  static void GenerateMegamorphic(MacroAssembler* masm);
511  static void GenerateNormal(MacroAssembler* masm);
512  static void GenerateRuntimeSetProperty(MacroAssembler* masm,
514 
515  static Handle<Code> initialize_stub(Isolate* isolate,
517 
518  MUST_USE_RESULT MaybeObject* Store(
519  Handle<Object> object,
520  Handle<String> name,
521  Handle<Object> value,
522  JSReceiver::StoreFromKeyed store_mode =
524 
525  protected:
526  virtual Code::Kind kind() const { return Code::STORE_IC; }
527  virtual Handle<Code> megamorphic_stub();
528 
529  // Stub accessors.
530  virtual Handle<Code> generic_stub() const;
531 
532  virtual Handle<Code> slow_stub() const {
533  return isolate()->builtins()->StoreIC_Slow();
534  }
535 
538  }
539 
540  static Handle<Code> pre_monomorphic_stub(Isolate* isolate,
542 
543  // Update the inline cache and the global stub cache based on the
544  // lookup result.
545  void UpdateCaches(LookupResult* lookup,
546  Handle<JSObject> receiver,
547  Handle<String> name,
548  Handle<Object> value);
549  virtual Handle<Code> CompileHandler(LookupResult* lookup,
550  Handle<Object> object,
551  Handle<String> name,
552  Handle<Object> value,
553  InlineCacheHolderFlag cache_holder);
554 
555  private:
556  void set_target(Code* code) {
557  // Strict mode must be preserved across IC patching.
559  GetStrictMode(target()->extra_ic_state()));
560  IC::set_target(code);
561  }
562 
563  static void Clear(Isolate* isolate,
565  Code* target,
566  ConstantPoolArray* constant_pool);
567 
568  friend class IC;
569 };
570 
571 
575 };
576 
577 
581 };
582 
583 
584 class KeyedStoreIC: public StoreIC {
585  public:
586  // ExtraICState bits (building on IC)
587  // ExtraICState bits
589  public BitField<KeyedAccessStoreMode, 2, 4> {}; // NOLINT
590 
593  return StrictModeState::encode(flag) |
595  }
596 
598  ExtraICState extra_state) {
599  return ExtraICStateKeyedAccessStoreMode::decode(extra_state);
600  }
601 
602  KeyedStoreIC(FrameDepth depth, Isolate* isolate)
603  : StoreIC(depth, isolate) {
604  ASSERT(target()->is_keyed_store_stub());
605  }
606 
607  MUST_USE_RESULT MaybeObject* Store(Handle<Object> object,
608  Handle<Object> name,
609  Handle<Object> value);
610 
611  // Code generators for stub routines. Only called once at startup.
612  static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); }
614  GenerateMiss(masm);
615  }
616  static void GenerateMiss(MacroAssembler* masm);
617  static void GenerateSlow(MacroAssembler* masm);
618  static void GenerateRuntimeSetProperty(MacroAssembler* masm,
621  static void GenerateSloppyArguments(MacroAssembler* masm);
622 
623  protected:
624  virtual Code::Kind kind() const { return Code::KEYED_STORE_IC; }
625 
626  virtual void UpdateMegamorphicCache(HeapType* type, Name* name, Code* code) {}
627 
630  }
633  if (strict_mode == STRICT) {
634  return isolate->builtins()->KeyedStoreIC_PreMonomorphic_Strict();
635  } else {
636  return isolate->builtins()->KeyedStoreIC_PreMonomorphic();
637  }
638  }
639  virtual Handle<Code> slow_stub() const {
640  return isolate()->builtins()->KeyedStoreIC_Slow();
641  }
643  if (strict_mode() == STRICT) {
644  return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
645  } else {
646  return isolate()->builtins()->KeyedStoreIC_Generic();
647  }
648  }
649 
651  KeyedAccessStoreMode store_mode);
652 
653  private:
654  void set_target(Code* code) {
655  // Strict mode must be preserved across IC patching.
657  IC::set_target(code);
658  }
659 
660  // Stub accessors.
661  virtual Handle<Code> generic_stub() const {
662  if (strict_mode() == STRICT) {
663  return isolate()->builtins()->KeyedStoreIC_Generic_Strict();
664  } else {
665  return isolate()->builtins()->KeyedStoreIC_Generic();
666  }
667  }
668 
669  Handle<Code> sloppy_arguments_stub() {
670  return isolate()->builtins()->KeyedStoreIC_SloppyArguments();
671  }
672 
673  static void Clear(Isolate* isolate,
675  Code* target,
676  ConstantPoolArray* constant_pool);
677 
678  KeyedAccessStoreMode GetStoreMode(Handle<JSObject> receiver,
679  Handle<Object> key,
680  Handle<Object> value);
681 
682  Handle<Map> ComputeTransitionedMap(Handle<JSObject> receiver,
683  KeyedAccessStoreMode store_mode);
684 
685  friend class IC;
686 };
687 
688 
689 // Mode to overwrite BinaryExpression values.
691 
692 // Type Recording BinaryOpIC, that records the types of the inputs and outputs.
693 class BinaryOpIC: public IC {
694  public:
696  public:
698 
700  : op_(op), mode_(mode), left_kind_(NONE), right_kind_(NONE),
701  result_kind_(NONE) {
702  ASSERT_LE(FIRST_TOKEN, op);
703  ASSERT_LE(op, LAST_TOKEN);
704  }
705 
707  if (Max(left_kind_, right_kind_) == NONE) {
709  }
710  if (Max(left_kind_, right_kind_) == GENERIC) {
712  }
713  if (Min(left_kind_, right_kind_) == GENERIC) {
715  }
717  }
718 
719  ExtraICState GetExtraICState() const;
720 
721  static void GenerateAheadOfTime(
722  Isolate*, void (*Generate)(Isolate*, const State&));
723 
724  bool CanReuseDoubleBox() const {
725  return (result_kind_ > SMI && result_kind_ <= NUMBER) &&
726  ((mode_ == OVERWRITE_LEFT &&
727  left_kind_ > SMI && left_kind_ <= NUMBER) ||
728  (mode_ == OVERWRITE_RIGHT &&
729  right_kind_ > SMI && right_kind_ <= NUMBER));
730  }
731 
732  // Returns true if the IC _could_ create allocation mementos.
734  if (left_kind_ == STRING || right_kind_ == STRING) {
735  ASSERT_EQ(Token::ADD, op_);
736  return true;
737  }
738  return false;
739  }
740 
741  // Returns true if the IC _should_ create allocation mementos.
743  return FLAG_allocation_site_pretenuring &&
744  CouldCreateAllocationMementos();
745  }
746 
747  bool HasSideEffects() const {
748  return Max(left_kind_, right_kind_) == GENERIC;
749  }
750 
751  // Returns true if the IC should enable the inline smi code (i.e. if either
752  // parameter may be a smi).
753  bool UseInlinedSmiCode() const {
754  return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_);
755  }
756 
757  static const int FIRST_TOKEN = Token::BIT_OR;
758  static const int LAST_TOKEN = Token::MOD;
759 
760  Token::Value op() const { return op_; }
761  OverwriteMode mode() const { return mode_; }
762  Maybe<int> fixed_right_arg() const { return fixed_right_arg_; }
763 
764  Type* GetLeftType(Zone* zone) const {
765  return KindToType(left_kind_, zone);
766  }
767  Type* GetRightType(Zone* zone) const {
768  return KindToType(right_kind_, zone);
769  }
770  Type* GetResultType(Zone* zone) const;
771 
772  void Print(StringStream* stream) const;
773 
774  void Update(Handle<Object> left,
775  Handle<Object> right,
776  Handle<Object> result);
777 
778  private:
779  enum Kind { NONE, SMI, INT32, NUMBER, STRING, GENERIC };
780 
781  Kind UpdateKind(Handle<Object> object, Kind kind) const;
782 
783  static const char* KindToString(Kind kind);
784  static Type* KindToType(Kind kind, Zone* zone);
785  static bool KindMaybeSmi(Kind kind) {
786  return (kind >= SMI && kind <= NUMBER) || kind == GENERIC;
787  }
788 
789  // We truncate the last bit of the token.
790  STATIC_ASSERT(LAST_TOKEN - FIRST_TOKEN < (1 << 4));
791  class OpField: public BitField<int, 0, 4> {};
792  class OverwriteModeField: public BitField<OverwriteMode, 4, 2> {};
793  class SSE2Field: public BitField<bool, 6, 1> {};
794  class ResultKindField: public BitField<Kind, 7, 3> {};
795  class LeftKindField: public BitField<Kind, 10, 3> {};
796  // When fixed right arg is set, we don't need to store the right kind.
797  // Thus the two fields can overlap.
798  class HasFixedRightArgField: public BitField<bool, 13, 1> {};
799  class FixedRightArgValueField: public BitField<int, 14, 4> {};
800  class RightKindField: public BitField<Kind, 14, 3> {};
801 
802  Token::Value op_;
803  OverwriteMode mode_;
804  Kind left_kind_;
805  Kind right_kind_;
806  Kind result_kind_;
807  Maybe<int> fixed_right_arg_;
808  };
809 
810  explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
811 
813 
814  MaybeObject* Transition(Handle<AllocationSite> allocation_site,
815  Handle<Object> left,
817 };
818 
819 
820 class CompareIC: public IC {
821  public:
822  // The type/state lattice is defined by the following inequations:
823  // UNINITIALIZED < ...
824  // ... < GENERIC
825  // SMI < NUMBER
826  // INTERNALIZED_STRING < STRING
827  // KNOWN_OBJECT < OBJECT
828  enum State {
834  UNIQUE_NAME, // Symbol or InternalizedString
835  OBJECT, // JSObject
836  KNOWN_OBJECT, // JSObject with specific map (faster check)
838  };
839 
840  static State NewInputState(State old_state, Handle<Object> value);
841 
842  static Type* StateToType(Zone* zone,
843  State state,
845 
846  static void StubInfoToType(int stub_minor_key,
847  Type** left_type,
848  Type** right_type,
849  Type** overall_type,
851  Zone* zone);
852 
854  : IC(EXTRA_CALL_FRAME, isolate), op_(op) { }
855 
856  // Update the inline cache for the given operands.
858 
859 
860  // Factory method for getting an uninitialized compare stub.
861  static Handle<Code> GetUninitialized(Isolate* isolate, Token::Value op);
862 
863  // Helper function for computing the condition for a compare operation.
865 
866  static const char* GetStateName(State state);
867 
868  private:
869  static bool HasInlinedSmiCode(Address address);
870 
871  State TargetState(State old_state,
872  State old_left,
873  State old_right,
874  bool has_inlined_smi_code,
875  Handle<Object> x,
876  Handle<Object> y);
877 
878  bool strict() const { return op_ == Token::EQ_STRICT; }
879  Condition GetCondition() const { return ComputeCondition(op_); }
880 
881  static Code* GetRawUninitialized(Isolate* isolate, Token::Value op);
882 
883  static void Clear(Isolate* isolate,
885  Code* target,
886  ConstantPoolArray* constant_pool);
887 
888  Token::Value op_;
889 
890  friend class IC;
891 };
892 
893 
894 class CompareNilIC: public IC {
895  public:
896  explicit CompareNilIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {}
897 
898  MUST_USE_RESULT MaybeObject* CompareNil(Handle<Object> object);
899 
901 
902  static void Clear(Address address,
903  Code* target,
904  ConstantPoolArray* constant_pool);
905 
906  static MUST_USE_RESULT MaybeObject* DoCompareNilSlow(NilValue nil,
907  Handle<Object> object);
908 };
909 
910 
911 class ToBooleanIC: public IC {
912  public:
913  explicit ToBooleanIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) { }
914 
915  MaybeObject* ToBoolean(Handle<Object> object);
916 };
917 
918 
919 // Helper for BinaryOpIC and CompareIC.
922 
923 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadIC_MissFromStubFailure);
924 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedStoreIC_MissFromStubFailure);
925 DECLARE_RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss);
926 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure);
927 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss);
928 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss);
929 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite);
930 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss);
931 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss);
932 
933 
934 } } // namespace v8::internal
935 
936 #endif // V8_IC_H_
byte * Address
Definition: globals.h:186
static Handle< Code > initialize_stub(Isolate *isolate, StrictMode strict_mode)
Definition: ic.cc:1267
static void GenerateSloppyArguments(MacroAssembler *masm)
ExtraICState extra_ic_state() const
Definition: ic.h:245
void CopyICToMegamorphicCache(Handle< String > name)
Definition: ic.cc:727
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
OverwriteMode mode() const
Definition: ic.h:761
virtual Handle< Code > slow_stub() const
Definition: ic.h:532
static ExtraICState ComputeExtraICState(StrictMode flag)
Definition: ic.h:482
virtual void UpdateMegamorphicCache(HeapType *type, Name *name, Code *code)
Definition: ic.h:450
static MUST_USE_RESULT MaybeObject * DoCompareNilSlow(NilValue nil, Handle< Object > object)
Definition: ic.cc:2719
LoadIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:322
virtual Code::Kind kind() const
Definition: ic.h:624
void UpdateState(Handle< Object > receiver, Handle< Object > name)
Definition: ic.cc:339
MUST_USE_RESULT MaybeObject * Load(Handle< Object > object, Handle< String > name)
Definition: ic.cc:530
static ExtraICState ComputeExtraICState(StrictMode flag, KeyedAccessStoreMode mode)
Definition: ic.h:591
static const ExtraICState kStrictModeState
Definition: ic.h:491
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
Definition: flags.cc:350
virtual Handle< Code > slow_stub() const
Definition: ic.h:639
static HeapObject * GetCodeCacheHolder(Isolate *isolate, Object *object, InlineCacheHolderFlag holder)
Definition: ic-inl.h:160
virtual Code::Kind kind() const
Definition: ic.h:224
void set_extra_ic_state(ExtraICState state)
Definition: ic.h:246
IC_Utility(IC::UtilityId id)
Definition: ic.h:292
static ExtraICState ComputeExtraICState(ContextualMode contextual_mode)
Definition: ic.h:310
virtual void UpdateMegamorphicCache(HeapType *type, Name *name, Code *code)
Definition: ic.cc:844
virtual Handle< Code > slow_stub() const
Definition: ic.h:446
static void GenerateMiss(MacroAssembler *masm)
static Handle< Code > GetUninitialized(Isolate *isolate, Token::Value op)
Definition: ic.cc:2489
virtual ~IC()
Definition: ic.h:92
bool is_target_set()
Definition: ic.h:174
Code * UpdateCaches(Handle< Object > x, Handle< Object > y)
Definition: ic.cc:2654
CompareIC(Isolate *isolate, Token::Value op)
Definition: ic.h:853
static ContextualMode GetContextualMode(ExtraICState state)
Definition: ic.h:314
static void Clear(Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic.cc:2703
T Max(T a, T b)
Definition: utils.h:227
kSerializedDataOffset Object
Definition: objects-inl.h:5016
static State NewInputState(State old_state, Handle< Object > value)
Definition: ic.cc:2548
virtual Handle< Code > CompileHandler(LookupResult *lookup, Handle< Object > object, Handle< String > name, Handle< Object > value, InlineCacheHolderFlag cache_holder)
Definition: ic.h:200
Builtins * builtins()
Definition: isolate.h:948
KeyedAccessStoreMode
Definition: objects.h:164
static void Clear(Isolate *isolate, Address address, ConstantPoolArray *constant_pool)
Definition: ic.cc:429
static void GenerateRuntimeSetProperty(MacroAssembler *masm, StrictMode strict_mode)
KeyedStoreCheckMap
Definition: ic.h:572
static const int kIsAccessCheckNeeded
Definition: objects.h:6474
Handle< Code > LoadElementStub(Handle< JSObject > receiver)
Definition: ic.cc:1020
void UpdateTarget()
Definition: ic.h:251
Address address() const
Definition: ic-inl.h:41
static void GenerateMegamorphic(MacroAssembler *masm)
Failure * TypeError(const char *type, Handle< Object > object, Handle< Object > key)
Definition: ic.cc:369
#define ASSERT(condition)
Definition: checks.h:329
Address address() const
Definition: ic.h:295
Isolate * isolate() const
Definition: ic.h:157
static void GenerateMegamorphic(MacroAssembler *masm)
static Handle< Code > initialize_stub(Isolate *isolate, ExtraICState extra_state)
Definition: ic.cc:782
void TryRemoveInvalidHandlers(Handle< Map > map, Handle< String > name)
Definition: ic.cc:325
Token::Value op() const
Definition: ic.h:760
virtual Handle< Code > megamorphic_stub()
Definition: ic.h:440
void PatchInlinedSmiCode(Address address, InlinedSmiCheck check)
MaybeObject * Transition(Handle< AllocationSite > allocation_site, Handle< Object > left, Handle< Object > right) V8_WARN_UNUSED_RESULT
Definition: ic.cc:2383
StrictMode strict_mode() const
Definition: ic.h:499
kInstanceClassNameOffset flag
Definition: objects-inl.h:5115
static void GenerateGeneric(MacroAssembler *masm, StrictMode strict_mode)
MUST_USE_RESULT MaybeObject * Store(Handle< Object > object, Handle< Object > name, Handle< Object > value)
Definition: ic.cc:1662
bool CouldCreateAllocationMementos() const
Definition: ic.h:733
static void StubInfoToType(int stub_minor_key, Type **left_type, Type **right_type, Type **overall_type, Handle< Map > map, Zone *zone)
Definition: ic.cc:2533
static const int kHasIndexedInterceptor
Definition: objects.h:6471
virtual Handle< Code > pre_monomorphic_stub()
Definition: ic.h:628
bool IsTransitionOfMonomorphicTarget(Map *source_map, Map *target_map)
Definition: ic.cc:738
static Handle< Code > pre_monomorphic_stub(Isolate *isolate, StrictMode strict_mode)
Definition: ic.h:631
#define UNREACHABLE()
Definition: checks.h:52
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV 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_string(expose_natives_as
static Condition ComputeCondition(Token::Value op)
static void PostPatching(Address address, Code *target, Code *old_target)
Definition: ic.cc:398
Address pc() const
Definition: ic.h:156
Type * GetRightType(Zone *zone) const
Definition: ic.h:767
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:419
virtual Handle< Code > megamorphic_stub()
Definition: ic.h:232
void PatchCache(Handle< HeapType > type, Handle< String > name, Handle< Code > code)
Definition: ic.cc:753
void UpdateMonomorphicIC(Handle< HeapType > type, Handle< Code > handler, Handle< String > name)
Definition: ic.cc:717
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
virtual Handle< Code > slow_stub() const
Definition: ic.h:228
virtual Handle< Code > CompileHandler(LookupResult *lookup, Handle< Object > object, Handle< String > name, Handle< Object > value, InlineCacheHolderFlag cache_holder)
Definition: ic.cc:1309
#define MUST_USE_RESULT
Definition: globals.h:381
Address fp() const
Definition: ic.h:155
IC(FrameDepth depth, Isolate *isolate)
Definition: ic.cc:122
static Handle< HeapType > CurrentTypeOf(Handle< Object > object, Isolate *isolate)
Definition: ic.cc:676
KeyedLoadIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:408
NilValue
Definition: v8.h:133
virtual Handle< Code > generic_stub() const
Definition: ic.cc:1281
virtual Handle< Code > megamorphic_stub()
Definition: ic.cc:1276
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:613
void check(i::Vector< const uint8_t > string)
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:340
static KeyedAccessStoreMode GetKeyedAccessStoreMode(ExtraICState extra_state)
Definition: ic.h:597
static void GenerateGeneric(MacroAssembler *masm)
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:339
static void GenerateMiss(MacroAssembler *masm)
InlineCacheState GetICState() const
Definition: ic.h:706
ToBooleanIC(Isolate *isolate)
Definition: ic.h:913
bool IsUndeclaredGlobal(Handle< Object > receiver)
Definition: ic.h:329
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static bool IsCleared(Code *code)
Definition: ic.h:133
static void GenerateRuntimeSetProperty(MacroAssembler *masm, StrictMode strict_mode)
KeyedStoreIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:602
State state() const
Definition: ic.h:94
static Handle< Code > GetUninitialized()
virtual Code::Kind kind() const
Definition: ic.h:526
#define ASSERT_LE(v1, v2)
Definition: checks.h:334
STATIC_ASSERT(static_cast< int >(NOT_CONTEXTUAL)==0)
Handle< Code > ComputeHandler(LookupResult *lookup, Handle< Object > object, Handle< String > name, Handle< Object > value=Handle< Code >::null())
Definition: ic.cc:852
IC::UtilityId id() const
Definition: ic.h:297
static Type * StateToType(Zone *zone, State state, Handle< Map > map=Handle< Map >())
Definition: ic.cc:2512
static void GenerateSlow(MacroAssembler *masm)
void MarkMonomorphicPrototypeFailure()
Definition: ic.h:99
virtual Code::Kind kind() const
Definition: ic.h:355
InlineCacheState ic_state()
Definition: objects-inl.h:4308
OverwriteMode
Definition: ic.h:690
static void SetTargetAtAddress(Address address, Code *target, ConstantPoolArray *constant_pool)
Definition: ic-inl.h:124
static Code * GetTargetAtAddress(Address address, ConstantPoolArray *constant_pool)
Definition: ic-inl.h:112
static void GenerateRuntimeGetProperty(MacroAssembler *masm)
static void GenerateSloppyArguments(MacroAssembler *masm)
static StrictMode GetStrictMode(ExtraICState state)
Definition: ic.h:485
virtual Handle< Code > generic_stub() const
Definition: ic.h:236
void UpdateCaches(LookupResult *lookup, Handle< JSObject > receiver, Handle< String > name, Handle< Object > value)
Definition: ic.cc:1293
virtual Handle< Code > generic_stub() const
Definition: ic.h:443
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:506
static void GenerateSlow(MacroAssembler *masm)
InlineCacheState State
Definition: ic.h:80
MaybeObject * ToBoolean(Handle< Object > object)
Definition: ic.cc:2812
MUST_USE_RESULT MaybeObject * Store(Handle< Object > object, Handle< String > name, Handle< Object > value, JSReceiver::StoreFromKeyed store_mode=JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED)
Definition: ic.cc:1189
static const int kSlowCaseBitFieldMask
Definition: ic.h:432
KeyedStoreIncrementLength
Definition: ic.h:578
bool TryRemoveInvalidPrototypeDependentStub(Handle< Object > receiver, Handle< String > name)
Definition: ic.cc:249
#define IC_UTIL_LIST(ICU)
Definition: ic.h:42
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:103
static InlineCacheHolderFlag GetCodeCacheForObject(Object *object)
Definition: ic-inl.h:150
InlinedSmiCheck
Definition: ic.h:920
bool ShouldCreateAllocationMementos() const
Definition: ic.h:742
static void GenerateString(MacroAssembler *masm)
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:361
DECLARE_RUNTIME_FUNCTION(MaybeObject *, KeyedLoadIC_MissFromStubFailure)
State(Token::Value op, OverwriteMode mode)
Definition: ic.h:699
ContextualMode contextual_mode() const
Definition: ic.h:318
static Handle< T > null()
Definition: handles.h:80
static T::TypeHandle MapToType(Handle< Map > map, typename T::Region *region)
Definition: ic.cc:696
StoreIC(FrameDepth depth, Isolate *isolate)
Definition: ic.h:494
#define ASSERT_EQ(v1, v2)
Definition: checks.h:330
MUST_USE_RESULT MaybeObject * Load(Handle< Object > object, Handle< Object > key)
Definition: ic.cc:1083
static Builtins::JavaScript TokenToJSBuiltin(Token::Value op)
Definition: ic.cc:2771
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
static void GenerateNormal(MacroAssembler *masm)
MUST_USE_RESULT MaybeObject * CompareNil(Handle< Object > object)
Definition: ic.cc:2728
static void GenerateIndexedInterceptor(MacroAssembler *masm)
int ExtraICState
Definition: objects.h:310
Handle< Code > StoreElementStub(Handle< JSObject > receiver, KeyedAccessStoreMode store_mode)
Definition: ic.cc:1414
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:505
CompareNilIC(Isolate *isolate)
Definition: ic.h:896
void set_target(Code *code)
Definition: ic.h:169
virtual Handle< Code > megamorphic_stub()
Definition: ic.cc:794
void UpdateCaches(LookupResult *lookup, Handle< Object > object, Handle< String > name)
Definition: ic.cc:812
virtual Handle< Code > megamorphic_stub()
Definition: ic.h:642
const int kMaxKeyedPolymorphism
Definition: ic.h:37
BinaryOpIC(Isolate *isolate)
Definition: ic.h:810
static Representation Tagged()
virtual Code::Kind kind() const
Definition: ic.h:436
static void GenerateMiss(MacroAssembler *masm)
T Min(T a, T b)
Definition: utils.h:234
virtual void UpdateMegamorphicCache(HeapType *type, Name *name, Code *code)
Definition: ic.h:626
static const char * GetStateName(State state)
Definition: ic.cc:2495
Handle< Code > target() const
Definition: ic.h:153
virtual Handle< Code > slow_stub() const
Definition: ic.h:365
#define CONST_NAME(name)
Definition: ic.h:70
Type * GetLeftType(Zone *zone) const
Definition: ic.h:764
TypeImpl< HeapTypeConfig > HeapType
Definition: list.h:212
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV 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 expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
Definition: flags.cc:505
static Address AddressFromUtilityId(UtilityId id)
Definition: ic.cc:2838
static void GenerateInitialize(MacroAssembler *masm)
Definition: ic.h:612
Failure * ReferenceError(const char *type, Handle< String > name)
Definition: ic.cc:380
ExtraICState extra_ic_state()
Definition: objects-inl.h:4320
static void GeneratePreMonomorphic(MacroAssembler *masm)
Definition: ic.h:420
void set_target(Code *code)
Definition: ic.h:357
virtual Handle< Code > CompileHandler(LookupResult *lookup, Handle< Object > object, Handle< String > name, Handle< Object > unused, InlineCacheHolderFlag cache_holder)
Definition: ic.cc:878
bool UpdatePolymorphicIC(Handle< HeapType > type, Handle< String > name, Handle< Code > code)
Definition: ic.cc:620
virtual Handle< Code > pre_monomorphic_stub()
Definition: ic.h:536
static InlineCacheHolderFlag GetCodeCacheFlag(HeapType *type)
Definition: ic-inl.h:170
static void GenerateNormal(MacroAssembler *masm)
static void GenerateMiss(MacroAssembler *masm)
static Handle< Map > TypeToMap(HeapType *type, Isolate *isolate)
Definition: ic.cc:683
Maybe< int > fixed_right_arg() const
Definition: ic.h:762