is_osr_entry_(false) { }
+Isolate* HBasicBlock::isolate() const {
+ return graph_->isolate();
+}
+
+
void HBasicBlock::AttachLoopInformation() {
ASSERT(!IsLoopHeader());
loop_information_ = new(zone()) HLoopInformation(this, zone());
HGraph* HGraphBuilder::CreateGraph() {
graph_ = new(zone()) HGraph(info_);
- if (FLAG_hydrogen_stats) HStatistics::Instance()->Initialize(info_);
- HPhase phase("H_Block building", graph()->isolate());
+ if (FLAG_hydrogen_stats) isolate()->GetHStatistics()->Initialize(info_);
+ HPhase phase("H_Block building", isolate());
set_current_block(graph()->entry_block());
if (!BuildGraph()) return NULL;
return graph_;
AddInstruction(new(zone) HLoadElements(object, mapcheck));
if (is_store && (fast_elements || fast_smi_only_elements)) {
HCheckMaps* check_cow_map = new(zone) HCheckMaps(
- elements, graph()->isolate()->factory()->fixed_array_map(), zone);
+ elements, isolate()->factory()->fixed_array_map(), zone);
check_cow_map->ClearGVNFlag(kDependsOnElementsKind);
AddInstruction(check_cow_map);
}
HValue* elements =
AddInstruction(new(zone) HAllocate(context, total_size,
HType::JSArray(), flags));
- Isolate* isolate = graph()->isolate();
- Factory* factory = isolate->factory();
+ Factory* factory = isolate()->factory();
Handle<Map> map = IsFastDoubleElementsKind(kind)
? factory->fixed_double_array_map()
: factory->fixed_array_map();
BuildStoreMap(elements, map, BailoutId::StubEntry());
- Handle<String> fixed_array_length_field_name =
- isolate->factory()->length_field_string();
+ Handle<String> fixed_array_length_field_name = factory->length_field_string();
HInstruction* store_length =
new(zone) HStoreNamedField(elements, fixed_array_length_field_name,
capacity, true, FixedArray::kLengthOffset);
HValue* map,
BailoutId id) {
Zone* zone = this->zone();
- Isolate* isolate = graph()->isolate();
- Factory* factory = isolate->factory();
+ Factory* factory = isolate()->factory();
Handle<String> map_field_name = factory->map_field_string();
HInstruction* store_map =
new(zone) HStoreNamedField(object, map_field_name, map,
return HandleLiteralCompareTypeof(expr, typeof_expr, check);
}
HValue* sub_expr = NULL;
- Factory* f = graph()->isolate()->factory();
+ Factory* f = isolate()->factory();
if (IsLiteralCompareNil(left, op, right, f->undefined_value(), &sub_expr)) {
return HandleLiteralCompareNil(expr, sub_expr, kUndefinedValue);
}
void HTracer::TraceLithium(const char* name, LChunk* chunk) {
- AllowHandleDereference allow_handle_deref(chunk->graph()->isolate());
+ AllowHandleDereference allow_handle_deref(chunk->isolate());
Trace(name, chunk->graph(), chunk);
}
HPhase::HPhase(const char* name, LChunk* chunk) {
- Init(chunk->graph()->isolate(), name, NULL, chunk, NULL);
+ Init(chunk->isolate(), name, NULL, chunk, NULL);
}
HPhase::HPhase(const char* name, LAllocator* allocator) {
- Init(allocator->graph()->isolate(), name, NULL, NULL, allocator);
+ Init(allocator->isolate(), name, NULL, NULL, allocator);
}
if (FLAG_hydrogen_stats) {
int64_t ticks = OS::Ticks() - start_ticks_;
unsigned size = Zone::allocation_size_ - start_allocation_size_;
- HStatistics::Instance()->SaveTiming(name_, ticks, size);
+ isolate_->GetHStatistics()->SaveTiming(name_, ticks, size);
}
// Produce trace output if flag is set so that the first letter of the
int block_id() const { return block_id_; }
void set_block_id(int id) { block_id_ = id; }
HGraph* graph() const { return graph_; }
+ Isolate* isolate() const;
const ZoneList<HPhi*>* phis() const { return &phis_; }
HInstruction* first() const { return first_; }
HInstruction* last() const { return last_; }
return current_block()->last_environment();
}
Zone* zone() const { return info_->zone(); }
- HGraph* graph() { return graph_; }
+ HGraph* graph() const { return graph_; }
+ Isolate* isolate() const { return graph_->isolate(); }
HGraph* CreateGraph();
class HStatistics: public Malloced {
public:
+ HStatistics()
+ : timing_(5),
+ names_(5),
+ sizes_(5),
+ create_graph_(0),
+ optimize_graph_(0),
+ generate_code_(0),
+ total_size_(0),
+ full_code_gen_(0),
+ source_size_(0) { }
+
void Initialize(CompilationInfo* info);
void Print();
void SaveTiming(const char* name, int64_t ticks, unsigned size);
- static HStatistics* Instance() {
- static SetOncePointer<HStatistics> instance;
- if (!instance.is_set()) {
- instance.set(new HStatistics());
- }
- return instance.get();
- }
void IncrementSubtotals(int64_t create_graph,
int64_t optimize_graph,
}
private:
- HStatistics()
- : timing_(5),
- names_(5),
- sizes_(5),
- create_graph_(0),
- optimize_graph_(0),
- generate_code_(0),
- total_size_(0),
- full_code_gen_(0),
- source_size_(0) { }
-
List<int64_t> timing_;
List<const char*> names_;
List<unsigned> sizes_;
private:
void Init(Isolate* isolate,
- const char* name,
- HGraph* graph,
- LChunk* chunk,
- LAllocator* allocator);
+ const char* name,
+ HGraph* graph,
+ LChunk* chunk,
+ LAllocator* allocator);
Isolate* isolate_;
const char* name_;