OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 V(BinaryOp) \ | 43 V(BinaryOp) \ |
44 V(StringAdd) \ | 44 V(StringAdd) \ |
45 V(SubString) \ | 45 V(SubString) \ |
46 V(StringCompare) \ | 46 V(StringCompare) \ |
47 V(Compare) \ | 47 V(Compare) \ |
48 V(CompareIC) \ | 48 V(CompareIC) \ |
49 V(MathPow) \ | 49 V(MathPow) \ |
50 V(ArrayLength) \ | 50 V(ArrayLength) \ |
51 V(StringLength) \ | 51 V(StringLength) \ |
52 V(FunctionPrototype) \ | 52 V(FunctionPrototype) \ |
| 53 V(StoreArrayLength) \ |
53 V(RecordWrite) \ | 54 V(RecordWrite) \ |
54 V(StoreBufferOverflow) \ | 55 V(StoreBufferOverflow) \ |
55 V(RegExpExec) \ | 56 V(RegExpExec) \ |
56 V(TranscendentalCache) \ | 57 V(TranscendentalCache) \ |
57 V(Instanceof) \ | 58 V(Instanceof) \ |
58 V(ConvertToDouble) \ | 59 V(ConvertToDouble) \ |
59 V(WriteInt32ToHeapNumber) \ | 60 V(WriteInt32ToHeapNumber) \ |
60 V(StackCheck) \ | 61 V(StackCheck) \ |
61 V(Interrupt) \ | 62 V(Interrupt) \ |
62 V(FastNewClosure) \ | 63 V(FastNewClosure) \ |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 protected: | 173 protected: |
173 static bool CanUseFPRegisters(); | 174 static bool CanUseFPRegisters(); |
174 | 175 |
175 // Generates the assembler code for the stub. | 176 // Generates the assembler code for the stub. |
176 virtual Handle<Code> GenerateCode() = 0; | 177 virtual Handle<Code> GenerateCode() = 0; |
177 | 178 |
178 // BinaryOpStub needs to override this. | 179 // BinaryOpStub needs to override this. |
179 virtual InlineCacheState GetICState() { | 180 virtual InlineCacheState GetICState() { |
180 return UNINITIALIZED; | 181 return UNINITIALIZED; |
181 } | 182 } |
| 183 virtual Code::ExtraICState GetExtraICState() { |
| 184 return Code::kNoExtraICState; |
| 185 } |
182 | 186 |
183 // Returns whether the code generated for this stub needs to be allocated as | 187 // Returns whether the code generated for this stub needs to be allocated as |
184 // a fixed (non-moveable) code object. | 188 // a fixed (non-moveable) code object. |
185 virtual bool NeedsImmovableCode() { return false; } | 189 virtual bool NeedsImmovableCode() { return false; } |
186 | 190 |
187 private: | 191 private: |
188 // Perform bookkeeping required after code generation when stub code is | 192 // Perform bookkeeping required after code generation when stub code is |
189 // initially generated. | 193 // initially generated. |
190 void RecordCodeGeneration(Code* code, Isolate* isolate); | 194 void RecordCodeGeneration(Code* code, Isolate* isolate); |
191 | 195 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 class WrapperModeBits: public BitField<bool, 4, 1> {}; | 602 class WrapperModeBits: public BitField<bool, 4, 1> {}; |
599 virtual CodeStub::Major MajorKey() { return StringLength; } | 603 virtual CodeStub::Major MajorKey() { return StringLength; } |
600 virtual int MinorKey() { | 604 virtual int MinorKey() { |
601 return KindBits::encode(kind()) | WrapperModeBits::encode(support_wrapper_); | 605 return KindBits::encode(kind()) | WrapperModeBits::encode(support_wrapper_); |
602 } | 606 } |
603 | 607 |
604 bool support_wrapper_; | 608 bool support_wrapper_; |
605 }; | 609 }; |
606 | 610 |
607 | 611 |
| 612 class StoreICStub: public ICStub { |
| 613 public: |
| 614 StoreICStub(Code::Kind kind, StrictModeFlag strict_mode) |
| 615 : ICStub(kind), strict_mode_(strict_mode) { } |
| 616 |
| 617 protected: |
| 618 virtual Code::ExtraICState GetExtraICState() { |
| 619 return strict_mode_; |
| 620 } |
| 621 |
| 622 private: |
| 623 class StrictModeBits: public BitField<bool, 4, 1> {}; |
| 624 virtual int MinorKey() { |
| 625 return KindBits::encode(kind()) | StrictModeBits::encode(strict_mode_); |
| 626 } |
| 627 |
| 628 StrictModeFlag strict_mode_; |
| 629 }; |
| 630 |
| 631 |
| 632 class StoreArrayLengthStub: public StoreICStub { |
| 633 public: |
| 634 explicit StoreArrayLengthStub(Code::Kind kind, StrictModeFlag strict_mode) |
| 635 : StoreICStub(kind, strict_mode) { } |
| 636 virtual void Generate(MacroAssembler* masm); |
| 637 |
| 638 private: |
| 639 virtual CodeStub::Major MajorKey() { return StoreArrayLength; } |
| 640 }; |
| 641 |
| 642 |
608 class BinaryOpStub: public PlatformCodeStub { | 643 class BinaryOpStub: public PlatformCodeStub { |
609 public: | 644 public: |
610 BinaryOpStub(Token::Value op, OverwriteMode mode) | 645 BinaryOpStub(Token::Value op, OverwriteMode mode) |
611 : op_(op), | 646 : op_(op), |
612 mode_(mode), | 647 mode_(mode), |
613 platform_specific_bit_(false), | 648 platform_specific_bit_(false), |
614 left_type_(BinaryOpIC::UNINITIALIZED), | 649 left_type_(BinaryOpIC::UNINITIALIZED), |
615 right_type_(BinaryOpIC::UNINITIALIZED), | 650 right_type_(BinaryOpIC::UNINITIALIZED), |
616 result_type_(BinaryOpIC::UNINITIALIZED) { | 651 result_type_(BinaryOpIC::UNINITIALIZED) { |
617 Initialize(); | 652 Initialize(); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 | 1413 |
1379 // The current function entry hook. | 1414 // The current function entry hook. |
1380 static FunctionEntryHook entry_hook_; | 1415 static FunctionEntryHook entry_hook_; |
1381 | 1416 |
1382 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1417 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
1383 }; | 1418 }; |
1384 | 1419 |
1385 } } // namespace v8::internal | 1420 } } // namespace v8::internal |
1386 | 1421 |
1387 #endif // V8_CODE_STUBS_H_ | 1422 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |