Chromium Code Reviews| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 V(CEntry) \ | 73 V(CEntry) \ |
| 74 V(JSEntry) \ | 74 V(JSEntry) \ |
| 75 V(KeyedLoadElement) \ | 75 V(KeyedLoadElement) \ |
| 76 V(KeyedStoreElement) \ | 76 V(KeyedStoreElement) \ |
| 77 V(DebuggerStatement) \ | 77 V(DebuggerStatement) \ |
| 78 V(StringDictionaryLookup) \ | 78 V(StringDictionaryLookup) \ |
| 79 V(ElementsTransitionAndStore) \ | 79 V(ElementsTransitionAndStore) \ |
| 80 V(TransitionElementsKind) \ | 80 V(TransitionElementsKind) \ |
| 81 V(StoreArrayLiteralElement) \ | 81 V(StoreArrayLiteralElement) \ |
| 82 V(StubFailureTrampoline) \ | 82 V(StubFailureTrampoline) \ |
| 83 V(ProfileEntryHook) | 83 V(ProfileEntryHook) \ |
| 84 /* IC Handler stubs */ \ | |
| 85 V(LoadField) | |
| 84 | 86 |
| 85 // List of code stubs only used on ARM platforms. | 87 // List of code stubs only used on ARM platforms. |
| 86 #ifdef V8_TARGET_ARCH_ARM | 88 #ifdef V8_TARGET_ARCH_ARM |
| 87 #define CODE_STUB_LIST_ARM(V) \ | 89 #define CODE_STUB_LIST_ARM(V) \ |
| 88 V(GetProperty) \ | 90 V(GetProperty) \ |
| 89 V(SetProperty) \ | 91 V(SetProperty) \ |
| 90 V(InvokeBuiltin) \ | 92 V(InvokeBuiltin) \ |
| 91 V(RegExpCEntry) \ | 93 V(RegExpCEntry) \ |
| 92 V(DirectCEntry) | 94 V(DirectCEntry) |
| 93 #else | 95 #else |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 // Generates the assembler code for the stub. | 180 // Generates the assembler code for the stub. |
| 179 virtual Handle<Code> GenerateCode() = 0; | 181 virtual Handle<Code> GenerateCode() = 0; |
| 180 | 182 |
| 181 // BinaryOpStub needs to override this. | 183 // BinaryOpStub needs to override this. |
| 182 virtual InlineCacheState GetICState() { | 184 virtual InlineCacheState GetICState() { |
| 183 return UNINITIALIZED; | 185 return UNINITIALIZED; |
| 184 } | 186 } |
| 185 virtual Code::ExtraICState GetExtraICState() { | 187 virtual Code::ExtraICState GetExtraICState() { |
| 186 return Code::kNoExtraICState; | 188 return Code::kNoExtraICState; |
| 187 } | 189 } |
| 190 virtual Code::StubType GetStubType() { | |
| 191 return Code::NORMAL; | |
| 192 } | |
| 188 | 193 |
| 189 // Returns whether the code generated for this stub needs to be allocated as | 194 // Returns whether the code generated for this stub needs to be allocated as |
| 190 // a fixed (non-moveable) code object. | 195 // a fixed (non-moveable) code object. |
| 191 virtual bool NeedsImmovableCode() { return false; } | 196 virtual bool NeedsImmovableCode() { return false; } |
| 192 | 197 |
| 193 private: | 198 private: |
| 194 // Perform bookkeeping required after code generation when stub code is | 199 // Perform bookkeeping required after code generation when stub code is |
| 195 // initially generated. | 200 // initially generated. |
| 196 void RecordCodeGeneration(Code* code, Isolate* isolate); | 201 void RecordCodeGeneration(Code* code, Isolate* isolate); |
| 197 | 202 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 642 public: | 647 public: |
| 643 explicit StoreArrayLengthStub(Code::Kind kind, StrictModeFlag strict_mode) | 648 explicit StoreArrayLengthStub(Code::Kind kind, StrictModeFlag strict_mode) |
| 644 : StoreICStub(kind, strict_mode) { } | 649 : StoreICStub(kind, strict_mode) { } |
| 645 virtual void Generate(MacroAssembler* masm); | 650 virtual void Generate(MacroAssembler* masm); |
| 646 | 651 |
| 647 private: | 652 private: |
| 648 virtual CodeStub::Major MajorKey() { return StoreArrayLength; } | 653 virtual CodeStub::Major MajorKey() { return StoreArrayLength; } |
| 649 }; | 654 }; |
| 650 | 655 |
| 651 | 656 |
| 657 class HandlerStub: public ICStub { | |
| 658 public: | |
| 659 explicit HandlerStub(Code::Kind kind) : ICStub(kind) { } | |
| 660 | |
| 661 protected: | |
| 662 virtual Code::ExtraICState GetExtraICState() { | |
| 663 return Code::HANDLER_FRAGMENT; | |
| 664 } | |
| 665 }; | |
| 666 | |
| 667 | |
| 668 class LoadFieldStub: public HandlerStub { | |
| 669 public: | |
| 670 enum FieldMode { HEADER, INOBJECT, PROPERTIES }; | |
| 671 LoadFieldStub(Register reg, bool inobject, int index) | |
| 672 : HandlerStub(Code::LOAD_IC), reg_(reg), | |
|
Jakob Kummerow
2013/03/01 22:21:04
nit: let's give each initializer statement its own
Toon Verwaest
2013/03/04 10:54:08
Done.
| |
| 673 inobject_(inobject), index_(index) { } | |
| 674 virtual void Generate(MacroAssembler* masm); | |
| 675 | |
| 676 protected: | |
| 677 virtual Code::StubType GetStubType() { return Code::FIELD; } | |
| 678 | |
| 679 private: | |
| 680 class RegisterBits: public BitField<int, 1, 4> {}; | |
|
Jakob Kummerow
2013/03/01 22:21:04
Looks like something's wrong with those bit fields
Toon Verwaest
2013/03/04 10:54:08
Doh, what did I do there.
2**11 is a reasonable u
| |
| 681 class InobjectBits: public BitField<bool, 6, 4> {}; | |
| 682 class IndexBits: public BitField<int, 10, 11> {}; | |
| 683 virtual CodeStub::Major MajorKey() { return LoadField; } | |
| 684 virtual int MinorKey() { | |
| 685 return HandlerStub::MinorKey() | |
| 686 | RegisterBits::encode(reg_.code()) | |
| 687 | InobjectBits::encode(inobject_) | |
| 688 | IndexBits::encode(index_); | |
| 689 } | |
| 690 | |
| 691 Register reg_; | |
| 692 bool inobject_; | |
| 693 int index_; | |
| 694 }; | |
| 695 | |
| 696 | |
| 652 class BinaryOpStub: public PlatformCodeStub { | 697 class BinaryOpStub: public PlatformCodeStub { |
| 653 public: | 698 public: |
| 654 BinaryOpStub(Token::Value op, OverwriteMode mode) | 699 BinaryOpStub(Token::Value op, OverwriteMode mode) |
| 655 : op_(op), | 700 : op_(op), |
| 656 mode_(mode), | 701 mode_(mode), |
| 657 platform_specific_bit_(false), | 702 platform_specific_bit_(false), |
| 658 left_type_(BinaryOpIC::UNINITIALIZED), | 703 left_type_(BinaryOpIC::UNINITIALIZED), |
| 659 right_type_(BinaryOpIC::UNINITIALIZED), | 704 right_type_(BinaryOpIC::UNINITIALIZED), |
| 660 result_type_(BinaryOpIC::UNINITIALIZED) { | 705 result_type_(BinaryOpIC::UNINITIALIZED) { |
| 661 Initialize(); | 706 Initialize(); |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1504 | 1549 |
| 1505 // The current function entry hook. | 1550 // The current function entry hook. |
| 1506 static FunctionEntryHook entry_hook_; | 1551 static FunctionEntryHook entry_hook_; |
| 1507 | 1552 |
| 1508 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1553 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 1509 }; | 1554 }; |
| 1510 | 1555 |
| 1511 } } // namespace v8::internal | 1556 } } // namespace v8::internal |
| 1512 | 1557 |
| 1513 #endif // V8_CODE_STUBS_H_ | 1558 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |