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

Unified Diff: src/compiler/js-context-specialization.cc

Issue 1451143005: [turbofan] Decouple inlining and native context specialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove misleading comment about MaybeHandle. Created 5 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/compiler/access-info.cc ('k') | src/compiler/js-global-object-specialization.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-context-specialization.cc
diff --git a/src/compiler/js-context-specialization.cc b/src/compiler/js-context-specialization.cc
index a4f3ff49864fd9815c6e47bf9265c343b09019fa..8bbfe1e9498ddf1750408b620e2ebfbe55b17c60 100644
--- a/src/compiler/js-context-specialization.cc
+++ b/src/compiler/js-context-specialization.cc
@@ -34,25 +34,7 @@ MaybeHandle<Context> JSContextSpecialization::GetSpecializationContext(
DCHECK(node->opcode() == IrOpcode::kJSLoadContext ||
node->opcode() == IrOpcode::kJSStoreContext);
Node* const object = NodeProperties::GetValueInput(node, 0);
- switch (object->opcode()) {
- case IrOpcode::kHeapConstant:
- return Handle<Context>::cast(OpParameter<Handle<HeapObject>>(object));
- case IrOpcode::kParameter: {
- Node* const start = NodeProperties::GetValueInput(object, 0);
- DCHECK_EQ(IrOpcode::kStart, start->opcode());
- int const index = ParameterIndexOf(object->op());
- // The context is always the last parameter to a JavaScript function, and
- // {Parameter} indices start at -1, so value outputs of {Start} look like
- // this: closure, receiver, param0, ..., paramN, context.
- if (index == start->op()->ValueOutputCount() - 2) {
- return context();
- }
- break;
- }
- default:
- break;
- }
- return MaybeHandle<Context>();
+ return NodeProperties::GetSpecializationContext(object, context());
}
« no previous file with comments | « src/compiler/access-info.cc ('k') | src/compiler/js-global-object-specialization.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698