summaryrefslogtreecommitdiff
path: root/deps/v8/src/x64/codegen-x64.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-03-26 09:09:40 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-03-26 09:09:40 -0700
commit6192b8659a3dedb86393cfb78121a26f2a3e31e6 (patch)
tree78b74bbdc1a7cdd8989e32db309050d6e51ba346 /deps/v8/src/x64/codegen-x64.cc
parentbb00fef3cd2ff446aa5c1894fb4830f83750018a (diff)
downloadnode-6192b8659a3dedb86393cfb78121a26f2a3e31e6.tar.gz
Upgrade V8 to 2.1.10
Diffstat (limited to 'deps/v8/src/x64/codegen-x64.cc')
-rw-r--r--deps/v8/src/x64/codegen-x64.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/deps/v8/src/x64/codegen-x64.cc b/deps/v8/src/x64/codegen-x64.cc
index 108384cf1..dd8015f14 100644
--- a/deps/v8/src/x64/codegen-x64.cc
+++ b/deps/v8/src/x64/codegen-x64.cc
@@ -3281,13 +3281,7 @@ void CodeGenerator::VisitCountOperation(CountOperation* node) {
}
-void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
- // TODO(X64): This code was copied verbatim from codegen-ia32.
- // Either find a reason to change it or move it to a shared location.
-
- Comment cmnt(masm_, "[ BinaryOperation");
- Token::Value op = node->op();
-
+void CodeGenerator::GenerateLogicalBooleanOperation(BinaryOperation* node) {
// According to ECMA-262 section 11.11, page 58, the binary logical
// operators must yield the result of one of the two expressions
// before any ToBoolean() conversions. This means that the value
@@ -3297,7 +3291,7 @@ void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
// control flow), we force the right hand side to do the same. This
// is necessary because we assume that if we get control flow on the
// last path out of an expression we got it on all paths.
- if (op == Token::AND) {
+ if (node->op() == Token::AND) {
JumpTarget is_true;
ControlDestination dest(&is_true, destination()->false_target(), true);
LoadCondition(node->left(), &dest, false);
@@ -3360,7 +3354,8 @@ void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
exit.Bind();
}
- } else if (op == Token::OR) {
+ } else {
+ ASSERT(node->op() == Token::OR);
JumpTarget is_false;
ControlDestination dest(destination()->true_target(), &is_false, false);
LoadCondition(node->left(), &dest, false);
@@ -3421,7 +3416,14 @@ void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
// Exit (always with a materialized value).
exit.Bind();
}
+ }
+}
+
+void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
+ Comment cmnt(masm_, "[ BinaryOperation");
+ if (node->op() == Token::AND || node->op() == Token::OR) {
+ GenerateLogicalBooleanOperation(node);
} else {
// NOTE: The code below assumes that the slow cases (calls to runtime)
// never return a constant/immutable object.