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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 void GenerateFastCharCodeAt(ZoneList<Expression*>* args); | 520 void GenerateFastCharCodeAt(ZoneList<Expression*>* args); |
521 | 521 |
522 // Fast support for object equality testing. | 522 // Fast support for object equality testing. |
523 void GenerateObjectEquals(ZoneList<Expression*>* args); | 523 void GenerateObjectEquals(ZoneList<Expression*>* args); |
524 | 524 |
525 void GenerateLog(ZoneList<Expression*>* args); | 525 void GenerateLog(ZoneList<Expression*>* args); |
526 | 526 |
527 // Fast support for Math.random(). | 527 // Fast support for Math.random(). |
528 void GenerateRandomPositiveSmi(ZoneList<Expression*>* args); | 528 void GenerateRandomPositiveSmi(ZoneList<Expression*>* args); |
529 | 529 |
| 530 // Fast support for Math.sin and Math.cos. |
| 531 enum MathOp { SIN, COS }; |
| 532 void GenerateFastMathOp(MathOp op, ZoneList<Expression*>* args); |
| 533 inline void GenerateMathSin(ZoneList<Expression*>* args); |
| 534 inline void GenerateMathCos(ZoneList<Expression*>* args); |
| 535 |
530 // Methods and constants for fast case switch statement support. | 536 // Methods and constants for fast case switch statement support. |
531 // | 537 // |
532 // Only allow fast-case switch if the range of labels is at most | 538 // Only allow fast-case switch if the range of labels is at most |
533 // this factor times the number of case labels. | 539 // this factor times the number of case labels. |
534 // Value is derived from comparing the size of code generated by the normal | 540 // Value is derived from comparing the size of code generated by the normal |
535 // switch code for Smi-labels to the size of a single pointer. If code | 541 // switch code for Smi-labels to the size of a single pointer. If code |
536 // quality increases this number should be decreased to match. | 542 // quality increases this number should be decreased to match. |
537 static const int kFastSwitchMaxOverheadFactor = 5; | 543 static const int kFastSwitchMaxOverheadFactor = 5; |
538 | 544 |
539 // Minimal number of switch cases required before we allow jump-table | 545 // Minimal number of switch cases required before we allow jump-table |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 friend class Reference; | 635 friend class Reference; |
630 friend class Result; | 636 friend class Result; |
631 | 637 |
632 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 638 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
633 }; | 639 }; |
634 | 640 |
635 | 641 |
636 } } // namespace v8::internal | 642 } } // namespace v8::internal |
637 | 643 |
638 #endif // V8_X64_CODEGEN_X64_H_ | 644 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |