OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 // Consumes the Results *left and *right. | 514 // Consumes the Results *left and *right. |
515 Result LikelySmiBinaryOperation(BinaryOperation* expr, | 515 Result LikelySmiBinaryOperation(BinaryOperation* expr, |
516 Result* left, | 516 Result* left, |
517 Result* right, | 517 Result* right, |
518 OverwriteMode overwrite_mode); | 518 OverwriteMode overwrite_mode); |
519 | 519 |
520 void Comparison(AstNode* node, | 520 void Comparison(AstNode* node, |
521 Condition cc, | 521 Condition cc, |
522 bool strict, | 522 bool strict, |
523 ControlDestination* destination); | 523 ControlDestination* destination); |
| 524 |
| 525 // If at least one of the sides is a constant smi, generate optimized code. |
| 526 void ConstantSmiComparison(Condition cc, |
| 527 bool strict, |
| 528 ControlDestination* destination, |
| 529 Result* left_side, |
| 530 Result* right_side, |
| 531 bool left_side_constant_smi, |
| 532 bool right_side_constant_smi, |
| 533 bool is_loop_condition); |
| 534 |
524 void GenerateInlineNumberComparison(Result* left_side, | 535 void GenerateInlineNumberComparison(Result* left_side, |
525 Result* right_side, | 536 Result* right_side, |
526 Condition cc, | 537 Condition cc, |
527 ControlDestination* dest); | 538 ControlDestination* dest); |
528 | 539 |
529 // To prevent long attacker-controlled byte sequences, integer constants | 540 // To prevent long attacker-controlled byte sequences, integer constants |
530 // from the JavaScript source are loaded in two parts if they are larger | 541 // from the JavaScript source are loaded in two parts if they are larger |
531 // than 16 bits. | 542 // than 16 bits. |
532 static const int kMaxSmiInlinedBits = 16; | 543 static const int kMaxSmiInlinedBits = 16; |
533 bool IsUnsafeSmi(Handle<Object> value); | 544 bool IsUnsafeSmi(Handle<Object> value); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 return ObjectBits::encode(object_.code()) | | 1061 return ObjectBits::encode(object_.code()) | |
1051 AddressBits::encode(addr_.code()) | | 1062 AddressBits::encode(addr_.code()) | |
1052 ScratchBits::encode(scratch_.code()); | 1063 ScratchBits::encode(scratch_.code()); |
1053 } | 1064 } |
1054 }; | 1065 }; |
1055 | 1066 |
1056 | 1067 |
1057 } } // namespace v8::internal | 1068 } } // namespace v8::internal |
1058 | 1069 |
1059 #endif // V8_X64_CODEGEN_X64_H_ | 1070 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |