OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 Major MajorKey() { return ToBoolean; } | 2238 Major MajorKey() { return ToBoolean; } |
2239 int NotMissMinorKey() { return GetExtraICState(); } | 2239 int NotMissMinorKey() { return GetExtraICState(); } |
2240 | 2240 |
2241 explicit ToBooleanStub(InitializationState init_state) : | 2241 explicit ToBooleanStub(InitializationState init_state) : |
2242 HydrogenCodeStub(init_state) {} | 2242 HydrogenCodeStub(init_state) {} |
2243 | 2243 |
2244 Types types_; | 2244 Types types_; |
2245 }; | 2245 }; |
2246 | 2246 |
2247 | 2247 |
2248 class ElementsTransitionAndStoreStub : public PlatformCodeStub { | 2248 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
2249 public: | 2249 public: |
2250 ElementsTransitionAndStoreStub(ElementsKind from, | 2250 ElementsTransitionAndStoreStub(ElementsKind from_kind, |
2251 ElementsKind to, | 2251 ElementsKind to_kind, |
2252 bool is_jsarray, | 2252 bool is_jsarray, |
2253 StrictModeFlag strict_mode, | |
2254 KeyedAccessStoreMode store_mode) | 2253 KeyedAccessStoreMode store_mode) |
| 2254 : from_kind_(from_kind), |
| 2255 to_kind_(to_kind), |
| 2256 is_jsarray_(is_jsarray), |
| 2257 store_mode_(store_mode) {} |
| 2258 |
| 2259 ElementsKind from_kind() const { return from_kind_; } |
| 2260 ElementsKind to_kind() const { return to_kind_; } |
| 2261 bool is_jsarray() const { return is_jsarray_; } |
| 2262 KeyedAccessStoreMode store_mode() const { return store_mode_; } |
| 2263 |
| 2264 Handle<Code> GenerateCode(); |
| 2265 |
| 2266 void InitializeInterfaceDescriptor( |
| 2267 Isolate* isolate, |
| 2268 CodeStubInterfaceDescriptor* descriptor); |
| 2269 |
| 2270 private: |
| 2271 class FromBits: public BitField<ElementsKind, 0, 8> {}; |
| 2272 class ToBits: public BitField<ElementsKind, 8, 8> {}; |
| 2273 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
| 2274 class StoreModeBits: public BitField<KeyedAccessStoreMode, 17, 4> {}; |
| 2275 |
| 2276 Major MajorKey() { return ElementsTransitionAndStore; } |
| 2277 int NotMissMinorKey() { |
| 2278 return FromBits::encode(from_kind_) | |
| 2279 ToBits::encode(to_kind_) | |
| 2280 IsJSArrayBits::encode(is_jsarray_) | |
| 2281 StoreModeBits::encode(store_mode_); |
| 2282 } |
| 2283 |
| 2284 ElementsKind from_kind_; |
| 2285 ElementsKind to_kind_; |
| 2286 bool is_jsarray_; |
| 2287 KeyedAccessStoreMode store_mode_; |
| 2288 |
| 2289 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
| 2290 }; |
| 2291 |
| 2292 |
| 2293 // TODO(bmeurer) Remove this when compiled transitions is enabled |
| 2294 class ElementsTransitionAndStorePlatformStub : public PlatformCodeStub { |
| 2295 public: |
| 2296 ElementsTransitionAndStorePlatformStub(ElementsKind from, |
| 2297 ElementsKind to, |
| 2298 bool is_jsarray, |
| 2299 StrictModeFlag strict_mode, |
| 2300 KeyedAccessStoreMode store_mode) |
2255 : from_(from), | 2301 : from_(from), |
2256 to_(to), | 2302 to_(to), |
2257 is_jsarray_(is_jsarray), | 2303 is_jsarray_(is_jsarray), |
2258 strict_mode_(strict_mode), | 2304 strict_mode_(strict_mode), |
2259 store_mode_(store_mode) {} | 2305 store_mode_(store_mode) {} |
2260 | 2306 |
2261 private: | 2307 private: |
2262 class FromBits: public BitField<ElementsKind, 0, 8> {}; | 2308 class FromBits: public BitField<ElementsKind, 0, 8> {}; |
2263 class ToBits: public BitField<ElementsKind, 8, 8> {}; | 2309 class ToBits: public BitField<ElementsKind, 8, 8> {}; |
2264 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 2310 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
(...skipping 10 matching lines...) Expand all Loading... |
2275 } | 2321 } |
2276 | 2322 |
2277 void Generate(MacroAssembler* masm); | 2323 void Generate(MacroAssembler* masm); |
2278 | 2324 |
2279 ElementsKind from_; | 2325 ElementsKind from_; |
2280 ElementsKind to_; | 2326 ElementsKind to_; |
2281 bool is_jsarray_; | 2327 bool is_jsarray_; |
2282 StrictModeFlag strict_mode_; | 2328 StrictModeFlag strict_mode_; |
2283 KeyedAccessStoreMode store_mode_; | 2329 KeyedAccessStoreMode store_mode_; |
2284 | 2330 |
2285 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); | 2331 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStorePlatformStub); |
2286 }; | 2332 }; |
2287 | 2333 |
2288 | 2334 |
2289 class StoreArrayLiteralElementStub : public PlatformCodeStub { | 2335 class StoreArrayLiteralElementStub : public PlatformCodeStub { |
2290 public: | 2336 public: |
2291 StoreArrayLiteralElementStub() | 2337 StoreArrayLiteralElementStub() |
2292 : fp_registers_(CanUseFPRegisters()) { } | 2338 : fp_registers_(CanUseFPRegisters()) { } |
2293 | 2339 |
2294 private: | 2340 private: |
2295 class FPRegisters: public BitField<bool, 0, 1> {}; | 2341 class FPRegisters: public BitField<bool, 0, 1> {}; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2351 int MinorKey() { return 0; } | 2397 int MinorKey() { return 0; } |
2352 | 2398 |
2353 void Generate(MacroAssembler* masm); | 2399 void Generate(MacroAssembler* masm); |
2354 | 2400 |
2355 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2401 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
2356 }; | 2402 }; |
2357 | 2403 |
2358 } } // namespace v8::internal | 2404 } } // namespace v8::internal |
2359 | 2405 |
2360 #endif // V8_CODE_STUBS_H_ | 2406 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |