| 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 698 } |
| 699 }; | 699 }; |
| 700 | 700 |
| 701 | 701 |
| 702 class FastCloneShallowObjectStub : public HydrogenCodeStub { | 702 class FastCloneShallowObjectStub : public HydrogenCodeStub { |
| 703 public: | 703 public: |
| 704 // Maximum number of properties in copied object. | 704 // Maximum number of properties in copied object. |
| 705 static const int kMaximumClonedProperties = 6; | 705 static const int kMaximumClonedProperties = 6; |
| 706 | 706 |
| 707 FastCloneShallowObjectStub(Isolate* isolate, int length) | 707 FastCloneShallowObjectStub(Isolate* isolate, int length) |
| 708 : HydrogenCodeStub(isolate), length_(length) { | 708 : HydrogenCodeStub(isolate) { |
| 709 DCHECK_GE(length_, 0); | 709 DCHECK_GE(length, 0); |
| 710 DCHECK_LE(length_, kMaximumClonedProperties); | 710 DCHECK_LE(length, kMaximumClonedProperties); |
| 711 set_sub_minor_key(LengthBits::encode(length)); |
| 711 } | 712 } |
| 712 | 713 |
| 713 int length() const { return length_; } | 714 int length() const { return LengthBits::decode(sub_minor_key()); } |
| 714 | 715 |
| 715 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 716 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| 716 | 717 |
| 717 virtual void InitializeInterfaceDescriptor( | 718 virtual void InitializeInterfaceDescriptor( |
| 718 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; | 719 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
| 719 | 720 |
| 720 private: | 721 private: |
| 721 int length_; | 722 virtual Major MajorKey() const V8_OVERRIDE { return FastCloneShallowObject; } |
| 722 | 723 |
| 723 virtual Major MajorKey() const V8_OVERRIDE { return FastCloneShallowObject; } | 724 class LengthBits : public BitField<int, 0, 4> {}; |
| 724 int NotMissMinorKey() const { return length_; } | |
| 725 | 725 |
| 726 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); | 726 DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub); |
| 727 }; | 727 }; |
| 728 | 728 |
| 729 | 729 |
| 730 class CreateAllocationSiteStub : public HydrogenCodeStub { | 730 class CreateAllocationSiteStub : public HydrogenCodeStub { |
| 731 public: | 731 public: |
| 732 explicit CreateAllocationSiteStub(Isolate* isolate) | 732 explicit CreateAllocationSiteStub(Isolate* isolate) |
| 733 : HydrogenCodeStub(isolate) { } | 733 : HydrogenCodeStub(isolate) { } |
| 734 | 734 |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 STRING_ADD_CHECK_LEFT = 1 << 0, | 1295 STRING_ADD_CHECK_LEFT = 1 << 0, |
| 1296 // Check right parameter. | 1296 // Check right parameter. |
| 1297 STRING_ADD_CHECK_RIGHT = 1 << 1, | 1297 STRING_ADD_CHECK_RIGHT = 1 << 1, |
| 1298 // Check both parameters. | 1298 // Check both parameters. |
| 1299 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT | 1299 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT |
| 1300 }; | 1300 }; |
| 1301 | 1301 |
| 1302 | 1302 |
| 1303 class StringAddStub V8_FINAL : public HydrogenCodeStub { | 1303 class StringAddStub V8_FINAL : public HydrogenCodeStub { |
| 1304 public: | 1304 public: |
| 1305 StringAddStub(Isolate* isolate, | 1305 StringAddStub(Isolate* isolate, StringAddFlags flags, |
| 1306 StringAddFlags flags, | |
| 1307 PretenureFlag pretenure_flag) | 1306 PretenureFlag pretenure_flag) |
| 1308 : HydrogenCodeStub(isolate), | 1307 : HydrogenCodeStub(isolate) { |
| 1309 bit_field_(StringAddFlagsBits::encode(flags) | | 1308 set_sub_minor_key(StringAddFlagsBits::encode(flags) | |
| 1310 PretenureFlagBits::encode(pretenure_flag)) {} | 1309 PretenureFlagBits::encode(pretenure_flag)); |
| 1310 } |
| 1311 | 1311 |
| 1312 StringAddFlags flags() const { | 1312 StringAddFlags flags() const { |
| 1313 return StringAddFlagsBits::decode(bit_field_); | 1313 return StringAddFlagsBits::decode(sub_minor_key()); |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 PretenureFlag pretenure_flag() const { | 1316 PretenureFlag pretenure_flag() const { |
| 1317 return PretenureFlagBits::decode(bit_field_); | 1317 return PretenureFlagBits::decode(sub_minor_key()); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 1320 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| 1321 | 1321 |
| 1322 virtual void InitializeInterfaceDescriptor( | 1322 virtual void InitializeInterfaceDescriptor( |
| 1323 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; | 1323 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
| 1324 | 1324 |
| 1325 static void InstallDescriptors(Isolate* isolate); | 1325 static void InstallDescriptors(Isolate* isolate); |
| 1326 | 1326 |
| 1327 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1327 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 1328 static const int kLeft = 0; | 1328 static const int kLeft = 0; |
| 1329 static const int kRight = 1; | 1329 static const int kRight = 1; |
| 1330 | 1330 |
| 1331 private: | 1331 private: |
| 1332 virtual Major MajorKey() const V8_OVERRIDE { return StringAdd; } |
| 1333 |
| 1332 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; | 1334 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; |
| 1333 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; | 1335 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; |
| 1334 uint32_t bit_field_; | |
| 1335 | |
| 1336 virtual Major MajorKey() const V8_OVERRIDE { return StringAdd; } | |
| 1337 virtual int NotMissMinorKey() const V8_OVERRIDE { return bit_field_; } | |
| 1338 | 1336 |
| 1339 virtual void PrintBaseName(OStream& os) const V8_OVERRIDE; // NOLINT | 1337 virtual void PrintBaseName(OStream& os) const V8_OVERRIDE; // NOLINT |
| 1340 | 1338 |
| 1341 DISALLOW_COPY_AND_ASSIGN(StringAddStub); | 1339 DISALLOW_COPY_AND_ASSIGN(StringAddStub); |
| 1342 }; | 1340 }; |
| 1343 | 1341 |
| 1344 | 1342 |
| 1345 class ICCompareStub: public PlatformCodeStub { | 1343 class ICCompareStub: public PlatformCodeStub { |
| 1346 public: | 1344 public: |
| 1347 ICCompareStub(Isolate* isolate, | 1345 ICCompareStub(Isolate* isolate, |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 | 2101 |
| 2104 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub); | 2102 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub); |
| 2105 }; | 2103 }; |
| 2106 | 2104 |
| 2107 | 2105 |
| 2108 class LoadFastElementStub : public HydrogenCodeStub { | 2106 class LoadFastElementStub : public HydrogenCodeStub { |
| 2109 public: | 2107 public: |
| 2110 LoadFastElementStub(Isolate* isolate, bool is_js_array, | 2108 LoadFastElementStub(Isolate* isolate, bool is_js_array, |
| 2111 ElementsKind elements_kind) | 2109 ElementsKind elements_kind) |
| 2112 : HydrogenCodeStub(isolate) { | 2110 : HydrogenCodeStub(isolate) { |
| 2113 bit_field_ = ElementsKindBits::encode(elements_kind) | | 2111 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | |
| 2114 IsJSArrayBits::encode(is_js_array); | 2112 IsJSArrayBits::encode(is_js_array)); |
| 2115 } | 2113 } |
| 2116 | 2114 |
| 2117 bool is_js_array() const { | 2115 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
| 2118 return IsJSArrayBits::decode(bit_field_); | |
| 2119 } | |
| 2120 | 2116 |
| 2121 ElementsKind elements_kind() const { | 2117 ElementsKind elements_kind() const { |
| 2122 return ElementsKindBits::decode(bit_field_); | 2118 return ElementsKindBits::decode(sub_minor_key()); |
| 2123 } | 2119 } |
| 2124 | 2120 |
| 2125 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 2121 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| 2126 | 2122 |
| 2127 static void InstallDescriptors(Isolate* isolate); | 2123 static void InstallDescriptors(Isolate* isolate); |
| 2128 | 2124 |
| 2129 virtual void InitializeInterfaceDescriptor( | 2125 virtual void InitializeInterfaceDescriptor( |
| 2130 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; | 2126 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
| 2131 | 2127 |
| 2132 private: | 2128 private: |
| 2129 virtual Major MajorKey() const V8_OVERRIDE { return LoadElement; } |
| 2130 |
| 2133 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2131 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2134 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 2132 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
| 2135 uint32_t bit_field_; | |
| 2136 | |
| 2137 virtual Major MajorKey() const V8_OVERRIDE { return LoadElement; } | |
| 2138 int NotMissMinorKey() const { return bit_field_; } | |
| 2139 | 2133 |
| 2140 DISALLOW_COPY_AND_ASSIGN(LoadFastElementStub); | 2134 DISALLOW_COPY_AND_ASSIGN(LoadFastElementStub); |
| 2141 }; | 2135 }; |
| 2142 | 2136 |
| 2143 | 2137 |
| 2144 class StoreFastElementStub : public HydrogenCodeStub { | 2138 class StoreFastElementStub : public HydrogenCodeStub { |
| 2145 public: | 2139 public: |
| 2146 StoreFastElementStub(Isolate* isolate, bool is_js_array, | 2140 StoreFastElementStub(Isolate* isolate, bool is_js_array, |
| 2147 ElementsKind elements_kind, KeyedAccessStoreMode mode) | 2141 ElementsKind elements_kind, KeyedAccessStoreMode mode) |
| 2148 : HydrogenCodeStub(isolate) { | 2142 : HydrogenCodeStub(isolate) { |
| 2149 bit_field_ = ElementsKindBits::encode(elements_kind) | | 2143 set_sub_minor_key(ElementsKindBits::encode(elements_kind) | |
| 2150 IsJSArrayBits::encode(is_js_array) | | 2144 IsJSArrayBits::encode(is_js_array) | |
| 2151 StoreModeBits::encode(mode); | 2145 StoreModeBits::encode(mode)); |
| 2152 } | 2146 } |
| 2153 | 2147 |
| 2154 bool is_js_array() const { | 2148 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
| 2155 return IsJSArrayBits::decode(bit_field_); | |
| 2156 } | |
| 2157 | 2149 |
| 2158 ElementsKind elements_kind() const { | 2150 ElementsKind elements_kind() const { |
| 2159 return ElementsKindBits::decode(bit_field_); | 2151 return ElementsKindBits::decode(sub_minor_key()); |
| 2160 } | 2152 } |
| 2161 | 2153 |
| 2162 KeyedAccessStoreMode store_mode() const { | 2154 KeyedAccessStoreMode store_mode() const { |
| 2163 return StoreModeBits::decode(bit_field_); | 2155 return StoreModeBits::decode(sub_minor_key()); |
| 2164 } | 2156 } |
| 2165 | 2157 |
| 2166 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 2158 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| 2167 | 2159 |
| 2168 virtual void InitializeInterfaceDescriptor( | 2160 virtual void InitializeInterfaceDescriptor( |
| 2169 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; | 2161 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
| 2170 | 2162 |
| 2171 private: | 2163 private: |
| 2164 virtual Major MajorKey() const V8_OVERRIDE { return StoreElement; } |
| 2165 |
| 2172 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2166 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2173 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; | 2167 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; |
| 2174 class IsJSArrayBits: public BitField<bool, 12, 1> {}; | 2168 class IsJSArrayBits: public BitField<bool, 12, 1> {}; |
| 2175 uint32_t bit_field_; | |
| 2176 | |
| 2177 virtual Major MajorKey() const V8_OVERRIDE { return StoreElement; } | |
| 2178 int NotMissMinorKey() const { return bit_field_; } | |
| 2179 | 2169 |
| 2180 DISALLOW_COPY_AND_ASSIGN(StoreFastElementStub); | 2170 DISALLOW_COPY_AND_ASSIGN(StoreFastElementStub); |
| 2181 }; | 2171 }; |
| 2182 | 2172 |
| 2183 | 2173 |
| 2184 class TransitionElementsKindStub : public HydrogenCodeStub { | 2174 class TransitionElementsKindStub : public HydrogenCodeStub { |
| 2185 public: | 2175 public: |
| 2186 TransitionElementsKindStub(Isolate* isolate, | 2176 TransitionElementsKindStub(Isolate* isolate, |
| 2187 ElementsKind from_kind, | 2177 ElementsKind from_kind, |
| 2188 ElementsKind to_kind, | 2178 ElementsKind to_kind, |
| 2189 bool is_js_array) : HydrogenCodeStub(isolate) { | 2179 bool is_js_array) : HydrogenCodeStub(isolate) { |
| 2190 bit_field_ = FromKindBits::encode(from_kind) | | 2180 set_sub_minor_key(FromKindBits::encode(from_kind) | |
| 2191 ToKindBits::encode(to_kind) | | 2181 ToKindBits::encode(to_kind) | |
| 2192 IsJSArrayBits::encode(is_js_array); | 2182 IsJSArrayBits::encode(is_js_array)); |
| 2193 } | 2183 } |
| 2194 | 2184 |
| 2195 ElementsKind from_kind() const { | 2185 ElementsKind from_kind() const { |
| 2196 return FromKindBits::decode(bit_field_); | 2186 return FromKindBits::decode(sub_minor_key()); |
| 2197 } | 2187 } |
| 2198 | 2188 |
| 2199 ElementsKind to_kind() const { | 2189 ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); } |
| 2200 return ToKindBits::decode(bit_field_); | |
| 2201 } | |
| 2202 | 2190 |
| 2203 bool is_js_array() const { | 2191 bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); } |
| 2204 return IsJSArrayBits::decode(bit_field_); | |
| 2205 } | |
| 2206 | 2192 |
| 2207 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 2193 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
| 2208 | 2194 |
| 2209 virtual void InitializeInterfaceDescriptor( | 2195 virtual void InitializeInterfaceDescriptor( |
| 2210 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; | 2196 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
| 2211 | 2197 |
| 2212 private: | 2198 private: |
| 2199 virtual Major MajorKey() const V8_OVERRIDE { return TransitionElementsKind; } |
| 2200 |
| 2213 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; | 2201 class FromKindBits: public BitField<ElementsKind, 8, 8> {}; |
| 2214 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; | 2202 class ToKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2215 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 2203 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
| 2216 uint32_t bit_field_; | |
| 2217 | |
| 2218 virtual Major MajorKey() const V8_OVERRIDE { return TransitionElementsKind; } | |
| 2219 int NotMissMinorKey() const { return bit_field_; } | |
| 2220 | 2204 |
| 2221 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); | 2205 DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub); |
| 2222 }; | 2206 }; |
| 2223 | 2207 |
| 2224 | 2208 |
| 2225 class ArrayConstructorStubBase : public HydrogenCodeStub { | 2209 class ArrayConstructorStubBase : public HydrogenCodeStub { |
| 2226 public: | 2210 public: |
| 2227 ArrayConstructorStubBase(Isolate* isolate, | 2211 ArrayConstructorStubBase(Isolate* isolate, |
| 2228 ElementsKind kind, | 2212 ElementsKind kind, |
| 2229 AllocationSiteOverrideMode override_mode) | 2213 AllocationSiteOverrideMode override_mode) |
| 2230 : HydrogenCodeStub(isolate) { | 2214 : HydrogenCodeStub(isolate) { |
| 2231 // It only makes sense to override local allocation site behavior | 2215 // It only makes sense to override local allocation site behavior |
| 2232 // if there is a difference between the global allocation site policy | 2216 // if there is a difference between the global allocation site policy |
| 2233 // for an ElementsKind and the desired usage of the stub. | 2217 // for an ElementsKind and the desired usage of the stub. |
| 2234 DCHECK(override_mode != DISABLE_ALLOCATION_SITES || | 2218 DCHECK(override_mode != DISABLE_ALLOCATION_SITES || |
| 2235 AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE); | 2219 AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE); |
| 2236 bit_field_ = ElementsKindBits::encode(kind) | | 2220 set_sub_minor_key(ElementsKindBits::encode(kind) | |
| 2237 AllocationSiteOverrideModeBits::encode(override_mode); | 2221 AllocationSiteOverrideModeBits::encode(override_mode)); |
| 2238 } | 2222 } |
| 2239 | 2223 |
| 2240 ElementsKind elements_kind() const { | 2224 ElementsKind elements_kind() const { |
| 2241 return ElementsKindBits::decode(bit_field_); | 2225 return ElementsKindBits::decode(sub_minor_key()); |
| 2242 } | 2226 } |
| 2243 | 2227 |
| 2244 AllocationSiteOverrideMode override_mode() const { | 2228 AllocationSiteOverrideMode override_mode() const { |
| 2245 return AllocationSiteOverrideModeBits::decode(bit_field_); | 2229 return AllocationSiteOverrideModeBits::decode(sub_minor_key()); |
| 2246 } | 2230 } |
| 2247 | 2231 |
| 2248 static void GenerateStubsAheadOfTime(Isolate* isolate); | 2232 static void GenerateStubsAheadOfTime(Isolate* isolate); |
| 2249 static void InstallDescriptors(Isolate* isolate); | 2233 static void InstallDescriptors(Isolate* isolate); |
| 2250 | 2234 |
| 2251 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 2235 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 2252 static const int kConstructor = 0; | 2236 static const int kConstructor = 0; |
| 2253 static const int kAllocationSite = 1; | 2237 static const int kAllocationSite = 1; |
| 2254 | 2238 |
| 2255 protected: | 2239 protected: |
| 2256 OStream& BasePrintName(OStream& os, const char* name) const; // NOLINT | 2240 OStream& BasePrintName(OStream& os, const char* name) const; // NOLINT |
| 2257 | 2241 |
| 2258 private: | 2242 private: |
| 2259 int NotMissMinorKey() const { return bit_field_; } | |
| 2260 | |
| 2261 // Ensure data fits within available bits. | 2243 // Ensure data fits within available bits. |
| 2262 STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1); | 2244 STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1); |
| 2263 | 2245 |
| 2264 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 2246 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 2265 class AllocationSiteOverrideModeBits: public | 2247 class AllocationSiteOverrideModeBits: public |
| 2266 BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT | 2248 BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT |
| 2267 uint32_t bit_field_; | |
| 2268 | 2249 |
| 2269 DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase); | 2250 DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase); |
| 2270 }; | 2251 }; |
| 2271 | 2252 |
| 2272 | 2253 |
| 2273 class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { | 2254 class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase { |
| 2274 public: | 2255 public: |
| 2275 ArrayNoArgumentConstructorStub( | 2256 ArrayNoArgumentConstructorStub( |
| 2276 Isolate* isolate, | 2257 Isolate* isolate, |
| 2277 ElementsKind kind, | 2258 ElementsKind kind, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 } | 2329 } |
| 2349 | 2330 |
| 2350 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); | 2331 DISALLOW_COPY_AND_ASSIGN(ArrayNArgumentsConstructorStub); |
| 2351 }; | 2332 }; |
| 2352 | 2333 |
| 2353 | 2334 |
| 2354 class InternalArrayConstructorStubBase : public HydrogenCodeStub { | 2335 class InternalArrayConstructorStubBase : public HydrogenCodeStub { |
| 2355 public: | 2336 public: |
| 2356 InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind) | 2337 InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind) |
| 2357 : HydrogenCodeStub(isolate) { | 2338 : HydrogenCodeStub(isolate) { |
| 2358 kind_ = kind; | 2339 set_sub_minor_key(ElementsKindBits::encode(kind)); |
| 2359 } | 2340 } |
| 2360 | 2341 |
| 2361 static void GenerateStubsAheadOfTime(Isolate* isolate); | 2342 static void GenerateStubsAheadOfTime(Isolate* isolate); |
| 2362 static void InstallDescriptors(Isolate* isolate); | 2343 static void InstallDescriptors(Isolate* isolate); |
| 2363 | 2344 |
| 2364 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 2345 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
| 2365 static const int kConstructor = 0; | 2346 static const int kConstructor = 0; |
| 2366 | 2347 |
| 2367 ElementsKind elements_kind() const { return kind_; } | 2348 ElementsKind elements_kind() const { |
| 2349 return ElementsKindBits::decode(sub_minor_key()); |
| 2350 } |
| 2368 | 2351 |
| 2369 private: | 2352 private: |
| 2370 int NotMissMinorKey() const { return kind_; } | 2353 class ElementsKindBits : public BitField<ElementsKind, 0, 8> {}; |
| 2371 | |
| 2372 ElementsKind kind_; | |
| 2373 | 2354 |
| 2374 DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStubBase); | 2355 DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStubBase); |
| 2375 }; | 2356 }; |
| 2376 | 2357 |
| 2377 | 2358 |
| 2378 class InternalArrayNoArgumentConstructorStub : public | 2359 class InternalArrayNoArgumentConstructorStub : public |
| 2379 InternalArrayConstructorStubBase { | 2360 InternalArrayConstructorStubBase { |
| 2380 public: | 2361 public: |
| 2381 InternalArrayNoArgumentConstructorStub(Isolate* isolate, | 2362 InternalArrayNoArgumentConstructorStub(Isolate* isolate, |
| 2382 ElementsKind kind) | 2363 ElementsKind kind) |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2689 | 2670 |
| 2690 | 2671 |
| 2691 class CallDescriptors { | 2672 class CallDescriptors { |
| 2692 public: | 2673 public: |
| 2693 static void InitializeForIsolate(Isolate* isolate); | 2674 static void InitializeForIsolate(Isolate* isolate); |
| 2694 }; | 2675 }; |
| 2695 | 2676 |
| 2696 } } // namespace v8::internal | 2677 } } // namespace v8::internal |
| 2697 | 2678 |
| 2698 #endif // V8_CODE_STUBS_H_ | 2679 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |