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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 V(StoreArrayLiteralElement) \ | 69 V(StoreArrayLiteralElement) \ |
70 V(StubFailureTrampoline) \ | 70 V(StubFailureTrampoline) \ |
71 V(ArrayConstructor) \ | 71 V(ArrayConstructor) \ |
72 V(InternalArrayConstructor) \ | 72 V(InternalArrayConstructor) \ |
73 V(ProfileEntryHook) \ | 73 V(ProfileEntryHook) \ |
74 V(StoreGlobal) \ | 74 V(StoreGlobal) \ |
75 V(CallApiFunction) \ | 75 V(CallApiFunction) \ |
76 V(CallApiGetter) \ | 76 V(CallApiGetter) \ |
77 /* IC Handler stubs */ \ | 77 /* IC Handler stubs */ \ |
78 V(LoadField) \ | 78 V(LoadField) \ |
79 V(StoreField) \ | |
79 V(LoadConstant) \ | 80 V(LoadConstant) \ |
80 V(StringLength) | 81 V(StringLength) |
81 | 82 |
82 // List of code stubs only used on ARM 32 bits platforms. | 83 // List of code stubs only used on ARM 32 bits platforms. |
83 #if V8_TARGET_ARCH_ARM | 84 #if V8_TARGET_ARCH_ARM |
84 #define CODE_STUB_LIST_ARM(V) \ | 85 #define CODE_STUB_LIST_ARM(V) \ |
85 V(GetProperty) \ | 86 V(GetProperty) \ |
86 V(SetProperty) \ | 87 V(SetProperty) \ |
87 V(InvokeBuiltin) \ | 88 V(InvokeBuiltin) \ |
88 V(DirectCEntry) | 89 V(DirectCEntry) |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
913 virtual int NotMissMinorKey() const { return bit_field_; } | 914 virtual int NotMissMinorKey() const { return bit_field_; } |
914 virtual Code::Kind kind() const = 0; | 915 virtual Code::Kind kind() const = 0; |
915 int bit_field_; | 916 int bit_field_; |
916 }; | 917 }; |
917 | 918 |
918 | 919 |
919 class LoadFieldStub: public HandlerStub { | 920 class LoadFieldStub: public HandlerStub { |
920 public: | 921 public: |
921 LoadFieldStub(Isolate* isolate, FieldIndex index) | 922 LoadFieldStub(Isolate* isolate, FieldIndex index) |
922 : HandlerStub(isolate), index_(index) { | 923 : HandlerStub(isolate), index_(index) { |
923 int property_index_key = index_.GetLoadFieldStubKey(); | 924 int property_index_key = index_.GetFieldAccessStubKey(); |
924 bit_field_ = EncodedLoadFieldByIndexBits::encode(property_index_key); | 925 bit_field_ = EncodedLoadFieldByIndexBits::encode(property_index_key); |
925 } | 926 } |
926 | 927 |
927 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 928 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
928 | 929 |
929 Representation representation() { | |
930 if (unboxed_double()) return Representation::Double(); | |
931 return Representation::Tagged(); | |
932 } | |
933 | |
934 FieldIndex index() const { return index_; } | 930 FieldIndex index() const { return index_; } |
935 bool unboxed_double() { return index_.is_double(); } | |
936 | 931 |
937 protected: | 932 protected: |
938 explicit LoadFieldStub(Isolate* isolate); | 933 explicit LoadFieldStub(Isolate* isolate); |
939 virtual Code::Kind kind() const { return Code::LOAD_IC; } | 934 virtual Code::Kind kind() const { return Code::LOAD_IC; } |
940 virtual Code::StubType GetStubType() { return Code::FAST; } | 935 virtual Code::StubType GetStubType() { return Code::FAST; } |
941 | 936 |
942 private: | 937 private: |
943 class EncodedLoadFieldByIndexBits : public BitField<int, 0, 13> {}; | 938 class EncodedLoadFieldByIndexBits : public BitField<int, 0, 13> {}; |
944 virtual CodeStub::Major MajorKey() const { return LoadField; } | 939 virtual CodeStub::Major MajorKey() const { return LoadField; } |
945 FieldIndex index_; | 940 FieldIndex index_; |
(...skipping 27 matching lines...) Expand all Loading... | |
973 | 968 |
974 protected: | 969 protected: |
975 virtual Code::Kind kind() const { return Code::LOAD_IC; } | 970 virtual Code::Kind kind() const { return Code::LOAD_IC; } |
976 virtual Code::StubType GetStubType() { return Code::FAST; } | 971 virtual Code::StubType GetStubType() { return Code::FAST; } |
977 | 972 |
978 private: | 973 private: |
979 virtual CodeStub::Major MajorKey() const { return StringLength; } | 974 virtual CodeStub::Major MajorKey() const { return StringLength; } |
980 }; | 975 }; |
981 | 976 |
982 | 977 |
978 class StoreFieldStub : public HandlerStub { | |
979 public: | |
980 StoreFieldStub(Isolate* isolate, FieldIndex index, | |
981 Representation representation) | |
982 : HandlerStub(isolate), index_(index), representation_(representation) { | |
983 int property_index_key = index_.GetFieldAccessStubKey(); | |
984 bit_field_ = EncodedStoreFieldByIndexBits::encode(property_index_key) | | |
985 RepresentationBits::encode( | |
986 PropertyDetails::EncodeRepresentation(representation)); | |
987 ; | |
Jakob Kummerow
2014/08/06 09:19:41
I don't think this is needed
Toon Verwaest
2014/08/06 09:26:36
Done.
| |
988 } | |
989 | |
990 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | |
991 | |
992 FieldIndex index() const { return index_; } | |
993 Representation representation() { return representation_; } | |
994 | |
995 protected: | |
996 explicit StoreFieldStub(Isolate* isolate); | |
997 virtual Code::Kind kind() const { return Code::STORE_IC; } | |
998 virtual Code::StubType GetStubType() { return Code::FAST; } | |
999 | |
1000 private: | |
1001 class EncodedStoreFieldByIndexBits : public BitField<int, 0, 13> {}; | |
1002 class RepresentationBits : public BitField<int, 13, 4> {}; | |
1003 virtual CodeStub::Major MajorKey() const { return StoreField; } | |
1004 FieldIndex index_; | |
1005 Representation representation_; | |
Jakob Kummerow
2014/08/06 09:19:41
Are you intentionally storing the representation t
Toon Verwaest
2014/08/06 09:26:36
Yeah, same as for the field index. The bit_field_
| |
1006 }; | |
1007 | |
1008 | |
983 class StoreGlobalStub : public HandlerStub { | 1009 class StoreGlobalStub : public HandlerStub { |
984 public: | 1010 public: |
985 StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global) | 1011 StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global) |
986 : HandlerStub(isolate) { | 1012 : HandlerStub(isolate) { |
987 bit_field_ = IsConstantBits::encode(is_constant) | | 1013 bit_field_ = IsConstantBits::encode(is_constant) | |
988 CheckGlobalBits::encode(check_global); | 1014 CheckGlobalBits::encode(check_global); |
989 } | 1015 } |
990 | 1016 |
991 static Handle<HeapObject> global_placeholder(Isolate* isolate) { | 1017 static Handle<HeapObject> global_placeholder(Isolate* isolate) { |
992 return isolate->factory()->uninitialized_value(); | 1018 return isolate->factory()->uninitialized_value(); |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2484 | 2510 |
2485 | 2511 |
2486 class CallDescriptors { | 2512 class CallDescriptors { |
2487 public: | 2513 public: |
2488 static void InitializeForIsolate(Isolate* isolate); | 2514 static void InitializeForIsolate(Isolate* isolate); |
2489 }; | 2515 }; |
2490 | 2516 |
2491 } } // namespace v8::internal | 2517 } } // namespace v8::internal |
2492 | 2518 |
2493 #endif // V8_CODE_STUBS_H_ | 2519 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |