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

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

Issue 12208013: Separated smi check from HBoundsCheck. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index f71bf38e42a0ecae4453f12dd29b9a018c5c550d..94f8a026efb008230a261bdbb195242d433ee7b7 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -3924,28 +3924,9 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
}
-void LCodeGen::DeoptIfTaggedButNotSmi(LEnvironment* environment,
- HValue* value,
- LOperand* operand) {
- if (value->representation().IsTagged() && !value->type().IsSmi()) {
- Condition cc;
- if (operand->IsRegister()) {
- cc = masm()->CheckSmi(ToRegister(operand));
- } else {
- cc = masm()->CheckSmi(ToOperand(operand));
- }
- DeoptimizeIf(NegateCondition(cc), environment);
- }
-}
-
-
void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
- DeoptIfTaggedButNotSmi(instr->environment(),
- instr->hydrogen()->length(),
- instr->length());
- DeoptIfTaggedButNotSmi(instr->environment(),
- instr->hydrogen()->index(),
- instr->index());
+ if (instr->hydrogen()->skip_check()) return;
+
if (instr->length()->IsRegister()) {
Register reg = ToRegister(instr->length());
if (!instr->hydrogen()->length()->representation().IsTagged()) {
@@ -4751,6 +4732,22 @@ void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
}
+void LCodeGen::DoDeoptimizeIfTaggedIsNotSmi(
+ LDeoptimizeIfTaggedIsNotSmi* instr) {
+ if (instr->hydrogen_value()->representation().IsTagged() &&
+ !instr->hydrogen_value()->type().IsSmi()) {
+ LOperand* operand = instr->value();
+ Condition cc;
+ if (operand->IsRegister()) {
+ cc = masm()->CheckSmi(ToRegister(operand));
+ } else {
+ cc = masm()->CheckSmi(ToOperand(operand));
+ }
+ DeoptimizeIf(NegateCondition(cc), instr->environment());
+ }
+}
+
+
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
LOperand* input = instr->value();
Condition cc = masm()->CheckSmi(ToRegister(input));

Powered by Google App Engine
This is Rietveld 408576698