| 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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 __ mov(r0, Operand(property->key()->AsLiteral()->handle())); | 1615 __ mov(r0, Operand(property->key()->AsLiteral()->handle())); |
| 1616 __ Push(r1, r0); | 1616 __ Push(r1, r0); |
| 1617 } else { | 1617 } else { |
| 1618 VisitForStackValue(property->obj()); | 1618 VisitForStackValue(property->obj()); |
| 1619 VisitForStackValue(property->key()); | 1619 VisitForStackValue(property->key()); |
| 1620 } | 1620 } |
| 1621 } | 1621 } |
| 1622 break; | 1622 break; |
| 1623 } | 1623 } |
| 1624 | 1624 |
| 1625 // For compound assignments we need another deoptimization point after the |
| 1626 // variable/property load. |
| 1625 if (expr->is_compound()) { | 1627 if (expr->is_compound()) { |
| 1626 { AccumulatorValueContext context(this); | 1628 { AccumulatorValueContext context(this); |
| 1627 switch (assign_type) { | 1629 switch (assign_type) { |
| 1628 case VARIABLE: | 1630 case VARIABLE: |
| 1629 EmitVariableLoad(expr->target()->AsVariableProxy()->var()); | 1631 EmitVariableLoad(expr->target()->AsVariableProxy()->var()); |
| 1632 PrepareForBailout(expr->target(), TOS_REG); |
| 1630 break; | 1633 break; |
| 1631 case NAMED_PROPERTY: | 1634 case NAMED_PROPERTY: |
| 1632 EmitNamedPropertyLoad(property); | 1635 EmitNamedPropertyLoad(property); |
| 1636 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); |
| 1633 break; | 1637 break; |
| 1634 case KEYED_PROPERTY: | 1638 case KEYED_PROPERTY: |
| 1635 EmitKeyedPropertyLoad(property); | 1639 EmitKeyedPropertyLoad(property); |
| 1640 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); |
| 1636 break; | 1641 break; |
| 1637 } | 1642 } |
| 1638 } | 1643 } |
| 1639 | 1644 |
| 1640 // For property compound assignments we need another deoptimization | |
| 1641 // point after the property load. | |
| 1642 if (property != NULL) { | |
| 1643 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); | |
| 1644 } | |
| 1645 | |
| 1646 Token::Value op = expr->binary_op(); | 1645 Token::Value op = expr->binary_op(); |
| 1647 __ push(r0); // Left operand goes on the stack. | 1646 __ push(r0); // Left operand goes on the stack. |
| 1648 VisitForAccumulatorValue(expr->value()); | 1647 VisitForAccumulatorValue(expr->value()); |
| 1649 | 1648 |
| 1650 OverwriteMode mode = expr->value()->ResultOverwriteAllowed() | 1649 OverwriteMode mode = expr->value()->ResultOverwriteAllowed() |
| 1651 ? OVERWRITE_RIGHT | 1650 ? OVERWRITE_RIGHT |
| 1652 : NO_OVERWRITE; | 1651 : NO_OVERWRITE; |
| 1653 SetSourcePosition(expr->position() + 1); | 1652 SetSourcePosition(expr->position() + 1); |
| 1654 AccumulatorValueContext context(this); | 1653 AccumulatorValueContext context(this); |
| 1655 if (ShouldInlineSmiCase(op)) { | 1654 if (ShouldInlineSmiCase(op)) { |
| (...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3886 VisitForAccumulatorValue(prop->key()); | 3885 VisitForAccumulatorValue(prop->key()); |
| 3887 } | 3886 } |
| 3888 __ ldr(r1, MemOperand(sp, 0)); | 3887 __ ldr(r1, MemOperand(sp, 0)); |
| 3889 __ push(r0); | 3888 __ push(r0); |
| 3890 EmitKeyedPropertyLoad(prop); | 3889 EmitKeyedPropertyLoad(prop); |
| 3891 } | 3890 } |
| 3892 } | 3891 } |
| 3893 | 3892 |
| 3894 // We need a second deoptimization point after loading the value | 3893 // We need a second deoptimization point after loading the value |
| 3895 // in case evaluating the property load my have a side effect. | 3894 // in case evaluating the property load my have a side effect. |
| 3896 PrepareForBailout(expr->increment(), TOS_REG); | 3895 if (assign_type == VARIABLE) { |
| 3896 PrepareForBailout(expr->expression(), TOS_REG); |
| 3897 } else { |
| 3898 PrepareForBailout(expr->increment(), TOS_REG); |
| 3899 } |
| 3897 | 3900 |
| 3898 // Call ToNumber only if operand is not a smi. | 3901 // Call ToNumber only if operand is not a smi. |
| 3899 Label no_conversion; | 3902 Label no_conversion; |
| 3900 __ JumpIfSmi(r0, &no_conversion); | 3903 __ JumpIfSmi(r0, &no_conversion); |
| 3901 ToNumberStub convert_stub; | 3904 ToNumberStub convert_stub; |
| 3902 __ CallStub(&convert_stub); | 3905 __ CallStub(&convert_stub); |
| 3903 __ bind(&no_conversion); | 3906 __ bind(&no_conversion); |
| 3904 | 3907 |
| 3905 // Save result for postfix expressions. | 3908 // Save result for postfix expressions. |
| 3906 if (expr->is_postfix()) { | 3909 if (expr->is_postfix()) { |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4372 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4375 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 4373 __ add(pc, r1, Operand(masm_->CodeObject())); | 4376 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 4374 } | 4377 } |
| 4375 | 4378 |
| 4376 | 4379 |
| 4377 #undef __ | 4380 #undef __ |
| 4378 | 4381 |
| 4379 } } // namespace v8::internal | 4382 } } // namespace v8::internal |
| 4380 | 4383 |
| 4381 #endif // V8_TARGET_ARCH_ARM | 4384 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |