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

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

Issue 2113673002: [stubs]: Convert FastNewContext stub to turbofan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename based on feedback Created 4 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-stubs.cc ('k') | src/compiler/js-generic-lowering.cc » ('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 89987d5ebf0d5ea4060bee19637938c317a40f4b..643df2bd407eee70336664f753e66dd565887cfc 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -1924,61 +1924,6 @@ HValue* CodeStubGraphBuilder<ToObjectStub>::BuildCodeStub() {
Handle<Code> ToObjectStub::GenerateCode() { return DoGenerateCode(this); }
-template<>
-HValue* CodeStubGraphBuilder<FastNewContextStub>::BuildCodeStub() {
- int length = casted_stub()->slots() + Context::MIN_CONTEXT_SLOTS;
-
- // Get the function.
- HParameter* function = GetParameter(FastNewContextStub::kFunction);
-
- // Allocate the context in new space.
- HAllocate* function_context = Add<HAllocate>(
- Add<HConstant>(length * kPointerSize + FixedArray::kHeaderSize),
- HType::HeapObject(), NOT_TENURED, FIXED_ARRAY_TYPE,
- graph()->GetConstant0());
-
- // Set up the object header.
- AddStoreMapConstant(function_context,
- isolate()->factory()->function_context_map());
- Add<HStoreNamedField>(function_context,
- HObjectAccess::ForFixedArrayLength(),
- Add<HConstant>(length));
-
- // Set up the fixed slots.
- Add<HStoreNamedField>(function_context,
- HObjectAccess::ForContextSlot(Context::CLOSURE_INDEX),
- function);
- Add<HStoreNamedField>(function_context,
- HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX),
- context());
- Add<HStoreNamedField>(function_context,
- HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX),
- graph()->GetConstantHole());
-
- // Copy the native context from the previous context.
- HValue* native_context = Add<HLoadNamedField>(
- context(), nullptr,
- HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX));
- Add<HStoreNamedField>(function_context, HObjectAccess::ForContextSlot(
- Context::NATIVE_CONTEXT_INDEX),
- native_context);
-
- // Initialize the rest of the slots to undefined.
- for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) {
- Add<HStoreNamedField>(function_context,
- HObjectAccess::ForContextSlot(i),
- graph()->GetConstantUndefined());
- }
-
- return function_context;
-}
-
-
-Handle<Code> FastNewContextStub::GenerateCode() {
- return DoGenerateCode(this);
-}
-
-
template <>
HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() {
HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex);
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698