| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 // Fast support for Math.random(). | 540 // Fast support for Math.random(). |
| 541 void GenerateRandomPositiveSmi(ZoneList<Expression*>* args); | 541 void GenerateRandomPositiveSmi(ZoneList<Expression*>* args); |
| 542 | 542 |
| 543 // Fast support for Math.sin and Math.cos. | 543 // Fast support for Math.sin and Math.cos. |
| 544 enum MathOp { SIN, COS }; | 544 enum MathOp { SIN, COS }; |
| 545 void GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args); | 545 void GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args); |
| 546 inline void GenerateMathSin(ZoneList<Expression*>* args); | 546 inline void GenerateMathSin(ZoneList<Expression*>* args); |
| 547 inline void GenerateMathCos(ZoneList<Expression*>* args); | 547 inline void GenerateMathCos(ZoneList<Expression*>* args); |
| 548 | 548 |
| 549 // Fast support for StringAdd. |
| 550 void GenerateStringAdd(ZoneList<Expression*>* args); |
| 551 |
| 549 // Simple condition analysis. | 552 // Simple condition analysis. |
| 550 enum ConditionAnalysis { | 553 enum ConditionAnalysis { |
| 551 ALWAYS_TRUE, | 554 ALWAYS_TRUE, |
| 552 ALWAYS_FALSE, | 555 ALWAYS_FALSE, |
| 553 DONT_KNOW | 556 DONT_KNOW |
| 554 }; | 557 }; |
| 555 ConditionAnalysis AnalyzeCondition(Expression* cond); | 558 ConditionAnalysis AnalyzeCondition(Expression* cond); |
| 556 | 559 |
| 557 // Methods used to indicate which source code is generated for. Source | 560 // Methods used to indicate which source code is generated for. Source |
| 558 // positions are collected by the assembler and emitted with the relocation | 561 // positions are collected by the assembler and emitted with the relocation |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 } | 733 } |
| 731 | 734 |
| 732 void SetArgsInRegisters() { args_in_registers_ = true; } | 735 void SetArgsInRegisters() { args_in_registers_ = true; } |
| 733 void SetArgsReversed() { args_reversed_ = true; } | 736 void SetArgsReversed() { args_reversed_ = true; } |
| 734 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 737 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
| 735 bool HasArgumentsInRegisters() { return args_in_registers_; } | 738 bool HasArgumentsInRegisters() { return args_in_registers_; } |
| 736 bool HasArgumentsReversed() { return args_reversed_; } | 739 bool HasArgumentsReversed() { return args_reversed_; } |
| 737 }; | 740 }; |
| 738 | 741 |
| 739 | 742 |
| 743 // Flag that indicates how to generate code for the stub StringAddStub. |
| 744 enum StringAddFlags { |
| 745 NO_STRING_ADD_FLAGS = 0, |
| 746 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. |
| 747 }; |
| 748 |
| 749 |
| 750 class StringAddStub: public CodeStub { |
| 751 public: |
| 752 explicit StringAddStub(StringAddFlags flags) { |
| 753 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0); |
| 754 } |
| 755 |
| 756 private: |
| 757 Major MajorKey() { return StringAdd; } |
| 758 int MinorKey() { return string_check_ ? 0 : 1; } |
| 759 |
| 760 void Generate(MacroAssembler* masm); |
| 761 |
| 762 void GenerateCopyCharacters(MacroAssembler* masm, |
| 763 Register desc, |
| 764 Register src, |
| 765 Register count, |
| 766 Register scratch, |
| 767 bool ascii); |
| 768 |
| 769 // Should the stub check whether arguments are strings? |
| 770 bool string_check_; |
| 771 }; |
| 772 |
| 773 |
| 740 } } // namespace v8::internal | 774 } } // namespace v8::internal |
| 741 | 775 |
| 742 #endif // V8_IA32_CODEGEN_IA32_H_ | 776 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |