35 static bool Match(
void* key1,
void* key2) {
36 String* name1 = *
static_cast<String**
>(key1);
37 String* name2 = *
static_cast<String**
>(key2);
40 return name1 == name2;
49 ZoneHashMap::Entry* p = map->
Lookup(name.
location(), name->Hash(),
false,
52 ASSERT(*static_cast<String**>(p->key) == *name);
64 static int current() {
return current_; }
73 void Interface::DoAdd(
74 void* name, uint32_t hash, Interface*
interface, Zone* zone,
bool* ok) {
79 if (FLAG_print_interface_details) {
80 PrintF(
"%*s# Adding...\n", Nesting::current(),
"");
81 PrintF(
"%*sthis = ", Nesting::current(),
"");
82 this->
Print(Nesting::current());
83 PrintF(
"%*s%s : ", Nesting::current(),
"",
84 (*static_cast<String**>(name))->ToAsciiArray());
85 interface->Print(Nesting::current());
90 ZoneAllocationPolicy allocator(zone);
96 ZoneHashMap::Entry* p = (*map)->Lookup(name, hash, !
IsFrozen(), allocator);
100 }
else if (p->value ==
NULL) {
106 static_cast<Interface*
>(p->value)->
Unify(interface, zone, ok);
110 if (FLAG_print_interface_details) {
111 PrintF(
"%*sthis' = ", Nesting::current(),
"");
112 this->
Print(Nesting::current());
113 PrintF(
"%*s# Added.\n", Nesting::current(),
"");
120 if (this->forward_)
return this->Chase()->
Unify(that, zone, ok);
121 if (that->forward_)
return this->
Unify(that->Chase(), zone, ok);
126 if (
this == that)
return;
139 if (FLAG_print_interface_details) {
140 PrintF(
"%*s# Unifying...\n", Nesting::current(),
"");
141 PrintF(
"%*sthis = ", Nesting::current(),
"");
142 this->
Print(Nesting::current());
143 PrintF(
"%*sthat = ", Nesting::current(),
"");
144 that->Print(Nesting::current());
149 if (this->exports_ !=
NULL && (that->exports_ ==
NULL ||
150 this->exports_->occupancy() >= that->exports_->
occupancy())) {
151 this->DoUnify(that, ok, zone);
153 that->DoUnify(
this, ok, zone);
157 if (FLAG_print_interface_details) {
158 PrintF(
"%*sthis' = ", Nesting::current(),
"");
159 this->
Print(Nesting::current());
160 PrintF(
"%*sthat' = ", Nesting::current(),
"");
161 that->Print(Nesting::current());
162 PrintF(
"%*s# Unified.\n", Nesting::current(),
"");
168 void Interface::DoUnify(
Interface* that,
bool* ok,
Zone* zone) {
182 for (ZoneHashMap::Entry* p = map->
Start(); p !=
NULL; p = map->
Next(p)) {
183 this->DoAdd(p->key, p->hash, static_cast<Interface*>(p->value), zone, ok);
190 int this_size = this->exports_ ==
NULL ? 0 : this->exports_->
occupancy();
192 if (that->
IsFrozen() && this_size > that_size) {
198 if (!that->instance_.is_null()) {
199 if (!this->instance_.is_null() && *this->instance_ != *that->instance_) {
203 this->instance_ = that->instance_;
207 this->flags_ |= that->flags_;
208 that->forward_ =
this;
214 int n0 = n > 0 ? n : 0;
216 if (FLAG_print_interface_details) {
217 PrintF(
"%p", static_cast<void*>(
this));
218 for (Interface* link = this->forward_; link !=
NULL; link = link->forward_)
219 PrintF(
"->%p", static_cast<void*>(link));
232 if (map ==
NULL || map->occupancy() == 0) {
234 }
else if (n < 0 || n0 >= 2 * FLAG_print_interface_depth) {
239 for (ZoneHashMap::Entry* p = map->Start(); p !=
NULL; p = map->Next(p)) {
240 String* name = *
static_cast<String**
>(p->key);
241 Interface*
interface = static_cast<Interface*>(p->value);
242 PrintF(
"%*s%s : ", n0 + 2,
"", name->ToAsciiArray());
243 interface->Print(n0 + 2);
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting 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 more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including on console Map counters to a file Enable debugger compile events enable GDBJIT interface(disables compacting GC)") DEFINE_bool(gdbjit_full
void PrintF(const char *format,...)
Interface * Lookup(Handle< String > name, Zone *zone)
#define ASSERT(condition)
v8::Handle< v8::Value > Print(const v8::Arguments &args)
void Unify(Interface *that, Zone *zone, bool *ok)
uint32_t occupancy() const
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
void MakeModule(bool *ok)
static const uint32_t kDefaultHashMapCapacity
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if NULL
TemplateHashMapImpl< ZoneAllocationPolicy > ZoneHashMap
Entry * Next(Entry *p) const