A few small refactorings and typo fixes

R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18153 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b506e8ce
......@@ -324,9 +324,9 @@ static bool MakeCrankshaftCode(CompilationInfo* info) {
}
class HOptimizedGraphBuilderWithPotisions: public HOptimizedGraphBuilder {
class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder {
public:
explicit HOptimizedGraphBuilderWithPotisions(CompilationInfo* info)
explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info)
: HOptimizedGraphBuilder(info) {
}
......@@ -468,7 +468,7 @@ RecompileJob::Status RecompileJob::CreateGraph() {
AstTyper::Run(info());
graph_builder_ = FLAG_emit_opt_code_positions
? new(info()->zone()) HOptimizedGraphBuilderWithPotisions(info())
? new(info()->zone()) HOptimizedGraphBuilderWithPositions(info())
: new(info()->zone()) HOptimizedGraphBuilder(info());
Timer t(this, &time_taken_to_create_graph_);
......@@ -513,7 +513,7 @@ RecompileJob::Status RecompileJob::OptimizeGraph() {
ASSERT(graph_ != NULL);
BailoutReason bailout_reason = kNoReason;
if (!graph_->Optimize(&bailout_reason)) {
if (bailout_reason == kNoReason) graph_builder_->Bailout(bailout_reason);
if (bailout_reason != kNoReason) graph_builder_->Bailout(bailout_reason);
return SetLastStatus(BAILED_OUT);
} else {
chunk_ = LChunk::NewChunk(graph_);
......
......@@ -201,7 +201,7 @@ void HEnvironmentLivenessAnalysisPhase::Run() {
HBasicBlock* block = graph()->blocks()->at(block_id);
UpdateLivenessAtBlockEnd(block, &live);
for (HInstruction* instr = block->last(); instr != NULL;
for (HInstruction* instr = block->end(); instr != NULL;
instr = instr->previous()) {
UpdateLivenessAtInstruction(instr, &live);
}
......
......@@ -37,7 +37,7 @@ namespace internal {
class HMarkUnreachableBlocksPhase : public HPhase {
public:
explicit HMarkUnreachableBlocksPhase(HGraph* graph)
: HPhase("H_Mark unrechable blocks", graph) { }
: HPhase("H_Mark unreachable blocks", graph) { }
void Run();
......
......@@ -1602,7 +1602,7 @@ HValue* HGraphBuilder::BuildNumberToString(HValue* object,
if_objectissmi.Else();
{
if (type->Is(Type::Smi())) {
if_objectissmi.Deopt("Excepted smi");
if_objectissmi.Deopt("Expected smi");
} else {
// Check if the object is a heap number.
IfBuilder if_objectisnumber(this);
......@@ -3570,15 +3570,8 @@ void TestContext::BuildBranch(HValue* value) {
if (value != NULL && value->CheckFlag(HValue::kIsArguments)) {
builder->Bailout(kArgumentsObjectValueInATestContext);
}
HBasicBlock* empty_true = builder->graph()->CreateBasicBlock();
HBasicBlock* empty_false = builder->graph()->CreateBasicBlock();
ToBooleanStub::Types expected(condition()->to_boolean_types());
builder->FinishCurrentBlock(builder->New<HBranch>(
value, expected, empty_true, empty_false));
owner()->Goto(empty_true, if_true(), builder->function_state());
owner()->Goto(empty_false , if_false(), builder->function_state());
builder->set_current_block(NULL);
ReturnControl(owner()->New<HBranch>(value, expected), BailoutId::None());
}
......
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