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

Unified Diff: src/x64/codegen-x64.cc

Issue 1905002: Make sure that type info of results is correctly recorded when results are mo... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
===================================================================
--- src/x64/codegen-x64.cc (revision 4588)
+++ src/x64/codegen-x64.cc (working copy)
@@ -6404,10 +6404,8 @@
Handle<Object> value,
bool reversed,
OverwriteMode overwrite_mode) {
- // NOTE: This is an attempt to inline (a bit) more of the code for
- // some possible smi operations (like + and -) when (at least) one
- // of the operands is a constant smi.
- // Consumes the argument "operand".
+ // Generate inline code for a binary operation when one of the
+ // operands is a constant smi. Consumes the argument "operand".
if (IsUnsafeSmi(value)) {
Result unsafe_operand(value);
if (reversed) {
@@ -6685,10 +6683,19 @@
return answer;
}
+
+// Implements a binary operation using a deferred code object and some
+// inline code to operate on smis quickly.
Result CodeGenerator::LikelySmiBinaryOperation(BinaryOperation* expr,
Result* left,
Result* right,
OverwriteMode overwrite_mode) {
+ // Copy the type info because left and right may be overwritten.
+ TypeInfo left_type_info = left->type_info();
+ TypeInfo right_type_info = right->type_info();
+ USE(left_type_info);
+ USE(right_type_info);
+ // TODO(X64): Use type information in calculations.
Token::Value op = expr->op();
Result answer;
// Special handling of div and mod because they use fixed registers.
@@ -6813,9 +6820,7 @@
left->reg(),
rcx,
overwrite_mode);
- __ movq(answer.reg(), left->reg());
- __ or_(answer.reg(), rcx);
- __ JumpIfNotSmi(answer.reg(), deferred->entry_label());
+ __ JumpIfNotBothSmi(left->reg(), rcx, deferred->entry_label());
// Perform the operation.
switch (op) {
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698