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

Side by Side Diff: src/factory.cc

Issue 6793013: Cache optimized code on shared function info. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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/deoptimizer.h ('k') | src/flag-definitions.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 int number_of_literals = function_info->num_literals(); 437 int number_of_literals = function_info->num_literals();
438 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); 438 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
439 if (number_of_literals > 0) { 439 if (number_of_literals > 0) {
440 // Store the object, regexp and array functions in the literals 440 // Store the object, regexp and array functions in the literals
441 // array prefix. These functions will be used when creating 441 // array prefix. These functions will be used when creating
442 // object, regexp and array literals in this function. 442 // object, regexp and array literals in this function.
443 literals->set(JSFunction::kLiteralGlobalContextIndex, 443 literals->set(JSFunction::kLiteralGlobalContextIndex,
444 context->global_context()); 444 context->global_context());
445 } 445 }
446 result->set_literals(*literals); 446 result->set_literals(*literals);
447 if (FLAG_cache_optimized_code) {
448 Code* code =
449 function_info->SearchOptimizedCodeMap(context->global_context());
450 if (code != NULL) {
451 result->ReplaceCode(code);
452 return result;
453 }
454 }
447 result->set_next_function_link(isolate()->heap()->undefined_value()); 455 result->set_next_function_link(isolate()->heap()->undefined_value());
448 456
449 if (V8::UseCrankshaft() && 457 if (V8::UseCrankshaft() &&
450 FLAG_always_opt && 458 FLAG_always_opt &&
451 result->is_compiled() && 459 result->is_compiled() &&
452 !function_info->is_toplevel() && 460 !function_info->is_toplevel() &&
453 function_info->allows_lazy_compilation()) { 461 function_info->allows_lazy_compilation()) {
454 result->MarkForLazyRecompilation(); 462 result->MarkForLazyRecompilation();
455 } 463 }
456 return result; 464 return result;
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 Execution::ConfigureInstance(instance, 1193 Execution::ConfigureInstance(instance,
1186 instance_template, 1194 instance_template,
1187 pending_exception); 1195 pending_exception);
1188 } else { 1196 } else {
1189 *pending_exception = false; 1197 *pending_exception = false;
1190 } 1198 }
1191 } 1199 }
1192 1200
1193 1201
1194 } } // namespace v8::internal 1202 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698