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

Unified Diff: src/arm/lithium-codegen-arm.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/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index 9fdb22b8d50114c43dba07cab931fa8403f0616f..8cb1210db187d768cb3ec75dea0ca1e64dd85e59 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -4327,28 +4327,9 @@ void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
}
-void LCodeGen::DeoptIfTaggedButNotSmi(LEnvironment* environment,
- HValue* value,
- LOperand* operand) {
- if (value->representation().IsTagged() && !value->type().IsSmi()) {
- if (operand->IsRegister()) {
- __ tst(ToRegister(operand), Operand(kSmiTagMask));
- } else {
- __ mov(ip, ToOperand(operand));
- __ tst(ip, Operand(kSmiTagMask));
- }
- DeoptimizeIf(ne, 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->index()->IsConstantOperand()) {
int constant_index =
ToInteger32(LConstantOperand::cast(instr->index()));
@@ -5318,6 +5299,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();
+ if (operand->IsRegister()) {
+ __ tst(ToRegister(operand), Operand(kSmiTagMask));
+ } else {
+ __ mov(ip, ToOperand(operand));
+ __ tst(ip, Operand(kSmiTagMask));
+ }
+ DeoptimizeIf(ne, instr->environment());
+ }
+}
+
+
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
LOperand* input = instr->value();
__ tst(ToRegister(input), Operand(kSmiTagMask));

Powered by Google App Engine
This is Rietveld 408576698