Reviewers: Yang,

Message:
Some small stuff I stumbled over while working on a bigger CL. PTAL.

Description:
A few small refactorings and typo fixes

Please review this at https://codereview.chromium.org/95333002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -15 lines):
  M src/compiler.cc
  M src/hydrogen-environment-liveness.cc
  M src/hydrogen-mark-unreachable.h
  M src/hydrogen.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 1ec2626da9b2ce22eefd25de31468035ba3804c1..83f9ab2daffb78830e80a50e4aefe2aa171af624 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -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_);
Index: src/hydrogen-environment-liveness.cc
diff --git a/src/hydrogen-environment-liveness.cc b/src/hydrogen-environment-liveness.cc index fad9755e5c714176da1a57db03b33a9320a034d1..d7501ac49e6fd2b519a1471a1f6d88543410d16d 100644
--- a/src/hydrogen-environment-liveness.cc
+++ b/src/hydrogen-environment-liveness.cc
@@ -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);
       }
Index: src/hydrogen-mark-unreachable.h
diff --git a/src/hydrogen-mark-unreachable.h b/src/hydrogen-mark-unreachable.h index e9459d5208c2963c1784330fccc43222ab620bed..9ecc6e9f164a0e66b2aa3e9a652e49b9a77c6389 100644
--- a/src/hydrogen-mark-unreachable.h
+++ b/src/hydrogen-mark-unreachable.h
@@ -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();

Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 634d2cacd055f30fc0134b477a3ce05c01ec40e4..3e9ef5e10b72c6092d683a281fb4c3062d16a8ee 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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());
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to