Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 V(KeyedLoadElement) \ | 77 V(KeyedLoadElement) \ |
| 78 V(ArrayNoArgumentConstructor) \ | 78 V(ArrayNoArgumentConstructor) \ |
| 79 V(ArraySingleArgumentConstructor) \ | 79 V(ArraySingleArgumentConstructor) \ |
| 80 V(ArrayNArgumentsConstructor) \ | 80 V(ArrayNArgumentsConstructor) \ |
| 81 V(InternalArrayNoArgumentConstructor) \ | 81 V(InternalArrayNoArgumentConstructor) \ |
| 82 V(InternalArraySingleArgumentConstructor) \ | 82 V(InternalArraySingleArgumentConstructor) \ |
| 83 V(InternalArrayNArgumentsConstructor) \ | 83 V(InternalArrayNArgumentsConstructor) \ |
| 84 V(KeyedStoreElement) \ | 84 V(KeyedStoreElement) \ |
| 85 V(DebuggerStatement) \ | 85 V(DebuggerStatement) \ |
| 86 V(NameDictionaryLookup) \ | 86 V(NameDictionaryLookup) \ |
| 87 V(ElementsTransitionAndStore) \ | 87 V(ElementsTransitionAndStoreStrict) \ |
| 88 V(ElementsTransitionAndStoreNonStrict) \ | |
|
danno
2013/07/10 12:33:44
I had another look at KeyedStoreIC_Miss and KeyedS
Benedikt Meurer
2013/07/10 13:23:45
Done.
| |
| 88 V(TransitionElementsKind) \ | 89 V(TransitionElementsKind) \ |
| 89 V(StoreArrayLiteralElement) \ | 90 V(StoreArrayLiteralElement) \ |
| 90 V(StubFailureTrampoline) \ | 91 V(StubFailureTrampoline) \ |
| 91 V(ArrayConstructor) \ | 92 V(ArrayConstructor) \ |
| 92 V(InternalArrayConstructor) \ | 93 V(InternalArrayConstructor) \ |
| 93 V(ProfileEntryHook) \ | 94 V(ProfileEntryHook) \ |
| 94 V(StoreGlobal) \ | 95 V(StoreGlobal) \ |
| 95 /* IC Handler stubs */ \ | 96 /* IC Handler stubs */ \ |
| 96 V(LoadField) \ | 97 V(LoadField) \ |
| 97 V(KeyedLoadField) | 98 V(KeyedLoadField) |
| (...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2203 Major MajorKey() { return ToBoolean; } | 2204 Major MajorKey() { return ToBoolean; } |
| 2204 int NotMissMinorKey() { return GetExtraICState(); } | 2205 int NotMissMinorKey() { return GetExtraICState(); } |
| 2205 | 2206 |
| 2206 explicit ToBooleanStub(InitializationState init_state) : | 2207 explicit ToBooleanStub(InitializationState init_state) : |
| 2207 HydrogenCodeStub(init_state) {} | 2208 HydrogenCodeStub(init_state) {} |
| 2208 | 2209 |
| 2209 Types types_; | 2210 Types types_; |
| 2210 }; | 2211 }; |
| 2211 | 2212 |
| 2212 | 2213 |
| 2213 class ElementsTransitionAndStoreStub : public PlatformCodeStub { | 2214 class ElementsTransitionAndStoreStub : public HydrogenCodeStub { |
| 2214 public: | 2215 public: |
| 2216 ElementsKind from() const { return from_; } | |
| 2217 ElementsKind to() const { return to_; } | |
| 2218 bool is_jsarray() const { return is_jsarray_; } | |
| 2219 KeyedAccessStoreMode store_mode() const { return store_mode_; } | |
| 2220 | |
| 2221 Handle<Code> GenerateCode(); | |
| 2222 | |
| 2223 void InitializeInterfaceDescriptor( | |
| 2224 Isolate* isolate, | |
| 2225 CodeStubInterfaceDescriptor* descriptor); | |
| 2226 | |
| 2227 protected: | |
| 2215 ElementsTransitionAndStoreStub(ElementsKind from, | 2228 ElementsTransitionAndStoreStub(ElementsKind from, |
| 2216 ElementsKind to, | 2229 ElementsKind to, |
| 2217 bool is_jsarray, | 2230 bool is_jsarray, |
| 2218 StrictModeFlag strict_mode, | |
| 2219 KeyedAccessStoreMode store_mode) | 2231 KeyedAccessStoreMode store_mode) |
| 2220 : from_(from), | 2232 : from_(from), |
| 2221 to_(to), | 2233 to_(to), |
| 2222 is_jsarray_(is_jsarray), | 2234 is_jsarray_(is_jsarray), |
| 2223 strict_mode_(strict_mode), | 2235 store_mode_(store_mode) { |
| 2224 store_mode_(store_mode) {} | 2236 ASSERT(!IsFastHoleyElementsKind(from) || IsFastHoleyElementsKind(to)); |
| 2237 } | |
| 2238 | |
| 2239 virtual Address GetDeoptimizationHandler() const = 0; | |
| 2225 | 2240 |
| 2226 private: | 2241 private: |
| 2227 class FromBits: public BitField<ElementsKind, 0, 8> {}; | 2242 class FromBits: public BitField<ElementsKind, 0, 8> {}; |
| 2228 class ToBits: public BitField<ElementsKind, 8, 8> {}; | 2243 class ToBits: public BitField<ElementsKind, 8, 8> {}; |
| 2229 class IsJSArrayBits: public BitField<bool, 16, 1> {}; | 2244 class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
| 2230 class StrictModeBits: public BitField<StrictModeFlag, 17, 1> {}; | |
| 2231 class StoreModeBits: public BitField<KeyedAccessStoreMode, 18, 4> {}; | 2245 class StoreModeBits: public BitField<KeyedAccessStoreMode, 18, 4> {}; |
| 2232 | 2246 |
| 2233 Major MajorKey() { return ElementsTransitionAndStore; } | 2247 int NotMissMinorKey() { |
| 2234 int MinorKey() { | 2248 return FromBits::encode(from()) | |
| 2235 return FromBits::encode(from_) | | 2249 ToBits::encode(to()) | |
| 2236 ToBits::encode(to_) | | 2250 IsJSArrayBits::encode(is_jsarray()) | |
| 2237 IsJSArrayBits::encode(is_jsarray_) | | 2251 StoreModeBits::encode(store_mode()); |
| 2238 StrictModeBits::encode(strict_mode_) | | |
| 2239 StoreModeBits::encode(store_mode_); | |
| 2240 } | 2252 } |
| 2241 | 2253 |
| 2242 void Generate(MacroAssembler* masm); | |
| 2243 | |
| 2244 ElementsKind from_; | 2254 ElementsKind from_; |
| 2245 ElementsKind to_; | 2255 ElementsKind to_; |
| 2246 bool is_jsarray_; | 2256 bool is_jsarray_; |
| 2247 StrictModeFlag strict_mode_; | |
| 2248 KeyedAccessStoreMode store_mode_; | 2257 KeyedAccessStoreMode store_mode_; |
| 2249 | 2258 |
| 2250 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); | 2259 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
| 2251 }; | 2260 }; |
| 2252 | 2261 |
| 2253 | 2262 |
| 2263 class ElementsTransitionAndStoreNonStrictStub | |
| 2264 : public ElementsTransitionAndStoreStub { | |
| 2265 public: | |
| 2266 ElementsTransitionAndStoreNonStrictStub(ElementsKind from, | |
| 2267 ElementsKind to, | |
| 2268 bool is_jsarray, | |
| 2269 KeyedAccessStoreMode store_mode) | |
| 2270 : ElementsTransitionAndStoreStub(from, to, is_jsarray, store_mode) { } | |
| 2271 | |
| 2272 private: | |
| 2273 Address GetDeoptimizationHandler() const { | |
| 2274 return Runtime::FunctionForId( | |
| 2275 Runtime::kElementsTransitionAndStoreNonStrict)->entry; | |
| 2276 } | |
| 2277 | |
| 2278 Major MajorKey() { return ElementsTransitionAndStoreNonStrict; } | |
| 2279 | |
| 2280 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreNonStrictStub); | |
| 2281 }; | |
| 2282 | |
| 2283 | |
| 2284 class ElementsTransitionAndStoreStrictStub | |
| 2285 : public ElementsTransitionAndStoreStub { | |
| 2286 public: | |
| 2287 ElementsTransitionAndStoreStrictStub(ElementsKind from, | |
| 2288 ElementsKind to, | |
| 2289 bool is_jsarray, | |
| 2290 KeyedAccessStoreMode store_mode) | |
| 2291 : ElementsTransitionAndStoreStub(from, to, is_jsarray, store_mode) { } | |
| 2292 | |
| 2293 private: | |
| 2294 Address GetDeoptimizationHandler() const { | |
| 2295 return Runtime::FunctionForId( | |
| 2296 Runtime::kElementsTransitionAndStoreStrict)->entry; | |
| 2297 } | |
| 2298 | |
| 2299 Major MajorKey() { return ElementsTransitionAndStoreStrict; } | |
| 2300 | |
| 2301 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStrictStub); | |
| 2302 }; | |
| 2303 | |
| 2304 | |
| 2254 class StoreArrayLiteralElementStub : public PlatformCodeStub { | 2305 class StoreArrayLiteralElementStub : public PlatformCodeStub { |
| 2255 public: | 2306 public: |
| 2256 StoreArrayLiteralElementStub() | 2307 StoreArrayLiteralElementStub() |
| 2257 : fp_registers_(CanUseFPRegisters()) { } | 2308 : fp_registers_(CanUseFPRegisters()) { } |
| 2258 | 2309 |
| 2259 private: | 2310 private: |
| 2260 class FPRegisters: public BitField<bool, 0, 1> {}; | 2311 class FPRegisters: public BitField<bool, 0, 1> {}; |
| 2261 | 2312 |
| 2262 Major MajorKey() { return StoreArrayLiteralElement; } | 2313 Major MajorKey() { return StoreArrayLiteralElement; } |
| 2263 int MinorKey() { return FPRegisters::encode(fp_registers_); } | 2314 int MinorKey() { return FPRegisters::encode(fp_registers_); } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2316 int MinorKey() { return 0; } | 2367 int MinorKey() { return 0; } |
| 2317 | 2368 |
| 2318 void Generate(MacroAssembler* masm); | 2369 void Generate(MacroAssembler* masm); |
| 2319 | 2370 |
| 2320 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2371 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 2321 }; | 2372 }; |
| 2322 | 2373 |
| 2323 } } // namespace v8::internal | 2374 } } // namespace v8::internal |
| 2324 | 2375 |
| 2325 #endif // V8_CODE_STUBS_H_ | 2376 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |