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

Unified Diff: src/code-stubs.h

Issue 587203002: ExtendStorageStub added, it is aimed for extending objects backing store when it runs out of space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 3 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 f9016f180b5b2aee5d33f7cbd4aec6607a23b1fb..8b6f109e17d070300c74a874553547c7bbf821f3 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -83,6 +83,7 @@ namespace internal {
V(LoadConstant) \
V(LoadField) \
V(StoreField) \
+ V(ExtendStorage) \
Yang 2014/09/29 11:10:38 Put this before LoadConstant please. We try to mai
Igor Sheludko 2014/09/29 12:33:11 Done.
V(StoreGlobal) \
V(StringLength)
@@ -981,6 +982,44 @@ class StoreFieldStub : public HandlerStub {
};
+// Extend storage is called in a store inline cache when
+// it is necessary to extend the properties array of a
+// JSObject.
+class ExtendStorageStub : public HandlerStub {
+ public:
+ ExtendStorageStub(Isolate* isolate, FieldIndex index,
+ Representation representation)
+ : HandlerStub(isolate) {
+ int property_index_key = index.GetFieldAccessStubKey();
+ uint8_t repr = PropertyDetails::EncodeRepresentation(representation);
+ set_sub_minor_key(StoreFieldByIndexBits::encode(property_index_key) |
+ RepresentationBits::encode(repr));
+ }
+
+ FieldIndex index() const {
+ int property_index_key = StoreFieldByIndexBits::decode(sub_minor_key());
+ return FieldIndex::FromFieldAccessStubKey(property_index_key);
+ }
+
+ Representation representation() {
+ uint8_t repr = RepresentationBits::decode(sub_minor_key());
+ return PropertyDetails::DecodeRepresentation(repr);
+ }
+
+ virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE;
+
+ protected:
+ virtual Code::Kind kind() const { return Code::STORE_IC; }
+ virtual Code::StubType GetStubType() { return Code::FAST; }
+
+ private:
+ class StoreFieldByIndexBits : public BitField<int, 0, 13> {};
+ class RepresentationBits : public BitField<uint8_t, 13, 4> {};
+
+ DEFINE_HANDLER_CODE_STUB(ExtendStorage, HandlerStub);
+};
+
+
class StoreGlobalStub : public HandlerStub {
public:
StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global)

Powered by Google App Engine
This is Rietveld 408576698