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

Side by Side Diff: src/ic/ic-state.h

Issue 1151253004: VectorICs: Create a StoreICState to more easily create matching code stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Dumb compile error :P. Created 5 years, 7 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
« no previous file with comments | « src/ic/ic-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_IC_STATE_H_ 5 #ifndef V8_IC_STATE_H_
6 #define V8_IC_STATE_H_ 6 #define V8_IC_STATE_H_
7 7
8 #include "src/macro-assembler.h" 8 #include "src/macro-assembler.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 static ContextualMode GetContextualMode(ExtraICState state) { 217 static ContextualMode GetContextualMode(ExtraICState state) {
218 return LoadICState(state).contextual_mode(); 218 return LoadICState(state).contextual_mode();
219 } 219 }
220 220
221 private: 221 private:
222 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; 222 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {};
223 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); 223 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0);
224 224
225 const ExtraICState state_; 225 const ExtraICState state_;
226 }; 226 };
227
228
229 class StoreICState final BASE_EMBEDDED {
230 public:
231 explicit StoreICState(ExtraICState extra_ic_state) : state_(extra_ic_state) {}
232
233 explicit StoreICState(LanguageMode mode)
234 : state_(LanguageModeState::encode(mode)) {}
235
236 ExtraICState GetExtraICState() const { return state_; }
237
238 LanguageMode language_mode() const {
239 return LanguageModeState::decode(state_);
240 }
241
242 static LanguageMode GetLanguageMode(ExtraICState state) {
243 return StoreICState(state).language_mode();
244 }
245
246 class LanguageModeState : public BitField<LanguageMode, 1, 2> {};
247 STATIC_ASSERT(i::LANGUAGE_END == 3);
248
249 // For convenience, a statically declared encoding of strict mode extra
250 // IC state.
251 static const ExtraICState kStrictModeState = STRICT
252 << LanguageModeState::kShift;
253
254 private:
255 const ExtraICState state_;
256 };
227 } 257 }
228 } 258 }
229 259
230 #endif // V8_IC_STATE_H_ 260 #endif // V8_IC_STATE_H_
OLDNEW
« no previous file with comments | « src/ic/ic-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698