| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4066 __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC); | 4066 __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC); |
| 4067 __ b(vs, &stub_call); | 4067 __ b(vs, &stub_call); |
| 4068 // We could eliminate this smi check if we split the code at | 4068 // We could eliminate this smi check if we split the code at |
| 4069 // the first smi check before calling ToNumber. | 4069 // the first smi check before calling ToNumber. |
| 4070 patch_site.EmitJumpIfSmi(r0, &done); | 4070 patch_site.EmitJumpIfSmi(r0, &done); |
| 4071 | 4071 |
| 4072 __ bind(&stub_call); | 4072 __ bind(&stub_call); |
| 4073 // Call stub. Undo operation first. | 4073 // Call stub. Undo operation first. |
| 4074 __ sub(r0, r0, Operand(Smi::FromInt(count_value))); | 4074 __ sub(r0, r0, Operand(Smi::FromInt(count_value))); |
| 4075 } | 4075 } |
| 4076 __ mov(r1, Operand(Smi::FromInt(count_value))); | 4076 __ mov(r1, r0); |
| 4077 __ mov(r0, Operand(Smi::FromInt(count_value))); |
| 4077 | 4078 |
| 4078 // Record position before stub call. | 4079 // Record position before stub call. |
| 4079 SetSourcePosition(expr->position()); | 4080 SetSourcePosition(expr->position()); |
| 4080 | 4081 |
| 4081 BinaryOpStub stub(Token::ADD, NO_OVERWRITE); | 4082 BinaryOpStub stub(Token::ADD, NO_OVERWRITE); |
| 4082 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountBinOpFeedbackId()); | 4083 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountBinOpFeedbackId()); |
| 4083 patch_site.EmitPatchInfo(); | 4084 patch_site.EmitPatchInfo(); |
| 4084 __ bind(&done); | 4085 __ bind(&done); |
| 4085 | 4086 |
| 4086 // Store the value returned in r0. | 4087 // Store the value returned in r0. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4291 __ CallStub(&stub); | 4292 __ CallStub(&stub); |
| 4292 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4293 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4293 // The stub returns 0 for true. | 4294 // The stub returns 0 for true. |
| 4294 __ tst(r0, r0); | 4295 __ tst(r0, r0); |
| 4295 Split(eq, if_true, if_false, fall_through); | 4296 Split(eq, if_true, if_false, fall_through); |
| 4296 break; | 4297 break; |
| 4297 } | 4298 } |
| 4298 | 4299 |
| 4299 default: { | 4300 default: { |
| 4300 VisitForAccumulatorValue(expr->right()); | 4301 VisitForAccumulatorValue(expr->right()); |
| 4301 Condition cond = eq; | 4302 Condition cond = CompareIC::ComputeCondition(op); |
| 4302 switch (op) { | |
| 4303 case Token::EQ_STRICT: | |
| 4304 case Token::EQ: | |
| 4305 cond = eq; | |
| 4306 break; | |
| 4307 case Token::LT: | |
| 4308 cond = lt; | |
| 4309 break; | |
| 4310 case Token::GT: | |
| 4311 cond = gt; | |
| 4312 break; | |
| 4313 case Token::LTE: | |
| 4314 cond = le; | |
| 4315 break; | |
| 4316 case Token::GTE: | |
| 4317 cond = ge; | |
| 4318 break; | |
| 4319 case Token::IN: | |
| 4320 case Token::INSTANCEOF: | |
| 4321 default: | |
| 4322 UNREACHABLE(); | |
| 4323 } | |
| 4324 __ pop(r1); | 4303 __ pop(r1); |
| 4325 | 4304 |
| 4326 bool inline_smi_code = ShouldInlineSmiCase(op); | 4305 bool inline_smi_code = ShouldInlineSmiCase(op); |
| 4327 JumpPatchSite patch_site(masm_); | 4306 JumpPatchSite patch_site(masm_); |
| 4328 if (inline_smi_code) { | 4307 if (inline_smi_code) { |
| 4329 Label slow_case; | 4308 Label slow_case; |
| 4330 __ orr(r2, r0, Operand(r1)); | 4309 __ orr(r2, r0, Operand(r1)); |
| 4331 patch_site.EmitJumpIfNotSmi(r2, &slow_case); | 4310 patch_site.EmitJumpIfNotSmi(r2, &slow_case); |
| 4332 __ cmp(r1, r0); | 4311 __ cmp(r1, r0); |
| 4333 Split(cond, if_true, if_false, NULL); | 4312 Split(cond, if_true, if_false, NULL); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4536 *context_length = 0; | 4515 *context_length = 0; |
| 4537 return previous_; | 4516 return previous_; |
| 4538 } | 4517 } |
| 4539 | 4518 |
| 4540 | 4519 |
| 4541 #undef __ | 4520 #undef __ |
| 4542 | 4521 |
| 4543 } } // namespace v8::internal | 4522 } } // namespace v8::internal |
| 4544 | 4523 |
| 4545 #endif // V8_TARGET_ARCH_ARM | 4524 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |