Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: src/full-codegen.h

Issue 3152042: Simplified the full codegens by removing the Expression::kTestValue... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.h ('k') | src/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.h
===================================================================
--- src/full-codegen.h (revision 5316)
+++ src/full-codegen.h (working copy)
@@ -296,8 +296,15 @@
// Helper function to convert a pure value into a test context. The value
// is expected on the stack or the accumulator, depending on the platform.
// See the platform-specific implementation for details.
- void DoTest(Expression::Context context);
+ void DoTest(Label* if_true, Label* if_false, Label* fall_through);
+ // Helper function to split control flow and avoid a branch to the
+ // fall-through label if it is set up.
+ void Split(Condition cc,
+ Label* if_true,
+ Label* if_false,
+ Label* fall_through);
+
void Move(Slot* dst, Register source, Register scratch1, Register scratch2);
void Move(Register dst, Slot* source);
@@ -336,44 +343,6 @@
false_label_ = saved_false;
}
- void VisitForValueControl(Expression* expr,
- Location where,
- Label* if_true,
- Label* if_false) {
- Expression::Context saved_context = context_;
- Location saved_location = location_;
- Label* saved_true = true_label_;
- Label* saved_false = false_label_;
- context_ = Expression::kValueTest;
- location_ = where;
- true_label_ = if_true;
- false_label_ = if_false;
- Visit(expr);
- context_ = saved_context;
- location_ = saved_location;
- true_label_ = saved_true;
- false_label_ = saved_false;
- }
-
- void VisitForControlValue(Expression* expr,
- Location where,
- Label* if_true,
- Label* if_false) {
- Expression::Context saved_context = context_;
- Location saved_location = location_;
- Label* saved_true = true_label_;
- Label* saved_false = false_label_;
- context_ = Expression::kTestValue;
- location_ = where;
- true_label_ = if_true;
- false_label_ = if_false;
- Visit(expr);
- context_ = saved_context;
- location_ = saved_location;
- true_label_ = saved_true;
- false_label_ = saved_false;
- }
-
void VisitDeclarations(ZoneList<Declaration*>* declarations);
void DeclareGlobals(Handle<FixedArray> pairs);
@@ -491,7 +460,12 @@
#undef DECLARE_VISIT
// Handles the shortcutted logical binary operations in VisitBinaryOperation.
void EmitLogicalOperation(BinaryOperation* expr);
+ void VisitLogicalForValue(Expression* expr,
+ Token::Value op,
+ Location where,
+ Label* done);
+
MacroAssembler* masm_;
CompilationInfo* info_;
« no previous file with comments | « src/ast.h ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698