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:
vitalyr@chromium.org 2011-04-05 18:47:46 +00:00
parent 264615745a
commit 38e328d469
2 changed files with 327 additions and 274 deletions

File diff suppressed because it is too large Load Diff

View File

@ -141,6 +141,8 @@ class HBasicBlock: public ZoneObject {
bool IsInlineReturnTarget() const { return is_inline_return_target_; }
void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; }
inline Zone* zone();
#ifdef DEBUG
void Verify();
#endif
@ -201,6 +203,9 @@ class HGraph: public ZoneObject {
public:
explicit HGraph(CompilationInfo* info);
Isolate* isolate() { return isolate_; }
Zone* zone() { return isolate_->zone(); }
const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
const ZoneList<HPhi*>* phi_list() const { return phi_list_; }
HBasicBlock* entry_block() const { return entry_block_; }
@ -281,8 +286,6 @@ class HGraph: public ZoneObject {
void InitializeInferredTypes(int from_inclusive, int to_inclusive);
void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor);
Isolate* isolate() { return isolate_; }
Isolate* isolate_;
int next_block_id_;
HBasicBlock* entry_block_;
@ -301,6 +304,9 @@ class HGraph: public ZoneObject {
};
Zone* HBasicBlock::zone() { return graph_->zone(); }
class HEnvironment: public ZoneObject {
public:
HEnvironment(HEnvironment* outer,
@ -462,6 +468,8 @@ class AstContext {
HGraphBuilder* owner() const { return owner_; }
inline Zone* zone();
// We want to be able to assert, in a context-specific way, that the stack
// height makes sense when the context is filled.
#ifdef DEBUG
@ -630,7 +638,8 @@ class HGraphBuilder: public AstVisitor {
break_scope_(NULL),
graph_(NULL),
current_block_(NULL),
inlined_count_(0) {
inlined_count_(0),
zone_(info->isolate()->zone()) {
// This is not initialized in the initializer list because the
// constructor for the initial state relies on function_state_ == NULL
// to know it's the initial state.
@ -874,6 +883,7 @@ class HGraphBuilder: public AstVisitor {
Handle<Map> receiver_map,
bool smi_and_map_check);
Zone* zone() { return zone_; }
// The translation state of the currently-being-translated function.
FunctionState* function_state_;
@ -893,6 +903,8 @@ class HGraphBuilder: public AstVisitor {
int inlined_count_;
Zone* zone_;
friend class FunctionState; // Pushes and pops the state 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 {
public:
HValueMap()
@ -922,7 +937,10 @@ class HValueMap: public ZoneObject {
}
HValue* Lookup(HValue* value) const;
HValueMap* Copy() const { return new HValueMap(this); }
HValueMap* Copy(Zone* zone) const {
return new(zone) HValueMap(this);
}
private:
// A linked list of HValue* values. Stored in arrays.