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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 Major MajorKey() { return ToBoolean; } | 2203 Major MajorKey() { return ToBoolean; } |
2204 int NotMissMinorKey() { return GetExtraICState(); } | 2204 int NotMissMinorKey() { return GetExtraICState(); } |
2205 | 2205 |
2206 explicit ToBooleanStub(InitializationState init_state) : | 2206 explicit ToBooleanStub(InitializationState init_state) : |
2207 HydrogenCodeStub(init_state) {} | 2207 HydrogenCodeStub(init_state) {} |
2208 | 2208 |
2209 Types types_; | 2209 Types types_; |
2210 }; | 2210 }; |
2211 | 2211 |
2212 | 2212 |
2213 class ElementsTransitionAndStoreStub : public PlatformCodeStub { | 2213 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
2214 public: | 2214 public: |
2215 ElementsTransitionAndStoreStub(ElementsKind from, | 2215 ElementsTransitionAndStoreStub(ElementsKind from, |
2216 ElementsKind to, | 2216 ElementsKind to, |
2217 bool is_jsarray, | 2217 bool is_jsarray, |
2218 StrictModeFlag strict_mode, | |
2219 KeyedAccessStoreMode store_mode) | 2218 KeyedAccessStoreMode store_mode) |
2220 : from_(from), | 2219 : from_(from), |
2221 to_(to), | 2220 to_(to), |
2222 is_jsarray_(is_jsarray), | 2221 is_jsarray_(is_jsarray), |
2223 strict_mode_(strict_mode), | 2222 store_mode_(store_mode) { |
2224 store_mode_(store_mode) {} | 2223 ASSERT(!IsFastHoleyElementsKind(from) || IsFastHoleyElementsKind(to)); |
| 2224 } |
| 2225 |
| 2226 ElementsKind from() const { return from_; } |
| 2227 ElementsKind to() const { return to_; } |
| 2228 bool is_jsarray() const { return is_jsarray_; } |
| 2229 KeyedAccessStoreMode store_mode() const { return store_mode_; } |
| 2230 |
| 2231 Handle<Code> GenerateCode(); |
| 2232 |
| 2233 void InitializeInterfaceDescriptor( |
| 2234 Isolate* isolate, |
| 2235 CodeStubInterfaceDescriptor* descriptor); |
2225 | 2236 |
2226 private: | 2237 private: |
2227 class FromBits: public BitField<ElementsKind, 0, 8> {}; | 2238 class FromBits: public BitField<ElementsKind, 0, 8> {}; |
2228 class ToBits: public BitField<ElementsKind, 8, 8> {}; | 2239 class ToBits: public BitField<ElementsKind, 8, 8> {}; |
2229 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 2240 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
2230 class StrictModeBits: public BitField<StrictModeFlag, 17, 1> {}; | 2241 class StoreModeBits: public BitField<KeyedAccessStoreMode, 17, 4> {}; |
2231 class StoreModeBits: public BitField<KeyedAccessStoreMode, 18, 4> {}; | |
2232 | 2242 |
2233 Major MajorKey() { return ElementsTransitionAndStore; } | 2243 Major MajorKey() { return ElementsTransitionAndStore; } |
2234 int MinorKey() { | 2244 int NotMissMinorKey() { |
2235 return FromBits::encode(from_) | | 2245 return FromBits::encode(from()) | |
2236 ToBits::encode(to_) | | 2246 ToBits::encode(to()) | |
2237 IsJSArrayBits::encode(is_jsarray_) | | 2247 IsJSArrayBits::encode(is_jsarray()) | |
2238 StrictModeBits::encode(strict_mode_) | | 2248 StoreModeBits::encode(store_mode()); |
2239 StoreModeBits::encode(store_mode_); | |
2240 } | 2249 } |
2241 | 2250 |
2242 void Generate(MacroAssembler* masm); | |
2243 | |
2244 ElementsKind from_; | 2251 ElementsKind from_; |
2245 ElementsKind to_; | 2252 ElementsKind to_; |
2246 bool is_jsarray_; | 2253 bool is_jsarray_; |
2247 StrictModeFlag strict_mode_; | |
2248 KeyedAccessStoreMode store_mode_; | 2254 KeyedAccessStoreMode store_mode_; |
2249 | 2255 |
2250 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); | 2256 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
2251 }; | 2257 }; |
2252 | 2258 |
2253 | 2259 |
2254 class StoreArrayLiteralElementStub : public PlatformCodeStub { | 2260 class StoreArrayLiteralElementStub : public PlatformCodeStub { |
2255 public: | 2261 public: |
2256 StoreArrayLiteralElementStub() | 2262 StoreArrayLiteralElementStub() |
2257 : fp_registers_(CanUseFPRegisters()) { } | 2263 : fp_registers_(CanUseFPRegisters()) { } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 int MinorKey() { return 0; } | 2322 int MinorKey() { return 0; } |
2317 | 2323 |
2318 void Generate(MacroAssembler* masm); | 2324 void Generate(MacroAssembler* masm); |
2319 | 2325 |
2320 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2326 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
2321 }; | 2327 }; |
2322 | 2328 |
2323 } } // namespace v8::internal | 2329 } } // namespace v8::internal |
2324 | 2330 |
2325 #endif // V8_CODE_STUBS_H_ | 2331 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |