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

Side by Side Diff: src/hydrogen.cc

Issue 25247002: ARM: Allow function inlining with context change. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6365 matching lines...) Expand 10 before | Expand all | Expand 10 after
6376 int nodes_added = InliningAstSize(target); 6376 int nodes_added = InliningAstSize(target);
6377 if (nodes_added == kNotInlinable) return false; 6377 if (nodes_added == kNotInlinable) return false;
6378 6378
6379 Handle<JSFunction> caller = current_info()->closure(); 6379 Handle<JSFunction> caller = current_info()->closure();
6380 6380
6381 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) { 6381 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) {
6382 TraceInline(target, caller, "target AST is too large [early]"); 6382 TraceInline(target, caller, "target AST is too large [early]");
6383 return false; 6383 return false;
6384 } 6384 }
6385 6385
6386 #if !V8_TARGET_ARCH_IA32 6386 #if !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM
6387 // Target must be able to use caller's context. 6387 // Target must be able to use caller's context.
6388 CompilationInfo* outer_info = current_info(); 6388 CompilationInfo* outer_info = current_info();
6389 if (target->context() != outer_info->closure()->context() || 6389 if (target->context() != outer_info->closure()->context() ||
6390 outer_info->scope()->contains_with() || 6390 outer_info->scope()->contains_with() ||
6391 outer_info->scope()->num_heap_slots() > 0) { 6391 outer_info->scope()->num_heap_slots() > 0) {
6392 TraceInline(target, caller, "target requires context change"); 6392 TraceInline(target, caller, "target requires context change");
6393 return false; 6393 return false;
6394 } 6394 }
6395 #endif 6395 #endif
6396 6396
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
6525 HConstant* undefined = graph()->GetConstantUndefined(); 6525 HConstant* undefined = graph()->GetConstantUndefined();
6526 bool undefined_receiver = HEnvironment::UseUndefinedReceiver( 6526 bool undefined_receiver = HEnvironment::UseUndefinedReceiver(
6527 target, function, call_kind, inlining_kind); 6527 target, function, call_kind, inlining_kind);
6528 HEnvironment* inner_env = 6528 HEnvironment* inner_env =
6529 environment()->CopyForInlining(target, 6529 environment()->CopyForInlining(target,
6530 arguments_count, 6530 arguments_count,
6531 function, 6531 function,
6532 undefined, 6532 undefined,
6533 function_state()->inlining_kind(), 6533 function_state()->inlining_kind(),
6534 undefined_receiver); 6534 undefined_receiver);
6535 #if V8_TARGET_ARCH_IA32 6535 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM
6536 // IA32 only, overwrite the caller's context in the deoptimization 6536 // IA32 and ARM only, overwrite the caller's context in the deoptimization
6537 // environment with the correct one. 6537 // environment with the correct one.
6538 // 6538 //
6539 // TODO(kmillikin): implement the same inlining on other platforms so we 6539 // TODO(kmillikin): implement the same inlining on other platforms so we
6540 // can remove the unsightly ifdefs in this function. 6540 // can remove the unsightly ifdefs in this function.
6541 HConstant* context = Add<HConstant>(Handle<Context>(target->context())); 6541 HConstant* context = Add<HConstant>(Handle<Context>(target->context()));
6542 inner_env->BindContext(context); 6542 inner_env->BindContext(context);
6543 #endif 6543 #endif
6544 6544
6545 Add<HSimulate>(return_id); 6545 Add<HSimulate>(return_id);
6546 current_block()->UpdateEnvironment(inner_env); 6546 current_block()->UpdateEnvironment(inner_env);
(...skipping 3326 matching lines...) Expand 10 before | Expand all | Expand 10 after
9873 if (ShouldProduceTraceOutput()) { 9873 if (ShouldProduceTraceOutput()) {
9874 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9874 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9875 } 9875 }
9876 9876
9877 #ifdef DEBUG 9877 #ifdef DEBUG
9878 graph_->Verify(false); // No full verify. 9878 graph_->Verify(false); // No full verify.
9879 #endif 9879 #endif
9880 } 9880 }
9881 9881
9882 } } // namespace v8::internal 9882 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698