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

Side by Side Diff: src/hydrogen.cc

Issue 25622003: MIPS: 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 | « no previous file | src/mips/lithium-codegen-mips.cc » ('j') | 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 6348 matching lines...) Expand 10 before | Expand all | Expand 10 after
6359 int nodes_added = InliningAstSize(target); 6359 int nodes_added = InliningAstSize(target);
6360 if (nodes_added == kNotInlinable) return false; 6360 if (nodes_added == kNotInlinable) return false;
6361 6361
6362 Handle<JSFunction> caller = current_info()->closure(); 6362 Handle<JSFunction> caller = current_info()->closure();
6363 6363
6364 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) { 6364 if (nodes_added > Min(FLAG_max_inlined_nodes, kUnlimitedMaxInlinedNodes)) {
6365 TraceInline(target, caller, "target AST is too large [early]"); 6365 TraceInline(target, caller, "target AST is too large [early]");
6366 return false; 6366 return false;
6367 } 6367 }
6368 6368
6369 #if !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM 6369 #if !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS
6370 // Target must be able to use caller's context. 6370 // Target must be able to use caller's context.
6371 CompilationInfo* outer_info = current_info(); 6371 CompilationInfo* outer_info = current_info();
6372 if (target->context() != outer_info->closure()->context() || 6372 if (target->context() != outer_info->closure()->context() ||
6373 outer_info->scope()->contains_with() || 6373 outer_info->scope()->contains_with() ||
6374 outer_info->scope()->num_heap_slots() > 0) { 6374 outer_info->scope()->num_heap_slots() > 0) {
6375 TraceInline(target, caller, "target requires context change"); 6375 TraceInline(target, caller, "target requires context change");
6376 return false; 6376 return false;
6377 } 6377 }
6378 #endif 6378 #endif
6379 6379
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
6508 HConstant* undefined = graph()->GetConstantUndefined(); 6508 HConstant* undefined = graph()->GetConstantUndefined();
6509 bool undefined_receiver = HEnvironment::UseUndefinedReceiver( 6509 bool undefined_receiver = HEnvironment::UseUndefinedReceiver(
6510 target, function, call_kind, inlining_kind); 6510 target, function, call_kind, inlining_kind);
6511 HEnvironment* inner_env = 6511 HEnvironment* inner_env =
6512 environment()->CopyForInlining(target, 6512 environment()->CopyForInlining(target,
6513 arguments_count, 6513 arguments_count,
6514 function, 6514 function,
6515 undefined, 6515 undefined,
6516 function_state()->inlining_kind(), 6516 function_state()->inlining_kind(),
6517 undefined_receiver); 6517 undefined_receiver);
6518 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM 6518 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS
6519 // IA32 and ARM only, overwrite the caller's context in the deoptimization 6519 // IA32, ARM and MIPS only, overwrite the caller's context in the
6520 // environment with the correct one. 6520 // deoptimization environment with the correct one.
6521 // 6521 //
6522 // TODO(kmillikin): implement the same inlining on other platforms so we 6522 // TODO(kmillikin): implement the same inlining on other platforms so we
6523 // can remove the unsightly ifdefs in this function. 6523 // can remove the unsightly ifdefs in this function.
6524 HConstant* context = Add<HConstant>(Handle<Context>(target->context())); 6524 HConstant* context = Add<HConstant>(Handle<Context>(target->context()));
6525 inner_env->BindContext(context); 6525 inner_env->BindContext(context);
6526 #endif 6526 #endif
6527 6527
6528 Add<HSimulate>(return_id); 6528 Add<HSimulate>(return_id);
6529 current_block()->UpdateEnvironment(inner_env); 6529 current_block()->UpdateEnvironment(inner_env);
6530 HArgumentsObject* arguments_object = NULL; 6530 HArgumentsObject* arguments_object = NULL;
(...skipping 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after
9829 if (ShouldProduceTraceOutput()) { 9829 if (ShouldProduceTraceOutput()) {
9830 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9830 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9831 } 9831 }
9832 9832
9833 #ifdef DEBUG 9833 #ifdef DEBUG
9834 graph_->Verify(false); // No full verify. 9834 graph_->Verify(false); // No full verify.
9835 #endif 9835 #endif
9836 } 9836 }
9837 9837
9838 } } // namespace v8::internal 9838 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698