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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 OverwriteMode overwrite_mode); | 452 OverwriteMode overwrite_mode); |
453 | 453 |
454 // Emit code to perform a binary operation on two likely smis. | 454 // Emit code to perform a binary operation on two likely smis. |
455 // The code to handle smi arguments is produced inline. | 455 // The code to handle smi arguments is produced inline. |
456 // Consumes the Results *left and *right. | 456 // Consumes the Results *left and *right. |
457 void LikelySmiBinaryOperation(Token::Value op, | 457 void LikelySmiBinaryOperation(Token::Value op, |
458 Result* left, | 458 Result* left, |
459 Result* right, | 459 Result* right, |
460 OverwriteMode overwrite_mode); | 460 OverwriteMode overwrite_mode); |
461 | 461 |
462 void Comparison(Condition cc, | 462 void Comparison(AstNode* node, |
| 463 Condition cc, |
463 bool strict, | 464 bool strict, |
464 ControlDestination* destination); | 465 ControlDestination* destination); |
465 | 466 |
466 // To prevent long attacker-controlled byte sequences, integer constants | 467 // To prevent long attacker-controlled byte sequences, integer constants |
467 // from the JavaScript source are loaded in two parts if they are larger | 468 // from the JavaScript source are loaded in two parts if they are larger |
468 // than 16 bits. | 469 // than 16 bits. |
469 static const int kMaxSmiInlinedBits = 16; | 470 static const int kMaxSmiInlinedBits = 16; |
470 bool IsUnsafeSmi(Handle<Object> value); | 471 bool IsUnsafeSmi(Handle<Object> value); |
471 // Load an integer constant x into a register target or into the stack using | 472 // Load an integer constant x into a register target or into the stack using |
472 // at most 16 bits of user-controlled data per assembly operation. | 473 // at most 16 bits of user-controlled data per assembly operation. |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | ArgsReversedBits::encode(args_reversed_); | 721 | ArgsReversedBits::encode(args_reversed_); |
721 } | 722 } |
722 | 723 |
723 void Generate(MacroAssembler* masm); | 724 void Generate(MacroAssembler* masm); |
724 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 725 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
725 void GenerateLoadArguments(MacroAssembler* masm); | 726 void GenerateLoadArguments(MacroAssembler* masm); |
726 void GenerateReturn(MacroAssembler* masm); | 727 void GenerateReturn(MacroAssembler* masm); |
727 | 728 |
728 bool ArgsInRegistersSupported() { | 729 bool ArgsInRegistersSupported() { |
729 return ((op_ == Token::ADD) || (op_ == Token::SUB) | 730 return ((op_ == Token::ADD) || (op_ == Token::SUB) |
730 || (op_ == Token::MUL) || (op_ == Token::DIV)) | 731 || (op_ == Token::MUL) || (op_ == Token::DIV)) |
731 && flags_ != NO_SMI_CODE_IN_STUB; | 732 && flags_ != NO_SMI_CODE_IN_STUB; |
732 } | 733 } |
733 bool IsOperationCommutative() { | 734 bool IsOperationCommutative() { |
734 return (op_ == Token::ADD) || (op_ == Token::MUL); | 735 return (op_ == Token::ADD) || (op_ == Token::MUL); |
735 } | 736 } |
736 | 737 |
737 void SetArgsInRegisters() { args_in_registers_ = true; } | 738 void SetArgsInRegisters() { args_in_registers_ = true; } |
738 void SetArgsReversed() { args_reversed_ = true; } | 739 void SetArgsReversed() { args_reversed_ = true; } |
739 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 740 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
740 bool HasArgumentsInRegisters() { return args_in_registers_; } | 741 bool HasArgumentsInRegisters() { return args_in_registers_; } |
741 bool HasArgumentsReversed() { return args_reversed_; } | 742 bool HasArgumentsReversed() { return args_reversed_; } |
(...skipping 27 matching lines...) Expand all Loading... |
769 bool ascii); | 770 bool ascii); |
770 | 771 |
771 // Should the stub check whether arguments are strings? | 772 // Should the stub check whether arguments are strings? |
772 bool string_check_; | 773 bool string_check_; |
773 }; | 774 }; |
774 | 775 |
775 | 776 |
776 } } // namespace v8::internal | 777 } } // namespace v8::internal |
777 | 778 |
778 #endif // V8_IA32_CODEGEN_IA32_H_ | 779 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |