Commit b8fd2527 authored by danno@chromium.org's avatar danno@chromium.org

Fix bugs in previous_ast_id tracking

R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/12957005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14045 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ba266661
......@@ -106,13 +106,12 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
Zone* zone = this->zone();
int param_count = descriptor_->register_param_count_;
HEnvironment* start_environment = graph()->start_environment();
HBasicBlock* next_block = CreateBasicBlock(start_environment);
HBasicBlock* next_block =
CreateBasicBlock(start_environment, BailoutId::StubEntry());
current_block()->Goto(next_block);
next_block->SetJoinId(BailoutId::StubEntry());
set_current_block(next_block);
start_environment->set_ast_id(BailoutId::StubEntry());
HConstant* undefined_constant = new(zone) HConstant(
isolate()->factory()->undefined_value(), Representation::Tagged());
AddInstruction(undefined_constant);
......@@ -186,7 +185,7 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
NULL,
FAST_ELEMENTS));
CheckBuilder builder(this, BailoutId::StubEntry());
CheckBuilder builder(this);
builder.CheckNotUndefined(boilerplate);
int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
......@@ -281,7 +280,7 @@ HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
ElementsKind to_kind = casted_stub()->to_kind();
BuildNewSpaceArrayCheck(array_length, to_kind);
IfBuilder if_builder(this, BailoutId::StubEntry());
IfBuilder if_builder(this);
if_builder.BeginIf(array_length, graph()->GetConstant0(), Token::EQ);
......@@ -296,13 +295,11 @@ HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
AddInstruction(new(zone) HFixedArrayBaseLength(elements));
HValue* new_elements =
BuildAllocateElements(context(), to_kind, elements_length,
BailoutId::StubEntry());
BuildAllocateElements(context(), to_kind, elements_length);
BuildCopyElements(context(), elements,
casted_stub()->from_kind(), new_elements,
to_kind, array_length, elements_length,
BailoutId::StubEntry());
to_kind, array_length, elements_length);
Factory* factory = isolate()->factory();
......
This diff is collapsed.
......@@ -108,7 +108,7 @@ class HBasicBlock: public ZoneObject {
bool Dominates(HBasicBlock* other) const;
int LoopNestingDepth() const;
void SetInitialEnvironment(HEnvironment* env);
void SetInitialEnvironment(HEnvironment* env, BailoutId previous_id);
void ClearEnvironment() { last_environment_ = NULL; }
bool HasEnvironment() const { return last_environment_ != NULL; }
void UpdateEnvironment(HEnvironment* env) { last_environment_ = env; }
......@@ -483,6 +483,8 @@ class HEnvironment: public ZoneObject {
BailoutId ast_id() const { return ast_id_; }
void set_ast_id(BailoutId id) { ast_id_ = id; }
BailoutId previous_ast_id() const { return previous_ast_id_; }
void set_previous_ast_id(BailoutId id) { previous_ast_id_ = id; }
HEnterInlined* entry() const { return entry_; }
void set_entry(HEnterInlined* entry) { entry_ = entry; }
......@@ -644,6 +646,7 @@ class HEnvironment: public ZoneObject {
int pop_count_;
int push_count_;
BailoutId ast_id_;
BailoutId previous_ast_id_;
Zone* zone_;
};
......@@ -891,8 +894,9 @@ class HGraphBuilder {
protected:
virtual bool BuildGraph() = 0;
HBasicBlock* CreateBasicBlock(HEnvironment* env);
HBasicBlock* CreateLoopHeaderBlock();
HBasicBlock* CreateBasicBlock(HEnvironment* envy,
BailoutId previous_ast_id);
HBasicBlock* CreateLoopHeaderBlock(BailoutId previous_ast_id);
// Building common constructs
HInstruction* BuildExternalArrayElementAccess(
......@@ -940,7 +944,7 @@ class HGraphBuilder {
class CheckBuilder {
public:
CheckBuilder(HGraphBuilder* builder, BailoutId id);
explicit CheckBuilder(HGraphBuilder* builder);
~CheckBuilder() {
if (!finished_) End();
}
......@@ -962,7 +966,7 @@ class HGraphBuilder {
class IfBuilder {
public:
IfBuilder(HGraphBuilder* builder, BailoutId id);
explicit IfBuilder(HGraphBuilder* builder);
~IfBuilder() {
if (!finished_) End();
}
......@@ -1001,8 +1005,7 @@ class HGraphBuilder {
LoopBuilder(HGraphBuilder* builder,
HValue* context,
Direction direction,
BailoutId id);
Direction direction);
~LoopBuilder() {
ASSERT(finished_);
}
......@@ -1037,22 +1040,19 @@ class HGraphBuilder {
HValue* BuildAllocateElements(HValue* context,
ElementsKind kind,
HValue* capacity,
BailoutId ast_id);
HValue* capacity);
HValue* BuildGrowElementsCapacity(HValue* object,
HValue* elements,
ElementsKind kind,
HValue* length,
HValue* new_capacity,
BailoutId ast_id);
HValue* new_capacity);
void BuildFillElementsWithHole(HValue* context,
HValue* elements,
ElementsKind elements_kind,
HValue* from,
HValue* to,
BailoutId ast_id);
HValue* to);
void BuildCopyElements(HValue* context,
HValue* from_elements,
......@@ -1060,8 +1060,7 @@ class HGraphBuilder {
HValue* to_elements,
ElementsKind to_elements_kind,
HValue* length,
HValue* capacity,
BailoutId ast_id);
HValue* capacity);
private:
HGraphBuilder();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment