OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 __ mov(r0, Operand(property->key()->AsLiteral()->handle())); | 1597 __ mov(r0, Operand(property->key()->AsLiteral()->handle())); |
1598 __ Push(r1, r0); | 1598 __ Push(r1, r0); |
1599 } else { | 1599 } else { |
1600 VisitForStackValue(property->obj()); | 1600 VisitForStackValue(property->obj()); |
1601 VisitForStackValue(property->key()); | 1601 VisitForStackValue(property->key()); |
1602 } | 1602 } |
1603 } | 1603 } |
1604 break; | 1604 break; |
1605 } | 1605 } |
1606 | 1606 |
| 1607 // For compound assignments we need another deoptimization point after the |
| 1608 // variable/property load. |
1607 if (expr->is_compound()) { | 1609 if (expr->is_compound()) { |
1608 { AccumulatorValueContext context(this); | 1610 { AccumulatorValueContext context(this); |
1609 switch (assign_type) { | 1611 switch (assign_type) { |
1610 case VARIABLE: | 1612 case VARIABLE: |
1611 EmitVariableLoad(expr->target()->AsVariableProxy()->var()); | 1613 EmitVariableLoad(expr->target()->AsVariableProxy()->var()); |
| 1614 PrepareForBailout(expr->target(), TOS_REG); |
1612 break; | 1615 break; |
1613 case NAMED_PROPERTY: | 1616 case NAMED_PROPERTY: |
1614 EmitNamedPropertyLoad(property); | 1617 EmitNamedPropertyLoad(property); |
| 1618 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); |
1615 break; | 1619 break; |
1616 case KEYED_PROPERTY: | 1620 case KEYED_PROPERTY: |
1617 EmitKeyedPropertyLoad(property); | 1621 EmitKeyedPropertyLoad(property); |
| 1622 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); |
1618 break; | 1623 break; |
1619 } | 1624 } |
1620 } | 1625 } |
1621 | 1626 |
1622 // For property compound assignments we need another deoptimization | |
1623 // point after the property load. | |
1624 if (property != NULL) { | |
1625 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); | |
1626 } | |
1627 | |
1628 Token::Value op = expr->binary_op(); | 1627 Token::Value op = expr->binary_op(); |
1629 __ push(r0); // Left operand goes on the stack. | 1628 __ push(r0); // Left operand goes on the stack. |
1630 VisitForAccumulatorValue(expr->value()); | 1629 VisitForAccumulatorValue(expr->value()); |
1631 | 1630 |
1632 OverwriteMode mode = expr->value()->ResultOverwriteAllowed() | 1631 OverwriteMode mode = expr->value()->ResultOverwriteAllowed() |
1633 ? OVERWRITE_RIGHT | 1632 ? OVERWRITE_RIGHT |
1634 : NO_OVERWRITE; | 1633 : NO_OVERWRITE; |
1635 SetSourcePosition(expr->position() + 1); | 1634 SetSourcePosition(expr->position() + 1); |
1636 AccumulatorValueContext context(this); | 1635 AccumulatorValueContext context(this); |
1637 if (ShouldInlineSmiCase(op)) { | 1636 if (ShouldInlineSmiCase(op)) { |
(...skipping 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3798 VisitForAccumulatorValue(prop->key()); | 3797 VisitForAccumulatorValue(prop->key()); |
3799 } | 3798 } |
3800 __ ldr(r1, MemOperand(sp, 0)); | 3799 __ ldr(r1, MemOperand(sp, 0)); |
3801 __ push(r0); | 3800 __ push(r0); |
3802 EmitKeyedPropertyLoad(prop); | 3801 EmitKeyedPropertyLoad(prop); |
3803 } | 3802 } |
3804 } | 3803 } |
3805 | 3804 |
3806 // We need a second deoptimization point after loading the value | 3805 // We need a second deoptimization point after loading the value |
3807 // in case evaluating the property load my have a side effect. | 3806 // in case evaluating the property load my have a side effect. |
3808 PrepareForBailout(expr->increment(), TOS_REG); | 3807 if (assign_type == VARIABLE) { |
| 3808 PrepareForBailout(expr->expression(), TOS_REG); |
| 3809 } else { |
| 3810 PrepareForBailout(expr->increment(), TOS_REG); |
| 3811 } |
3809 | 3812 |
3810 // Call ToNumber only if operand is not a smi. | 3813 // Call ToNumber only if operand is not a smi. |
3811 Label no_conversion; | 3814 Label no_conversion; |
3812 __ JumpIfSmi(r0, &no_conversion); | 3815 __ JumpIfSmi(r0, &no_conversion); |
3813 ToNumberStub convert_stub; | 3816 ToNumberStub convert_stub; |
3814 __ CallStub(&convert_stub); | 3817 __ CallStub(&convert_stub); |
3815 __ bind(&no_conversion); | 3818 __ bind(&no_conversion); |
3816 | 3819 |
3817 // Save result for postfix expressions. | 3820 // Save result for postfix expressions. |
3818 if (expr->is_postfix()) { | 3821 if (expr->is_postfix()) { |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4282 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4285 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
4283 __ add(pc, r1, Operand(masm_->CodeObject())); | 4286 __ add(pc, r1, Operand(masm_->CodeObject())); |
4284 } | 4287 } |
4285 | 4288 |
4286 | 4289 |
4287 #undef __ | 4290 #undef __ |
4288 | 4291 |
4289 } } // namespace v8::internal | 4292 } } // namespace v8::internal |
4290 | 4293 |
4291 #endif // V8_TARGET_ARCH_ARM | 4294 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |