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

Side by Side Diff: src/factory.cc

Issue 10103035: Share optimized code for closures. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: rebased on r11394 Created 8 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 if (!function_info->bound()) { 553 if (!function_info->bound()) {
554 int number_of_literals = function_info->num_literals(); 554 int number_of_literals = function_info->num_literals();
555 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); 555 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
556 if (number_of_literals > 0) { 556 if (number_of_literals > 0) {
557 // Store the object, regexp and array functions in the literals 557 // Store the object, regexp and array functions in the literals
558 // array prefix. These functions will be used when creating 558 // array prefix. These functions will be used when creating
559 // object, regexp and array literals in this function. 559 // object, regexp and array literals in this function.
560 literals->set(JSFunction::kLiteralGlobalContextIndex, 560 literals->set(JSFunction::kLiteralGlobalContextIndex,
561 context->global_context()); 561 context->global_context());
562 } 562 }
563 result->set_literals(*literals); 563 result->set_literals(*literals);
fschneider 2012/04/20 14:05:43 Instead of always allocating a new literals array,
564 } 564 }
565
566 if (FLAG_cache_optimized_code) {
567 Code* code =
568 function_info->SearchOptimizedCodeMap(context->global_context());
569 if (code != NULL) {
570 result->ReplaceCode(code);
571 return result;
572 }
573 }
574 result->set_next_function_link(isolate()->heap()->undefined_value());
fschneider 2012/04/20 14:05:43 Not needed since next_function_link is already ini
575
565 if (V8::UseCrankshaft() && 576 if (V8::UseCrankshaft() &&
566 FLAG_always_opt && 577 FLAG_always_opt &&
567 result->is_compiled() && 578 result->is_compiled() &&
568 !function_info->is_toplevel() && 579 !function_info->is_toplevel() &&
569 function_info->allows_lazy_compilation() && 580 function_info->allows_lazy_compilation() &&
570 !function_info->optimization_disabled()) { 581 !function_info->optimization_disabled()) {
571 result->MarkForLazyRecompilation(); 582 result->MarkForLazyRecompilation();
572 } 583 }
573 return result; 584 return result;
574 } 585 }
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 1451
1441 1452
1442 Handle<Object> Factory::ToBoolean(bool value) { 1453 Handle<Object> Factory::ToBoolean(bool value) {
1443 return Handle<Object>(value 1454 return Handle<Object>(value
1444 ? isolate()->heap()->true_value() 1455 ? isolate()->heap()->true_value()
1445 : isolate()->heap()->false_value()); 1456 : isolate()->heap()->false_value());
1446 } 1457 }
1447 1458
1448 1459
1449 } } // namespace v8::internal 1460 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/flag-definitions.h » ('j') | src/ia32/lithium-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698