V8 Project
type-info.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_TYPE_INFO_H_
6 #define V8_TYPE_INFO_H_
7 
8 #include "src/allocation.h"
9 #include "src/globals.h"
10 #include "src/types.h"
11 #include "src/zone-inl.h"
12 
13 namespace v8 {
14 namespace internal {
15 
16 // Forward declarations.
17 class SmallMapList;
18 
19 
21  public:
24  Handle<Context> native_context, Zone* zone);
25 
29  bool CallIsMonomorphic(int slot);
32  bool CallNewIsMonomorphic(int slot);
33 
34  // TODO(1571) We can't use ForInStatement::ForInType as the return value due
35  // to various cycles in our headers.
36  // TODO(rossberg): once all oracle access is removed from ast.cc, it should
37  // be possible.
38  byte ForInType(int feedback_vector_slot);
39 
41 
43  SmallMapList* receiver_types);
45  SmallMapList* receiver_types,
46  bool* is_string);
49  SmallMapList* receiver_types);
51  SmallMapList* receiver_types,
52  KeyedAccessStoreMode* store_mode);
54  SmallMapList* receiver_types);
55 
57  SmallMapList* types);
58 
59  static bool CanRetainOtherContext(Map* map, Context* native_context);
60  static bool CanRetainOtherContext(JSFunction* function,
61  Context* native_context);
62 
67 
68  bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id);
69 
70  // TODO(1571) We can't use ToBooleanStub::Types as the return value because
71  // of various cycles in our headers. Death to tons of implementations in
72  // headers!! :-P
74 
75  // Get type information for arithmetic operations and compares.
76  void BinaryType(TypeFeedbackId id,
77  Type** left,
78  Type** right,
79  Type** result,
80  Maybe<int>* fixed_right_arg,
81  Handle<AllocationSite>* allocation_site,
82  Token::Value operation);
83 
85  Type** left,
86  Type** right,
87  Type** combined);
88 
90 
91  Zone* zone() const { return zone_; }
92  Isolate* isolate() const { return zone_->isolate(); }
93 
94  private:
98  SmallMapList* types);
99 
100  void SetInfo(TypeFeedbackId id, Object* target);
101 
102  void BuildDictionary(Handle<Code> code);
106  Code* old_code,
107  Code* new_code);
109 
110  // Returns an element from the backing store. Returns undefined if
111  // there is no information.
113 
114  // Returns an element from the type feedback vector. Returns undefined
115  // if there is no information.
116  Handle<Object> GetInfo(int slot);
117 
118  private:
123 
125 };
126 
127 } } // namespace v8::internal
128 
129 #endif // V8_TYPE_INFO_H_
bool LoadIsUninitialized(TypeFeedbackId id)
Definition: type-info.cc:66
bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id)
Definition: type-info.cc:170
void KeyedPropertyReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types, bool *is_string)
Definition: type-info.cc:266
void CollectReceiverTypes(TypeFeedbackId id, SmallMapList *types)
Definition: type-info.cc:357
void CompareType(TypeFeedbackId id, Type **left, Type **right, Type **combined)
Definition: type-info.cc:176
Handle< Context > native_context_
Definition: type-info.h:119
void ProcessRelocInfos(ZoneList< RelocInfo > *infos)
Definition: type-info.cc:433
bool CallIsMonomorphic(TypeFeedbackId aid)
Handle< TypeFeedbackVector > feedback_vector_
Definition: type-info.h:122
void BinaryType(TypeFeedbackId id, Type **left, Type **right, Type **result, Maybe< int > *fixed_right_arg, Handle< AllocationSite > *allocation_site, Token::Value operation)
Definition: type-info.cc:210
Handle< Object > GetInfo(TypeFeedbackId id)
Definition: type-info.cc:40
KeyedAccessStoreMode GetStoreMode(TypeFeedbackId id)
Definition: type-info.cc:118
Handle< JSFunction > GetCallTarget(int slot)
Definition: type-info.cc:131
void BuildDictionary(Handle< Code > code)
Definition: type-info.cc:391
void CreateDictionary(Handle< Code > code, ZoneList< RelocInfo > *infos)
Definition: type-info.cc:412
void CountReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types)
Definition: type-info.cc:295
Handle< AllocationSite > GetCallNewAllocationSite(int slot)
Definition: type-info.cc:161
byte ToBooleanTypes(TypeFeedbackId id)
Definition: type-info.cc:381
bool StoreIsUninitialized(TypeFeedbackId id)
Definition: type-info.cc:76
void RelocateRelocInfos(ZoneList< RelocInfo > *infos, Code *old_code, Code *new_code)
Definition: type-info.cc:421
Handle< AllocationSite > GetCallAllocationSite(int slot)
Definition: type-info.cc:152
Handle< JSFunction > GetCallNewTarget(int slot)
Definition: type-info.cc:141
void GetRelocInfos(Handle< Code > code, ZoneList< RelocInfo > *infos)
Definition: type-info.cc:403
DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle)
Handle< UnseededNumberDictionary > dictionary_
Definition: type-info.h:121
byte ForInType(int feedback_vector_slot)
Definition: type-info.cc:109
void SetInfo(TypeFeedbackId id, Object *target)
Definition: type-info.cc:459
bool KeyedArrayCallIsHoley(TypeFeedbackId id)
bool CallNewIsMonomorphic(int slot)
Definition: type-info.cc:101
void PropertyReceiverTypes(TypeFeedbackId id, Handle< String > name, SmallMapList *receiver_types)
Definition: type-info.cc:257
Isolate * isolate() const
Definition: type-info.h:92
void KeyedAssignmentReceiverTypes(TypeFeedbackId id, SmallMapList *receiver_types, KeyedAccessStoreMode *store_mode)
Definition: type-info.cc:286
bool StoreIsKeyedPolymorphic(TypeFeedbackId id)
Definition: type-info.cc:84
Type * CountType(TypeFeedbackId id)
Definition: type-info.cc:247
static bool CanRetainOtherContext(Map *map, Context *native_context)
Definition: type-info.cc:326
void AssignmentReceiverTypes(TypeFeedbackId id, Handle< String > name, SmallMapList *receiver_types)
Definition: type-info.cc:278
TypeFeedbackOracle(Handle< Code > code, Handle< TypeFeedbackVector > feedback_vector, Handle< Context > native_context, Zone *zone)
Definition: type-info.cc:21
bool CallIsMonomorphic(int slot)
Definition: type-info.cc:95
Isolate * isolate() const
Definition: zone.h:68
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
KeyedAccessStoreMode
Definition: objects.h:153
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20