Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index 52cb5015500643de79e517cb52fb2ae8755c912a..9353ab515617006609013744cb2035b04d38eae1 100644 |
--- a/src/full-codegen.cc |
+++ b/src/full-codegen.cc |
@@ -441,7 +441,7 @@ void FullCodeGenerator::TestContext::Plug(Register reg) const { |
// For simplicity we always test the accumulator register. |
__ Move(result_register(), reg); |
codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); |
- codegen()->DoTest(true_label_, false_label_, fall_through_); |
+ codegen()->DoTest(this); |
} |
@@ -463,7 +463,7 @@ void FullCodeGenerator::TestContext::PlugTOS() const { |
// For simplicity we always test the accumulator register. |
__ pop(result_register()); |
codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); |
- codegen()->DoTest(true_label_, false_label_, fall_through_); |
+ codegen()->DoTest(this); |
} |
@@ -513,6 +513,14 @@ void FullCodeGenerator::TestContext::PrepareTest( |
} |
+void FullCodeGenerator::DoTest(const TestContext* context) { |
+ DoTest(context->condition(), |
+ context->true_label(), |
+ context->false_label(), |
+ context->fall_through()); |
+} |
+ |
+ |
void FullCodeGenerator::VisitDeclarations( |
ZoneList<Declaration*>* declarations) { |
int length = declarations->length(); |
@@ -734,9 +742,9 @@ void FullCodeGenerator::VisitLogicalExpression(BinaryOperation* expr) { |
Label discard, restore; |
PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); |
if (is_logical_and) { |
- DoTest(&discard, &restore, &restore); |
+ DoTest(left, &discard, &restore, &restore); |
} else { |
- DoTest(&restore, &discard, &restore); |
+ DoTest(left, &restore, &discard, &restore); |
} |
__ bind(&restore); |
__ pop(result_register()); |
@@ -753,9 +761,9 @@ void FullCodeGenerator::VisitLogicalExpression(BinaryOperation* expr) { |
Label discard; |
PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); |
if (is_logical_and) { |
- DoTest(&discard, &done, &discard); |
+ DoTest(left, &discard, &done, &discard); |
} else { |
- DoTest(&done, &discard, &discard); |
+ DoTest(left, &done, &discard, &discard); |
} |
__ bind(&discard); |
__ Drop(1); |
@@ -1099,9 +1107,7 @@ void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { |
{ Comment cmnt(masm_, "[ Extend catch context"); |
__ Push(stmt->name()); |
__ push(result_register()); |
- __ CallRuntime(Runtime::kCreateCatchExtensionObject, 2); |
- __ push(result_register()); |
- __ CallRuntime(Runtime::kPushCatchContext, 1); |
+ __ CallRuntime(Runtime::kPushCatchContext, 2); |
StoreToFrameField(StandardFrameConstants::kContextOffset, |
context_register()); |
} |