Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Side by Side Diff: src/code-stubs.h

Issue 587203002: ExtendStorageStub added, it is aimed for extending objects backing store when it runs out of space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 V(NumberToString) \ 73 V(NumberToString) \
74 V(RegExpConstructResult) \ 74 V(RegExpConstructResult) \
75 V(StoreFastElement) \ 75 V(StoreFastElement) \
76 V(StringAdd) \ 76 V(StringAdd) \
77 V(ToBoolean) \ 77 V(ToBoolean) \
78 V(ToNumber) \ 78 V(ToNumber) \
79 V(TransitionElementsKind) \ 79 V(TransitionElementsKind) \
80 V(VectorKeyedLoad) \ 80 V(VectorKeyedLoad) \
81 V(VectorLoad) \ 81 V(VectorLoad) \
82 /* IC Handler stubs */ \ 82 /* IC Handler stubs */ \
83 V(ExtendStorage) \
83 V(LoadConstant) \ 84 V(LoadConstant) \
84 V(LoadField) \ 85 V(LoadField) \
85 V(StoreField) \ 86 V(StoreField) \
86 V(StoreGlobal) \ 87 V(StoreGlobal) \
87 V(StringLength) 88 V(StringLength)
88 89
89 // List of code stubs only used on ARM 32 bits platforms. 90 // List of code stubs only used on ARM 32 bits platforms.
90 #if V8_TARGET_ARCH_ARM 91 #if V8_TARGET_ARCH_ARM
91 #define CODE_STUB_LIST_ARM(V) \ 92 #define CODE_STUB_LIST_ARM(V) \
92 V(DirectCEntry) \ 93 V(DirectCEntry) \
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 virtual Code::StubType GetStubType() { return Code::FAST; } 975 virtual Code::StubType GetStubType() { return Code::FAST; }
975 976
976 private: 977 private:
977 class StoreFieldByIndexBits : public BitField<int, 0, 13> {}; 978 class StoreFieldByIndexBits : public BitField<int, 0, 13> {};
978 class RepresentationBits : public BitField<uint8_t, 13, 4> {}; 979 class RepresentationBits : public BitField<uint8_t, 13, 4> {};
979 980
980 DEFINE_HANDLER_CODE_STUB(StoreField, HandlerStub); 981 DEFINE_HANDLER_CODE_STUB(StoreField, HandlerStub);
981 }; 982 };
982 983
983 984
985 // Extend storage is called in a store inline cache when
986 // it is necessary to extend the properties array of a
987 // JSObject.
988 class ExtendStorageStub : public HandlerStub {
989 public:
990 ExtendStorageStub(Isolate* isolate, FieldIndex index,
991 Representation representation)
992 : HandlerStub(isolate) {
993 int property_index_key = index.GetFieldAccessStubKey();
994 uint8_t repr = PropertyDetails::EncodeRepresentation(representation);
995 set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) |
996 RepresentationBits::encode(repr));
997 }
998
999 FieldIndex index() const {
1000 int property_index_key = StoreFieldByIndexBits::decode(sub_minor_key());
1001 return FieldIndex::FromFieldAccessStubKey(property_index_key);
1002 }
1003
1004 Representation representation() {
1005 uint8_t repr = RepresentationBits::decode(sub_minor_key());
1006 return PropertyDetails::DecodeRepresentation(repr);
1007 }
1008
1009 virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE;
1010
1011 protected:
1012 virtual Code::Kind kind() const { return Code::STORE_IC; }
1013 virtual Code::StubType GetStubType() { return Code::FAST; }
1014
1015 private:
1016 class StoreFieldByIndexBits : public BitField<int, 0, 13> {};
1017 class RepresentationBits : public BitField<uint8_t, 13, 4> {};
1018
1019 DEFINE_HANDLER_CODE_STUB(ExtendStorage, HandlerStub);
1020 };
1021
1022
984 class StoreGlobalStub : public HandlerStub { 1023 class StoreGlobalStub : public HandlerStub {
985 public: 1024 public:
986 StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global) 1025 StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global)
987 : HandlerStub(isolate) { 1026 : HandlerStub(isolate) {
988 set_sub_minor_key(IsConstantBits::encode(is_constant) | 1027 set_sub_minor_key(IsConstantBits::encode(is_constant) |
989 CheckGlobalBits::encode(check_global)); 1028 CheckGlobalBits::encode(check_global));
990 } 1029 }
991 1030
992 static Handle<HeapObject> global_placeholder(Isolate* isolate) { 1031 static Handle<HeapObject> global_placeholder(Isolate* isolate) {
993 return isolate->factory()->uninitialized_value(); 1032 return isolate->factory()->uninitialized_value();
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2413 2452
2414 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2453 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2415 #undef DEFINE_PLATFORM_CODE_STUB 2454 #undef DEFINE_PLATFORM_CODE_STUB
2416 #undef DEFINE_HANDLER_CODE_STUB 2455 #undef DEFINE_HANDLER_CODE_STUB
2417 #undef DEFINE_HYDROGEN_CODE_STUB 2456 #undef DEFINE_HYDROGEN_CODE_STUB
2418 #undef DEFINE_CODE_STUB 2457 #undef DEFINE_CODE_STUB
2419 #undef DEFINE_CODE_STUB_BASE 2458 #undef DEFINE_CODE_STUB_BASE
2420 } } // namespace v8::internal 2459 } } // namespace v8::internal
2421 2460
2422 #endif // V8_CODE_STUBS_H_ 2461 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698