OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 __ nop(); | 1123 __ nop(); |
1124 } | 1124 } |
1125 | 1125 |
1126 | 1126 |
1127 void FullCodeGenerator::EmitBinaryOp(Token::Value op, | 1127 void FullCodeGenerator::EmitBinaryOp(Token::Value op, |
1128 Expression::Context context) { | 1128 Expression::Context context) { |
1129 __ push(result_register()); | 1129 __ push(result_register()); |
1130 GenericBinaryOpStub stub(op, | 1130 GenericBinaryOpStub stub(op, |
1131 NO_OVERWRITE, | 1131 NO_OVERWRITE, |
1132 NO_GENERIC_BINARY_FLAGS, | 1132 NO_GENERIC_BINARY_FLAGS, |
1133 NumberInfo::Unknown()); | 1133 TypeInfo::Unknown()); |
1134 __ CallStub(&stub); | 1134 __ CallStub(&stub); |
1135 Apply(context, eax); | 1135 Apply(context, eax); |
1136 } | 1136 } |
1137 | 1137 |
1138 | 1138 |
1139 void FullCodeGenerator::EmitVariableAssignment(Variable* var, | 1139 void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
1140 Expression::Context context) { | 1140 Expression::Context context) { |
1141 // Three main cases: global variables, lookup slots, and all other | 1141 // Three main cases: global variables, lookup slots, and all other |
1142 // types of slots. Left-hand-side parameters that rewrite to | 1142 // types of slots. Left-hand-side parameters that rewrite to |
1143 // explicit property accesses do not reach here. | 1143 // explicit property accesses do not reach here. |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 if (expr->op() == Token::INC) { | 1738 if (expr->op() == Token::INC) { |
1739 __ sub(Operand(eax), Immediate(Smi::FromInt(1))); | 1739 __ sub(Operand(eax), Immediate(Smi::FromInt(1))); |
1740 } else { | 1740 } else { |
1741 __ add(Operand(eax), Immediate(Smi::FromInt(1))); | 1741 __ add(Operand(eax), Immediate(Smi::FromInt(1))); |
1742 } | 1742 } |
1743 } | 1743 } |
1744 // Call stub for +1/-1. | 1744 // Call stub for +1/-1. |
1745 GenericBinaryOpStub stub(expr->binary_op(), | 1745 GenericBinaryOpStub stub(expr->binary_op(), |
1746 NO_OVERWRITE, | 1746 NO_OVERWRITE, |
1747 NO_GENERIC_BINARY_FLAGS, | 1747 NO_GENERIC_BINARY_FLAGS, |
1748 NumberInfo::Unknown()); | 1748 TypeInfo::Unknown()); |
1749 stub.GenerateCall(masm(), eax, Smi::FromInt(1)); | 1749 stub.GenerateCall(masm(), eax, Smi::FromInt(1)); |
1750 __ bind(&done); | 1750 __ bind(&done); |
1751 | 1751 |
1752 // Store the value returned in eax. | 1752 // Store the value returned in eax. |
1753 switch (assign_type) { | 1753 switch (assign_type) { |
1754 case VARIABLE: | 1754 case VARIABLE: |
1755 if (expr->is_postfix()) { | 1755 if (expr->is_postfix()) { |
1756 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 1756 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
1757 Expression::kEffect); | 1757 Expression::kEffect); |
1758 // For all contexts except kEffect: We have the result on | 1758 // For all contexts except kEffect: We have the result on |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 __ add(Operand(edx), Immediate(masm_->CodeObject())); | 2004 __ add(Operand(edx), Immediate(masm_->CodeObject())); |
2005 __ mov(Operand(esp, 0), edx); | 2005 __ mov(Operand(esp, 0), edx); |
2006 // And return. | 2006 // And return. |
2007 __ ret(0); | 2007 __ ret(0); |
2008 } | 2008 } |
2009 | 2009 |
2010 | 2010 |
2011 #undef __ | 2011 #undef __ |
2012 | 2012 |
2013 } } // namespace v8::internal | 2013 } } // namespace v8::internal |
OLD | NEW |