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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 712973002: harmony-scoping: Implement StoreIC handler for stores to global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments + rebased Created 6 years, 1 month 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-stubs.h ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 225e00f5a49daf4ddebd84734bbc0946b5891661..e33b4a8438eaafcc8baccb0e533fcbab2dacab8f 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -518,13 +518,7 @@ HValue* CodeStubGraphBuilder<LoadGlobalContextFieldStub>::BuildCodeStub() {
int context_index = casted_stub()->context_index();
int slot_index = casted_stub()->slot_index();
- HValue* native_context = BuildGetNativeContext();
- HValue* global_context_table = Add<HLoadNamedField>(
- native_context, static_cast<HValue*>(NULL),
- HObjectAccess::ForContextSlot(Context::GLOBAL_CONTEXT_TABLE_INDEX));
- HValue* global_context =
- Add<HLoadNamedField>(global_context_table, static_cast<HValue*>(NULL),
- HObjectAccess::ForGlobalContext(context_index));
+ HValue* global_context = BuildGetGlobalContext(context_index);
return Add<HLoadNamedField>(global_context, static_cast<HValue*>(NULL),
HObjectAccess::ForContextSlot(slot_index));
}
@@ -536,6 +530,24 @@ Handle<Code> LoadGlobalContextFieldStub::GenerateCode() {
template <>
+HValue* CodeStubGraphBuilder<StoreGlobalContextFieldStub>::BuildCodeStub() {
+ int context_index = casted_stub()->context_index();
+ int slot_index = casted_stub()->slot_index();
+
+ HValue* global_context = BuildGetGlobalContext(context_index);
+ Add<HStoreNamedField>(global_context,
+ HObjectAccess::ForContextSlot(slot_index),
+ GetParameter(2), STORE_TO_INITIALIZED_ENTRY);
+ return GetParameter(2);
+}
+
+
+Handle<Code> StoreGlobalContextFieldStub::GenerateCode() {
+ return DoGenerateCode(this);
+}
+
+
+template <>
HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() {
HInstruction* load = BuildUncheckedMonomorphicElementAccess(
GetParameter(LoadDescriptor::kReceiverIndex),
« no previous file with comments | « src/code-stubs.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698