Index: src/code-stubs-hydrogen.cc |
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
index 225e00f5a49daf4ddebd84734bbc0946b5891661..e2c412071dca6932aca0892d323fe453c9fc0c21 100644 |
--- a/src/code-stubs-hydrogen.cc |
+++ b/src/code-stubs-hydrogen.cc |
@@ -536,6 +536,30 @@ Handle<Code> LoadGlobalContextFieldStub::GenerateCode() { |
template <> |
+HValue* CodeStubGraphBuilder<StoreGlobalContextFieldStub>::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)); |
Igor Sheludko
2014/11/11 14:17:06
I think it is worth adding BuildGetGlobalContext()
Dmitry Lomov (no reviews)
2014/11/11 15:15:25
Done.
|
+ 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), |