| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // effect. | 259 // effect. |
| 260 ControlDestination* destination_; | 260 ControlDestination* destination_; |
| 261 | 261 |
| 262 // The previous state of the owning code generator, restored when | 262 // The previous state of the owning code generator, restored when |
| 263 // this state is destroyed. | 263 // this state is destroyed. |
| 264 CodeGenState* previous_; | 264 CodeGenState* previous_; |
| 265 }; | 265 }; |
| 266 | 266 |
| 267 | 267 |
| 268 // ------------------------------------------------------------------------- | 268 // ------------------------------------------------------------------------- |
| 269 // Arguments allocation mode | 269 // Arguments allocation mode. |
| 270 | 270 |
| 271 enum ArgumentsAllocationMode { | 271 enum ArgumentsAllocationMode { |
| 272 NO_ARGUMENTS_ALLOCATION, | 272 NO_ARGUMENTS_ALLOCATION, |
| 273 EAGER_ARGUMENTS_ALLOCATION, | 273 EAGER_ARGUMENTS_ALLOCATION, |
| 274 LAZY_ARGUMENTS_ALLOCATION | 274 LAZY_ARGUMENTS_ALLOCATION |
| 275 }; | 275 }; |
| 276 | 276 |
| 277 | 277 |
| 278 // ------------------------------------------------------------------------- | 278 // ------------------------------------------------------------------------- |
| 279 // CodeGenerator | 279 // CodeGenerator |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 // 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 |
| 469 // than 16 bits. | 469 // than 16 bits. |
| 470 static const int kMaxSmiInlinedBits = 16; | 470 static const int kMaxSmiInlinedBits = 16; |
| 471 bool IsUnsafeSmi(Handle<Object> value); | 471 bool IsUnsafeSmi(Handle<Object> value); |
| 472 // 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 |
| 473 // at most 16 bits of user-controlled data per assembly operation. | 473 // at most 16 bits of user-controlled data per assembly operation. |
| 474 void MoveUnsafeSmi(Register target, Handle<Object> value); | 474 void MoveUnsafeSmi(Register target, Handle<Object> value); |
| 475 void StoreUnsafeSmiToLocal(int offset, Handle<Object> value); | 475 void StoreUnsafeSmiToLocal(int offset, Handle<Object> value); |
| 476 void PushUnsafeSmi(Handle<Object> value); | 476 void PushUnsafeSmi(Handle<Object> value); |
| 477 | 477 |
| 478 void CallWithArguments(ZoneList<Expression*>* arguments, int position); | 478 void CallWithArguments(ZoneList<Expression*>* arguments, |
| 479 CallFunctionFlags flags, |
| 480 int position); |
| 479 | 481 |
| 480 // Use an optimized version of Function.prototype.apply that avoid | 482 // Use an optimized version of Function.prototype.apply that avoid |
| 481 // allocating the arguments object and just copies the arguments | 483 // allocating the arguments object and just copies the arguments |
| 482 // from the stack. | 484 // from the stack. |
| 483 void CallApplyLazy(Property* apply, | 485 void CallApplyLazy(Property* apply, |
| 484 Expression* receiver, | 486 Expression* receiver, |
| 485 VariableProxy* arguments, | 487 VariableProxy* arguments, |
| 486 int position); | 488 int position); |
| 487 | 489 |
| 488 void CheckStack(); | 490 void CheckStack(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 friend class Result; | 615 friend class Result; |
| 614 friend class FastCodeGenerator; | 616 friend class FastCodeGenerator; |
| 615 friend class CodeGenSelector; | 617 friend class CodeGenSelector; |
| 616 | 618 |
| 617 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc | 619 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc |
| 618 | 620 |
| 619 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 621 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 620 }; | 622 }; |
| 621 | 623 |
| 622 | 624 |
| 623 class CallFunctionStub: public CodeStub { | |
| 624 public: | |
| 625 CallFunctionStub(int argc, InLoopFlag in_loop) | |
| 626 : argc_(argc), in_loop_(in_loop) { } | |
| 627 | |
| 628 void Generate(MacroAssembler* masm); | |
| 629 | |
| 630 private: | |
| 631 int argc_; | |
| 632 InLoopFlag in_loop_; | |
| 633 | |
| 634 #ifdef DEBUG | |
| 635 void Print() { PrintF("CallFunctionStub (args %d)\n", argc_); } | |
| 636 #endif | |
| 637 | |
| 638 Major MajorKey() { return CallFunction; } | |
| 639 int MinorKey() { return argc_; } | |
| 640 InLoopFlag InLoop() { return in_loop_; } | |
| 641 }; | |
| 642 | |
| 643 | |
| 644 class ToBooleanStub: public CodeStub { | |
| 645 public: | |
| 646 ToBooleanStub() { } | |
| 647 | |
| 648 void Generate(MacroAssembler* masm); | |
| 649 | |
| 650 private: | |
| 651 Major MajorKey() { return ToBoolean; } | |
| 652 int MinorKey() { return 0; } | |
| 653 }; | |
| 654 | |
| 655 | |
| 656 // Flag that indicates how to generate code for the stub GenericBinaryOpStub. | 625 // Flag that indicates how to generate code for the stub GenericBinaryOpStub. |
| 657 enum GenericBinaryFlags { | 626 enum GenericBinaryFlags { |
| 658 NO_GENERIC_BINARY_FLAGS = 0, | 627 NO_GENERIC_BINARY_FLAGS = 0, |
| 659 NO_SMI_CODE_IN_STUB = 1 << 0 // Omit smi code in stub. | 628 NO_SMI_CODE_IN_STUB = 1 << 0 // Omit smi code in stub. |
| 660 }; | 629 }; |
| 661 | 630 |
| 662 | 631 |
| 663 class GenericBinaryOpStub: public CodeStub { | 632 class GenericBinaryOpStub: public CodeStub { |
| 664 public: | 633 public: |
| 665 GenericBinaryOpStub(Token::Value op, | 634 GenericBinaryOpStub(Token::Value op, |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 Major MajorKey() { return StringCompare; } | 794 Major MajorKey() { return StringCompare; } |
| 826 int MinorKey() { return 0; } | 795 int MinorKey() { return 0; } |
| 827 | 796 |
| 828 void Generate(MacroAssembler* masm); | 797 void Generate(MacroAssembler* masm); |
| 829 }; | 798 }; |
| 830 | 799 |
| 831 | 800 |
| 832 } } // namespace v8::internal | 801 } } // namespace v8::internal |
| 833 | 802 |
| 834 #endif // V8_IA32_CODEGEN_IA32_H_ | 803 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |