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

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

Issue 2754004: Use static type information in ConstantIntBinaryOperation on x64. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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/x64/codegen-x64.h ('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 4831)
+++ src/x64/codegen-x64.cc (working copy)
@@ -6894,7 +6894,8 @@
smi_value,
overwrite_mode);
}
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiAddConstant(operand->reg(),
operand->reg(),
smi_value,
@@ -6915,7 +6916,8 @@
DeferredCode* deferred = new DeferredInlineSmiSub(operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
// A smi currently fits in a 32-bit Immediate.
__ SmiSubConstant(operand->reg(),
operand->reg(),
@@ -6944,7 +6946,8 @@
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiShiftArithmeticRightConstant(operand->reg(),
operand->reg(),
shift_value);
@@ -6971,7 +6974,8 @@
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiShiftLogicalRightConstant(answer.reg(),
operand->reg(),
shift_value,
@@ -7003,12 +7007,8 @@
smi_value,
operand->reg(),
overwrite_mode);
- if (!operand->type_info().IsSmi()) {
- Condition is_smi = masm_->CheckSmi(operand->reg());
- deferred->Branch(NegateCondition(is_smi));
- } else if (FLAG_debug_code) {
- __ AbortIfNotSmi(operand->reg());
- }
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ Move(answer.reg(), smi_value);
__ SmiShiftLeft(answer.reg(), answer.reg(), operand->reg());
@@ -7029,7 +7029,8 @@
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
deferred->BindExit();
answer = *operand;
} else {
@@ -7042,7 +7043,8 @@
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
__ SmiShiftLeftConstant(answer.reg(),
operand->reg(),
shift_value);
@@ -7068,7 +7070,8 @@
operand->reg(),
smi_value,
overwrite_mode);
- __ JumpIfNotSmi(operand->reg(), deferred->entry_label());
+ JumpIfNotSmiUsingTypeInfo(operand->reg(), operand->type_info(),
+ deferred);
if (op == Token::BIT_AND) {
__ SmiAndConstant(operand->reg(), operand->reg(), smi_value);
} else if (op == Token::BIT_XOR) {
@@ -7133,6 +7136,18 @@
}
+void CodeGenerator::JumpIfNotSmiUsingTypeInfo(Register reg,
+ TypeInfo type,
+ DeferredCode* deferred) {
+ if (!type.IsSmi()) {
+ __ JumpIfNotSmi(reg, deferred->entry_label());
+ }
Lasse Reichstein 2010/06/10 10:02:36 Is it possible to have a typeinfo that says that t
+ if (FLAG_debug_code) {
+ __ AbortIfNotSmi(reg);
+ }
+}
+
+
void CodeGenerator::JumpIfNotBothSmiUsingTypeInfo(Register left,
Register right,
TypeInfo left_info,
« no previous file with comments | « src/x64/codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698