Use placement new for zone objects in hydrogen.
Review URL: http://codereview.chromium.org/6794041 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
264615745a
commit
38e328d469
575
src/hydrogen.cc
575
src/hydrogen.cc
File diff suppressed because it is too large
Load Diff
@ -141,6 +141,8 @@ class HBasicBlock: public ZoneObject {
|
|||||||
bool IsInlineReturnTarget() const { return is_inline_return_target_; }
|
bool IsInlineReturnTarget() const { return is_inline_return_target_; }
|
||||||
void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; }
|
void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; }
|
||||||
|
|
||||||
|
inline Zone* zone();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void Verify();
|
void Verify();
|
||||||
#endif
|
#endif
|
||||||
@ -201,6 +203,9 @@ class HGraph: public ZoneObject {
|
|||||||
public:
|
public:
|
||||||
explicit HGraph(CompilationInfo* info);
|
explicit HGraph(CompilationInfo* info);
|
||||||
|
|
||||||
|
Isolate* isolate() { return isolate_; }
|
||||||
|
Zone* zone() { return isolate_->zone(); }
|
||||||
|
|
||||||
const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
|
const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
|
||||||
const ZoneList<HPhi*>* phi_list() const { return phi_list_; }
|
const ZoneList<HPhi*>* phi_list() const { return phi_list_; }
|
||||||
HBasicBlock* entry_block() const { return entry_block_; }
|
HBasicBlock* entry_block() const { return entry_block_; }
|
||||||
@ -281,8 +286,6 @@ class HGraph: public ZoneObject {
|
|||||||
void InitializeInferredTypes(int from_inclusive, int to_inclusive);
|
void InitializeInferredTypes(int from_inclusive, int to_inclusive);
|
||||||
void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor);
|
void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor);
|
||||||
|
|
||||||
Isolate* isolate() { return isolate_; }
|
|
||||||
|
|
||||||
Isolate* isolate_;
|
Isolate* isolate_;
|
||||||
int next_block_id_;
|
int next_block_id_;
|
||||||
HBasicBlock* entry_block_;
|
HBasicBlock* entry_block_;
|
||||||
@ -301,6 +304,9 @@ class HGraph: public ZoneObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Zone* HBasicBlock::zone() { return graph_->zone(); }
|
||||||
|
|
||||||
|
|
||||||
class HEnvironment: public ZoneObject {
|
class HEnvironment: public ZoneObject {
|
||||||
public:
|
public:
|
||||||
HEnvironment(HEnvironment* outer,
|
HEnvironment(HEnvironment* outer,
|
||||||
@ -462,6 +468,8 @@ class AstContext {
|
|||||||
|
|
||||||
HGraphBuilder* owner() const { return owner_; }
|
HGraphBuilder* owner() const { return owner_; }
|
||||||
|
|
||||||
|
inline Zone* zone();
|
||||||
|
|
||||||
// We want to be able to assert, in a context-specific way, that the stack
|
// We want to be able to assert, in a context-specific way, that the stack
|
||||||
// height makes sense when the context is filled.
|
// height makes sense when the context is filled.
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -630,7 +638,8 @@ class HGraphBuilder: public AstVisitor {
|
|||||||
break_scope_(NULL),
|
break_scope_(NULL),
|
||||||
graph_(NULL),
|
graph_(NULL),
|
||||||
current_block_(NULL),
|
current_block_(NULL),
|
||||||
inlined_count_(0) {
|
inlined_count_(0),
|
||||||
|
zone_(info->isolate()->zone()) {
|
||||||
// This is not initialized in the initializer list because the
|
// This is not initialized in the initializer list because the
|
||||||
// constructor for the initial state relies on function_state_ == NULL
|
// constructor for the initial state relies on function_state_ == NULL
|
||||||
// to know it's the initial state.
|
// to know it's the initial state.
|
||||||
@ -874,6 +883,7 @@ class HGraphBuilder: public AstVisitor {
|
|||||||
Handle<Map> receiver_map,
|
Handle<Map> receiver_map,
|
||||||
bool smi_and_map_check);
|
bool smi_and_map_check);
|
||||||
|
|
||||||
|
Zone* zone() { return zone_; }
|
||||||
|
|
||||||
// The translation state of the currently-being-translated function.
|
// The translation state of the currently-being-translated function.
|
||||||
FunctionState* function_state_;
|
FunctionState* function_state_;
|
||||||
@ -893,6 +903,8 @@ class HGraphBuilder: public AstVisitor {
|
|||||||
|
|
||||||
int inlined_count_;
|
int inlined_count_;
|
||||||
|
|
||||||
|
Zone* zone_;
|
||||||
|
|
||||||
friend class FunctionState; // Pushes and pops the state stack.
|
friend class FunctionState; // Pushes and pops the state stack.
|
||||||
friend class AstContext; // Pushes and pops the AST context stack.
|
friend class AstContext; // Pushes and pops the AST context stack.
|
||||||
|
|
||||||
@ -900,6 +912,9 @@ class HGraphBuilder: public AstVisitor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Zone* AstContext::zone() { return owner_->zone(); }
|
||||||
|
|
||||||
|
|
||||||
class HValueMap: public ZoneObject {
|
class HValueMap: public ZoneObject {
|
||||||
public:
|
public:
|
||||||
HValueMap()
|
HValueMap()
|
||||||
@ -922,7 +937,10 @@ class HValueMap: public ZoneObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HValue* Lookup(HValue* value) const;
|
HValue* Lookup(HValue* value) const;
|
||||||
HValueMap* Copy() const { return new HValueMap(this); }
|
|
||||||
|
HValueMap* Copy(Zone* zone) const {
|
||||||
|
return new(zone) HValueMap(this);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// A linked list of HValue* values. Stored in arrays.
|
// A linked list of HValue* values. Stored in arrays.
|
||||||
|
Loading…
Reference in New Issue
Block a user