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

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

Issue 18881004: Turn ElementsTransitionAndStore stub into a HydrogenCodeStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
OLDNEW
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
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) \
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
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 {
danno 2013/07/10 09:52:37 I kind of like the existing invariant that each st
Benedikt Meurer 2013/07/10 12:23:09 Done.
2214 public: 2215 public:
2215 ElementsTransitionAndStoreStub(ElementsKind from, 2216 ElementsTransitionAndStoreStub(ElementsKind from,
2216 ElementsKind to, 2217 ElementsKind to,
2217 bool is_jsarray, 2218 bool is_jsarray,
2218 StrictModeFlag strict_mode, 2219 StrictModeFlag strict_mode,
2219 KeyedAccessStoreMode store_mode) 2220 KeyedAccessStoreMode store_mode)
2220 : from_(from), 2221 : from_(from),
2221 to_(to), 2222 to_(to),
2222 is_jsarray_(is_jsarray), 2223 is_jsarray_(is_jsarray),
2223 strict_mode_(strict_mode), 2224 strict_mode_(strict_mode),
2224 store_mode_(store_mode) {} 2225 store_mode_(store_mode) {
2226 ASSERT(!IsFastHoleyElementsKind(from) || IsFastHoleyElementsKind(to));
2227 }
2228
2229 ElementsKind from() const { return from_; }
2230 ElementsKind to() const { return to_; }
2231 bool is_jsarray() const { return is_jsarray_; }
2232 StrictModeFlag strict_mode() const { return strict_mode_; }
2233 KeyedAccessStoreMode store_mode() const { return store_mode_; }
2234
2235 virtual Handle<Code> GenerateCode();
2236
2237 virtual void InitializeInterfaceDescriptor(
2238 Isolate* isolate,
2239 CodeStubInterfaceDescriptor* descriptor);
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 Major MajorKey() {
2234 int MinorKey() { 2248 switch (strict_mode_) {
2249 case kNonStrictMode: return ElementsTransitionAndStoreNonStrict;
2250 case kStrictMode: return ElementsTransitionAndStoreStrict;
2251 }
2252 UNREACHABLE();
2253 return NoCache;
2254 }
2255 int NotMissMinorKey() {
2235 return FromBits::encode(from_) | 2256 return FromBits::encode(from_) |
2236 ToBits::encode(to_) | 2257 ToBits::encode(to_) |
2237 IsJSArrayBits::encode(is_jsarray_) | 2258 IsJSArrayBits::encode(is_jsarray_) |
2238 StrictModeBits::encode(strict_mode_) |
2239 StoreModeBits::encode(store_mode_); 2259 StoreModeBits::encode(store_mode_);
danno 2013/07/10 09:52:37 If you choose to do it this way, use the accessor
Benedikt Meurer 2013/07/10 12:23:09 Done.
2240 } 2260 }
2241 2261
2242 void Generate(MacroAssembler* masm);
2243
2244 ElementsKind from_; 2262 ElementsKind from_;
2245 ElementsKind to_; 2263 ElementsKind to_;
2246 bool is_jsarray_; 2264 bool is_jsarray_;
2247 StrictModeFlag strict_mode_; 2265 StrictModeFlag strict_mode_;
2248 KeyedAccessStoreMode store_mode_; 2266 KeyedAccessStoreMode store_mode_;
2249 2267
2250 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); 2268 DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub);
2251 }; 2269 };
2252 2270
2253 2271
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 int MinorKey() { return 0; } 2334 int MinorKey() { return 0; }
2317 2335
2318 void Generate(MacroAssembler* masm); 2336 void Generate(MacroAssembler* masm);
2319 2337
2320 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 2338 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
2321 }; 2339 };
2322 2340
2323 } } // namespace v8::internal 2341 } } // namespace v8::internal
2324 2342
2325 #endif // V8_CODE_STUBS_H_ 2343 #endif // V8_CODE_STUBS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698