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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index e4cbe1863a2c117db9916c950c7f1ae9e924bcc9..ba3a275f21bf6c1bda1f2dc6697163bae9b6e556 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -84,7 +84,8 @@ namespace internal {
V(KeyedStoreElement) \
V(DebuggerStatement) \
V(NameDictionaryLookup) \
- V(ElementsTransitionAndStore) \
+ V(ElementsTransitionAndStoreStrict) \
+ V(ElementsTransitionAndStoreNonStrict) \
V(TransitionElementsKind) \
V(StoreArrayLiteralElement) \
V(StubFailureTrampoline) \
@@ -2210,7 +2211,7 @@ class ToBooleanStub: public HydrogenCodeStub {
};
-class ElementsTransitionAndStoreStub : public PlatformCodeStub {
+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.
public:
ElementsTransitionAndStoreStub(ElementsKind from,
ElementsKind to,
@@ -2221,26 +2222,43 @@ class ElementsTransitionAndStoreStub : public PlatformCodeStub {
to_(to),
is_jsarray_(is_jsarray),
strict_mode_(strict_mode),
- store_mode_(store_mode) {}
+ store_mode_(store_mode) {
+ ASSERT(!IsFastHoleyElementsKind(from) || IsFastHoleyElementsKind(to));
+ }
+
+ ElementsKind from() const { return from_; }
+ ElementsKind to() const { return to_; }
+ bool is_jsarray() const { return is_jsarray_; }
+ StrictModeFlag strict_mode() const { return strict_mode_; }
+ KeyedAccessStoreMode store_mode() const { return store_mode_; }
+
+ virtual Handle<Code> GenerateCode();
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
private:
- class FromBits: public BitField<ElementsKind, 0, 8> {};
- class ToBits: public BitField<ElementsKind, 8, 8> {};
- class IsJSArrayBits: public BitField<bool, 16, 1> {};
- class StrictModeBits: public BitField<StrictModeFlag, 17, 1> {};
+ class FromBits: public BitField<ElementsKind, 0, 8> {};
+ class ToBits: public BitField<ElementsKind, 8, 8> {};
+ class IsJSArrayBits: public BitField<bool, 16, 1> {};
class StoreModeBits: public BitField<KeyedAccessStoreMode, 18, 4> {};
- Major MajorKey() { return ElementsTransitionAndStore; }
- int MinorKey() {
+ Major MajorKey() {
+ switch (strict_mode_) {
+ case kNonStrictMode: return ElementsTransitionAndStoreNonStrict;
+ case kStrictMode: return ElementsTransitionAndStoreStrict;
+ }
+ UNREACHABLE();
+ return NoCache;
+ }
+ int NotMissMinorKey() {
return FromBits::encode(from_) |
ToBits::encode(to_) |
IsJSArrayBits::encode(is_jsarray_) |
- StrictModeBits::encode(strict_mode_) |
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.
}
- void Generate(MacroAssembler* masm);
-
ElementsKind from_;
ElementsKind to_;
bool is_jsarray_;

Powered by Google App Engine
This is Rietveld 408576698