| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
| 6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 protected: | 893 protected: |
| 894 virtual void PrintState(OStream& os) const V8_OVERRIDE; // NOLINT | 894 virtual void PrintState(OStream& os) const V8_OVERRIDE; // NOLINT |
| 895 | 895 |
| 896 virtual CodeStub::Major MajorKey() const { return CallIC_Array; } | 896 virtual CodeStub::Major MajorKey() const { return CallIC_Array; } |
| 897 }; | 897 }; |
| 898 | 898 |
| 899 | 899 |
| 900 // TODO(verwaest): Translate to hydrogen code stub. | 900 // TODO(verwaest): Translate to hydrogen code stub. |
| 901 class FunctionPrototypeStub : public PlatformCodeStub { | 901 class FunctionPrototypeStub : public PlatformCodeStub { |
| 902 public: | 902 public: |
| 903 FunctionPrototypeStub(Isolate* isolate, Code::Kind kind) | 903 explicit FunctionPrototypeStub(Isolate* isolate) |
| 904 : PlatformCodeStub(isolate) { | 904 : PlatformCodeStub(isolate) {} |
| 905 bit_field_ = KindBits::encode(kind); | |
| 906 } | |
| 907 virtual void Generate(MacroAssembler* masm); | 905 virtual void Generate(MacroAssembler* masm); |
| 908 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } | 906 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } |
| 909 virtual InlineCacheState GetICState() { return MONOMORPHIC; } | |
| 910 virtual ExtraICState GetExtraICState() const { return kind(); } | |
| 911 | |
| 912 protected: | |
| 913 class KindBits : public BitField<Code::Kind, 0, 4> {}; | |
| 914 virtual Code::Kind kind() const { return KindBits::decode(bit_field_); } | |
| 915 | 907 |
| 916 private: | 908 private: |
| 917 virtual CodeStub::Major MajorKey() const { return FunctionPrototype; } | 909 virtual CodeStub::Major MajorKey() const { return FunctionPrototype; } |
| 918 virtual int MinorKey() const { return bit_field_; } | 910 virtual int MinorKey() const { return 0; } |
| 919 int bit_field_; | |
| 920 }; | 911 }; |
| 921 | 912 |
| 922 | 913 |
| 923 class StoreICStub: public ICStub { | 914 class StoreICStub: public ICStub { |
| 924 public: | 915 public: |
| 925 StoreICStub(Isolate* isolate, Code::Kind kind, StrictMode strict_mode) | 916 StoreICStub(Isolate* isolate, Code::Kind kind, StrictMode strict_mode) |
| 926 : ICStub(isolate, kind), strict_mode_(strict_mode) { } | 917 : ICStub(isolate, kind), strict_mode_(strict_mode) { } |
| 927 | 918 |
| 928 protected: | 919 protected: |
| 929 virtual ExtraICState GetExtraICState() const { | 920 virtual ExtraICState GetExtraICState() const { |
| (...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2538 | 2529 |
| 2539 | 2530 |
| 2540 class CallDescriptors { | 2531 class CallDescriptors { |
| 2541 public: | 2532 public: |
| 2542 static void InitializeForIsolate(Isolate* isolate); | 2533 static void InitializeForIsolate(Isolate* isolate); |
| 2543 }; | 2534 }; |
| 2544 | 2535 |
| 2545 } } // namespace v8::internal | 2536 } } // namespace v8::internal |
| 2546 | 2537 |
| 2547 #endif // V8_CODE_STUBS_H_ | 2538 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |