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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 | 892 |
893 virtual void Generate(MacroAssembler* masm); | 893 virtual void Generate(MacroAssembler* masm); |
894 | 894 |
895 protected: | 895 protected: |
896 virtual void PrintState(OStream& os) const V8_OVERRIDE; // NOLINT | 896 virtual void PrintState(OStream& os) const V8_OVERRIDE; // NOLINT |
897 | 897 |
898 virtual CodeStub::Major MajorKey() const { return CallIC_Array; } | 898 virtual CodeStub::Major MajorKey() const { return CallIC_Array; } |
899 }; | 899 }; |
900 | 900 |
901 | 901 |
902 class FunctionPrototypeStub: public ICStub { | 902 // TODO(verwaest): Translate to hydrogen code stub. |
| 903 class FunctionPrototypeStub : public PlatformCodeStub { |
903 public: | 904 public: |
904 FunctionPrototypeStub(Isolate* isolate, Code::Kind kind) | 905 FunctionPrototypeStub(Isolate* isolate, Code::Kind kind) |
905 : ICStub(isolate, kind) { } | 906 : PlatformCodeStub(isolate) { |
| 907 bit_field_ = KindBits::encode(kind); |
| 908 } |
906 virtual void Generate(MacroAssembler* masm); | 909 virtual void Generate(MacroAssembler* masm); |
| 910 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } |
| 911 virtual InlineCacheState GetICState() { return MONOMORPHIC; } |
| 912 virtual ExtraICState GetExtraICState() const { return kind(); } |
| 913 |
| 914 protected: |
| 915 class KindBits : public BitField<Code::Kind, 0, 4> {}; |
| 916 virtual Code::Kind kind() const { return KindBits::decode(bit_field_); } |
907 | 917 |
908 private: | 918 private: |
909 virtual CodeStub::Major MajorKey() const { return FunctionPrototype; } | 919 virtual CodeStub::Major MajorKey() const { return FunctionPrototype; } |
| 920 virtual int MinorKey() const { return bit_field_; } |
| 921 int bit_field_; |
910 }; | 922 }; |
911 | 923 |
912 | 924 |
913 class StoreICStub: public ICStub { | 925 class StoreICStub: public ICStub { |
914 public: | 926 public: |
915 StoreICStub(Isolate* isolate, Code::Kind kind, StrictMode strict_mode) | 927 StoreICStub(Isolate* isolate, Code::Kind kind, StrictMode strict_mode) |
916 : ICStub(isolate, kind), strict_mode_(strict_mode) { } | 928 : ICStub(isolate, kind), strict_mode_(strict_mode) { } |
917 | 929 |
918 protected: | 930 protected: |
919 virtual ExtraICState GetExtraICState() const { | 931 virtual ExtraICState GetExtraICState() const { |
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2556 | 2568 |
2557 | 2569 |
2558 class CallDescriptors { | 2570 class CallDescriptors { |
2559 public: | 2571 public: |
2560 static void InitializeForIsolate(Isolate* isolate); | 2572 static void InitializeForIsolate(Isolate* isolate); |
2561 }; | 2573 }; |
2562 | 2574 |
2563 } } // namespace v8::internal | 2575 } } // namespace v8::internal |
2564 | 2576 |
2565 #endif // V8_CODE_STUBS_H_ | 2577 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |