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

Unified Diff: src/code-stubs.h

Issue 1224793002: Loads and stores to global vars are now made via property cell shortcuts installed into parent scri… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 5 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
« no previous file with comments | « src/code-factory.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 c06c6c1fe498b1a9daf9314017a54d0dcf89f659..b594ff4c2eb0147b624c0831bfb3780dea8d0b4d 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -78,6 +78,7 @@ namespace internal {
V(InternalArrayNoArgumentConstructor) \
V(InternalArraySingleArgumentConstructor) \
V(KeyedLoadGeneric) \
+ V(LoadGlobalViaContext) \
V(LoadScriptContextField) \
V(LoadDictionaryElement) \
V(NameDictionaryLookup) \
@@ -85,6 +86,7 @@ namespace internal {
V(Typeof) \
V(RegExpConstructResult) \
V(StoreFastElement) \
+ V(StoreGlobalViaContext) \
V(StoreScriptContextField) \
V(StringAdd) \
V(ToBoolean) \
@@ -1341,6 +1343,60 @@ class StoreGlobalStub : public HandlerStub {
};
+class LoadGlobalViaContextStub : public HydrogenCodeStub {
+ public:
+ // Use the loop version for depths higher than this one.
+ static const int kDynamicDepth = 7;
+
+ LoadGlobalViaContextStub(Isolate* isolate, int depth)
+ : HydrogenCodeStub(isolate) {
+ if (depth > kDynamicDepth) depth = kDynamicDepth;
+ set_sub_minor_key(DepthBits::encode(depth));
+ }
+
+ int depth() const { return DepthBits::decode(sub_minor_key()); }
+
+ private:
+ class DepthBits : public BitField<unsigned int, 0, 3> {};
+ STATIC_ASSERT(kDynamicDepth <= DepthBits::kMax);
+
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(LoadGlobalViaContext);
+ DEFINE_HYDROGEN_CODE_STUB(LoadGlobalViaContext, HydrogenCodeStub);
+};
+
+
+class StoreGlobalViaContextStub : public HydrogenCodeStub {
+ public:
+ // Use the loop version for depths higher than this one.
+ static const int kDynamicDepth = 7;
+
+ StoreGlobalViaContextStub(Isolate* isolate, int depth,
+ LanguageMode language_mode)
+ : HydrogenCodeStub(isolate) {
+ if (depth > kDynamicDepth) depth = kDynamicDepth;
+ set_sub_minor_key(DepthBits::encode(depth) |
+ LanguageModeBits::encode(language_mode));
+ }
+
+ int depth() const { return DepthBits::decode(sub_minor_key()); }
+
+ LanguageMode language_mode() const {
+ return LanguageModeBits::decode(sub_minor_key());
+ }
+
+ private:
+ class DepthBits : public BitField<unsigned int, 0, 4> {};
+ STATIC_ASSERT(kDynamicDepth <= DepthBits::kMax);
+
+ class LanguageModeBits : public BitField<LanguageMode, 4, 2> {};
+ STATIC_ASSERT(LANGUAGE_END == 3);
+
+ private:
+ DEFINE_CALL_INTERFACE_DESCRIPTOR(StoreGlobalViaContext);
+ DEFINE_HYDROGEN_CODE_STUB(StoreGlobalViaContext, HydrogenCodeStub);
+};
+
+
class CallApiFunctionStub : public PlatformCodeStub {
public:
explicit CallApiFunctionStub(Isolate* isolate, bool call_data_undefined)
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698