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

Unified Diff: src/compiler/node-properties.cc

Issue 2406803002: [turbofan] Enforce native context specialization. (Closed)
Patch Set: Remove unused variables Created 4 years, 2 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/compiler/node-properties.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-properties.cc
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc
index afed6347e5b87c576d215dd4dc696eeb641ceae3..646dbc209e4524a2a6fe61c769541181648f8488 100644
--- a/src/compiler/node-properties.cc
+++ b/src/compiler/node-properties.cc
@@ -338,76 +338,6 @@ MaybeHandle<Context> NodeProperties::GetSpecializationContext(
// static
-MaybeHandle<Context> NodeProperties::GetSpecializationNativeContext(
- Node* node, MaybeHandle<Context> native_context) {
- while (true) {
- switch (node->opcode()) {
- case IrOpcode::kJSLoadContext: {
- ContextAccess const& access = ContextAccessOf(node->op());
- if (access.index() != Context::NATIVE_CONTEXT_INDEX) {
- return MaybeHandle<Context>();
- }
- // Skip over the intermediate contexts, we're only interested in the
- // very last context in the context chain anyway.
- node = NodeProperties::GetContextInput(node);
- break;
- }
- case IrOpcode::kJSCreateBlockContext:
- case IrOpcode::kJSCreateCatchContext:
- case IrOpcode::kJSCreateFunctionContext:
- case IrOpcode::kJSCreateScriptContext:
- case IrOpcode::kJSCreateWithContext: {
- // Skip over the intermediate contexts, we're only interested in the
- // very last context in the context chain anyway.
- node = NodeProperties::GetContextInput(node);
- break;
- }
- case IrOpcode::kHeapConstant: {
- // Extract the native context from the actual {context}.
- Handle<Context> context =
- Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node));
- return handle(context->native_context());
- }
- case IrOpcode::kOsrGuard: {
- Node* osr_value = node->InputAt(0);
- DCHECK_EQ(IrOpcode::kOsrValue, osr_value->opcode());
- int const index = OsrValueIndexOf(osr_value->op());
- if (index == Linkage::kOsrContextSpillSlotIndex) {
- return native_context;
- }
- return MaybeHandle<Context>();
- }
- case IrOpcode::kParameter: {
- Node* const start = NodeProperties::GetValueInput(node, 0);
- DCHECK_EQ(IrOpcode::kStart, start->opcode());
- int const index = ParameterIndexOf(node->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 native_context;
- }
- return MaybeHandle<Context>();
- }
- default:
- return MaybeHandle<Context>();
- }
- }
-}
-
-
-// static
-MaybeHandle<JSGlobalObject> NodeProperties::GetSpecializationGlobalObject(
- Node* node, MaybeHandle<Context> native_context) {
- Handle<Context> context;
- if (GetSpecializationNativeContext(node, native_context).ToHandle(&context)) {
- return handle(context->global_object());
- }
- return MaybeHandle<JSGlobalObject>();
-}
-
-
-// static
Type* NodeProperties::GetTypeOrAny(Node* node) {
return IsTyped(node) ? node->type() : Type::Any();
}
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698