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

Unified Diff: src/code-stubs.h

Issue 9310117: Implement KeyedStoreICs to grow arrays on out-of-bound stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing WB stub Created 8 years, 10 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
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 78ff554fdb6d187b14ca4c3b5829b5ad2242f3d6..1fd36a7e15629c99ccfa3e9e6953733ba74d2fa3 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -985,20 +985,29 @@ class KeyedLoadElementStub : public CodeStub {
class KeyedStoreElementStub : public CodeStub {
public:
KeyedStoreElementStub(bool is_js_array,
- ElementsKind elements_kind)
- : is_js_array_(is_js_array),
- elements_kind_(elements_kind) { }
+ ElementsKind elements_kind,
+ KeyedAccessGrowMode grow_mode)
+ : is_js_array_(is_js_array),
+ elements_kind_(elements_kind),
+ grow_mode_(grow_mode) { }
Major MajorKey() { return KeyedStoreElement; }
int MinorKey() {
- return (is_js_array_ ? 0 : kElementsKindCount) + elements_kind_;
+ return ElementsKindBits::encode(elements_kind_) |
+ IsJSArrayBits::encode(is_js_array_) |
+ GrowModeBits::encode(grow_mode_);
}
void Generate(MacroAssembler* masm);
private:
+ class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
+ class GrowModeBits: public BitField<KeyedAccessGrowMode, 8, 1> {};
+ class IsJSArrayBits: public BitField<bool, 9, 1> {};
+
bool is_js_array_;
ElementsKind elements_kind_;
+ KeyedAccessGrowMode grow_mode_;
DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub);
};
@@ -1076,24 +1085,28 @@ class ElementsTransitionAndStoreStub : public CodeStub {
ElementsTransitionAndStoreStub(ElementsKind from,
ElementsKind to,
bool is_jsarray,
- StrictModeFlag strict_mode)
+ StrictModeFlag strict_mode,
+ KeyedAccessGrowMode grow_mode)
: from_(from),
to_(to),
is_jsarray_(is_jsarray),
- strict_mode_(strict_mode) {}
+ strict_mode_(strict_mode),
+ grow_mode_(grow_mode) {}
private:
- class FromBits: public BitField<ElementsKind, 0, 8> {};
- class ToBits: public BitField<ElementsKind, 8, 8> {};
- class IsJSArrayBits: public BitField<bool, 16, 8> {};
- class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {};
+ 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 GrowModeBits: public BitField<KeyedAccessGrowMode, 18, 1> {};
Major MajorKey() { return ElementsTransitionAndStore; }
int MinorKey() {
return FromBits::encode(from_) |
ToBits::encode(to_) |
IsJSArrayBits::encode(is_jsarray_) |
- StrictModeBits::encode(strict_mode_);
+ StrictModeBits::encode(strict_mode_) |
+ GrowModeBits::encode(grow_mode_);
}
void Generate(MacroAssembler* masm);
@@ -1102,6 +1115,7 @@ class ElementsTransitionAndStoreStub : public CodeStub {
ElementsKind to_;
bool is_jsarray_;
StrictModeFlag strict_mode_;
+ KeyedAccessGrowMode grow_mode_;
DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub);
};
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698