Refactor GenericBinaryOperation and its helper functions to always return a Result.

This is a preparation step for including number type information
in the virtual frame. We need a common place where we can update
the number type information of the result of a binary operation
since we should not modify the state of the virtual frame elements
directly.

Review URL: http://codereview.chromium.org/551080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3661 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6ad58b53
This diff is collapsed.
...@@ -444,20 +444,20 @@ class CodeGenerator: public AstVisitor { ...@@ -444,20 +444,20 @@ class CodeGenerator: public AstVisitor {
// Emit code to perform a binary operation on a constant // Emit code to perform a binary operation on a constant
// smi and a likely smi. Consumes the Result *operand. // smi and a likely smi. Consumes the Result *operand.
void ConstantSmiBinaryOperation(Token::Value op, Result ConstantSmiBinaryOperation(Token::Value op,
Result* operand, Result* operand,
Handle<Object> constant_operand, Handle<Object> constant_operand,
StaticType* type, StaticType* type,
bool reversed, bool reversed,
OverwriteMode overwrite_mode); OverwriteMode overwrite_mode);
// Emit code to perform a binary operation on two likely smis. // Emit code to perform a binary operation on two likely smis.
// The code to handle smi arguments is produced inline. // The code to handle smi arguments is produced inline.
// Consumes the Results *left and *right. // Consumes the Results *left and *right.
void LikelySmiBinaryOperation(Token::Value op, Result LikelySmiBinaryOperation(Token::Value op,
Result* left, Result* left,
Result* right, Result* right,
OverwriteMode overwrite_mode); OverwriteMode overwrite_mode);
void Comparison(AstNode* node, void Comparison(AstNode* node,
Condition cc, Condition cc,
......
This diff is collapsed.
...@@ -446,20 +446,20 @@ class CodeGenerator: public AstVisitor { ...@@ -446,20 +446,20 @@ class CodeGenerator: public AstVisitor {
// Emit code to perform a binary operation on a constant // Emit code to perform a binary operation on a constant
// smi and a likely smi. Consumes the Result *operand. // smi and a likely smi. Consumes the Result *operand.
void ConstantSmiBinaryOperation(Token::Value op, Result ConstantSmiBinaryOperation(Token::Value op,
Result* operand, Result* operand,
Handle<Object> constant_operand, Handle<Object> constant_operand,
StaticType* type, StaticType* type,
bool reversed, bool reversed,
OverwriteMode overwrite_mode); OverwriteMode overwrite_mode);
// Emit code to perform a binary operation on two likely smis. // Emit code to perform a binary operation on two likely smis.
// The code to handle smi arguments is produced inline. // The code to handle smi arguments is produced inline.
// Consumes the Results *left and *right. // Consumes the Results *left and *right.
void LikelySmiBinaryOperation(Token::Value op, Result LikelySmiBinaryOperation(Token::Value op,
Result* left, Result* left,
Result* right, Result* right,
OverwriteMode overwrite_mode); OverwriteMode overwrite_mode);
void Comparison(Condition cc, void Comparison(Condition cc,
bool strict, bool strict,
......
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