| 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 4052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4063 __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC); | 4063 __ add(r0, r0, Operand(Smi::FromInt(count_value)), SetCC); |
| 4064 __ b(vs, &stub_call); | 4064 __ b(vs, &stub_call); |
| 4065 // We could eliminate this smi check if we split the code at | 4065 // We could eliminate this smi check if we split the code at |
| 4066 // the first smi check before calling ToNumber. | 4066 // the first smi check before calling ToNumber. |
| 4067 patch_site.EmitJumpIfSmi(r0, &done); | 4067 patch_site.EmitJumpIfSmi(r0, &done); |
| 4068 | 4068 |
| 4069 __ bind(&stub_call); | 4069 __ bind(&stub_call); |
| 4070 // Call stub. Undo operation first. | 4070 // Call stub. Undo operation first. |
| 4071 __ sub(r0, r0, Operand(Smi::FromInt(count_value))); | 4071 __ sub(r0, r0, Operand(Smi::FromInt(count_value))); |
| 4072 } | 4072 } |
| 4073 __ mov(r1, Operand(Smi::FromInt(count_value))); | 4073 __ mov(r1, r0); |
| 4074 __ mov(r0, Operand(Smi::FromInt(count_value))); |
| 4074 | 4075 |
| 4075 // Record position before stub call. | 4076 // Record position before stub call. |
| 4076 SetSourcePosition(expr->position()); | 4077 SetSourcePosition(expr->position()); |
| 4077 | 4078 |
| 4078 BinaryOpStub stub(Token::ADD, NO_OVERWRITE); | 4079 BinaryOpStub stub(Token::ADD, NO_OVERWRITE); |
| 4079 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountBinOpFeedbackId()); | 4080 CallIC(stub.GetCode(), RelocInfo::CODE_TARGET, expr->CountBinOpFeedbackId()); |
| 4080 patch_site.EmitPatchInfo(); | 4081 patch_site.EmitPatchInfo(); |
| 4081 __ bind(&done); | 4082 __ bind(&done); |
| 4082 | 4083 |
| 4083 // Store the value returned in r0. | 4084 // Store the value returned in r0. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4288 __ CallStub(&stub); | 4289 __ CallStub(&stub); |
| 4289 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4290 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 4290 // The stub returns 0 for true. | 4291 // The stub returns 0 for true. |
| 4291 __ tst(r0, r0); | 4292 __ tst(r0, r0); |
| 4292 Split(eq, if_true, if_false, fall_through); | 4293 Split(eq, if_true, if_false, fall_through); |
| 4293 break; | 4294 break; |
| 4294 } | 4295 } |
| 4295 | 4296 |
| 4296 default: { | 4297 default: { |
| 4297 VisitForAccumulatorValue(expr->right()); | 4298 VisitForAccumulatorValue(expr->right()); |
| 4298 Condition cond = eq; | 4299 Condition cond = CompareIC::ComputeCondition(op); |
| 4299 switch (op) { | |
| 4300 case Token::EQ_STRICT: | |
| 4301 case Token::EQ: | |
| 4302 cond = eq; | |
| 4303 break; | |
| 4304 case Token::LT: | |
| 4305 cond = lt; | |
| 4306 break; | |
| 4307 case Token::GT: | |
| 4308 cond = gt; | |
| 4309 break; | |
| 4310 case Token::LTE: | |
| 4311 cond = le; | |
| 4312 break; | |
| 4313 case Token::GTE: | |
| 4314 cond = ge; | |
| 4315 break; | |
| 4316 case Token::IN: | |
| 4317 case Token::INSTANCEOF: | |
| 4318 default: | |
| 4319 UNREACHABLE(); | |
| 4320 } | |
| 4321 __ pop(r1); | 4300 __ pop(r1); |
| 4322 | 4301 |
| 4323 bool inline_smi_code = ShouldInlineSmiCase(op); | 4302 bool inline_smi_code = ShouldInlineSmiCase(op); |
| 4324 JumpPatchSite patch_site(masm_); | 4303 JumpPatchSite patch_site(masm_); |
| 4325 if (inline_smi_code) { | 4304 if (inline_smi_code) { |
| 4326 Label slow_case; | 4305 Label slow_case; |
| 4327 __ orr(r2, r0, Operand(r1)); | 4306 __ orr(r2, r0, Operand(r1)); |
| 4328 patch_site.EmitJumpIfNotSmi(r2, &slow_case); | 4307 patch_site.EmitJumpIfNotSmi(r2, &slow_case); |
| 4329 __ cmp(r1, r0); | 4308 __ cmp(r1, r0); |
| 4330 Split(cond, if_true, if_false, NULL); | 4309 Split(cond, if_true, if_false, NULL); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4533 *context_length = 0; | 4512 *context_length = 0; |
| 4534 return previous_; | 4513 return previous_; |
| 4535 } | 4514 } |
| 4536 | 4515 |
| 4537 | 4516 |
| 4538 #undef __ | 4517 #undef __ |
| 4539 | 4518 |
| 4540 } } // namespace v8::internal | 4519 } } // namespace v8::internal |
| 4541 | 4520 |
| 4542 #endif // V8_TARGET_ARCH_ARM | 4521 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |