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

Side by Side Diff: src/factory.cc

Issue 9836091: Reset function info counters after context disposal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment 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
« no previous file with comments | « src/compiler.cc ('k') | src/heap.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 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 Handle<SharedFunctionInfo> function_info, 530 Handle<SharedFunctionInfo> function_info,
531 Handle<Context> context, 531 Handle<Context> context,
532 PretenureFlag pretenure) { 532 PretenureFlag pretenure) {
533 Handle<JSFunction> result = BaseNewFunctionFromSharedFunctionInfo( 533 Handle<JSFunction> result = BaseNewFunctionFromSharedFunctionInfo(
534 function_info, 534 function_info,
535 function_info->is_classic_mode() 535 function_info->is_classic_mode()
536 ? isolate()->function_map() 536 ? isolate()->function_map()
537 : isolate()->strict_mode_function_map(), 537 : isolate()->strict_mode_function_map(),
538 pretenure); 538 pretenure);
539 539
540 if (function_info->ic_age() != isolate()->heap()->global_ic_age()) {
541 function_info->ResetForNewContext(isolate()->heap()->global_ic_age());
542 }
543
540 result->set_context(*context); 544 result->set_context(*context);
541 if (!function_info->bound()) { 545 if (!function_info->bound()) {
542 int number_of_literals = function_info->num_literals(); 546 int number_of_literals = function_info->num_literals();
543 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure); 547 Handle<FixedArray> literals = NewFixedArray(number_of_literals, pretenure);
544 if (number_of_literals > 0) { 548 if (number_of_literals > 0) {
545 // Store the object, regexp and array functions in the literals 549 // Store the object, regexp and array functions in the literals
546 // array prefix. These functions will be used when creating 550 // array prefix. These functions will be used when creating
547 // object, regexp and array literals in this function. 551 // object, regexp and array literals in this function.
548 literals->set(JSFunction::kLiteralGlobalContextIndex, 552 literals->set(JSFunction::kLiteralGlobalContextIndex,
549 context->global_context()); 553 context->global_context());
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 1425
1422 1426
1423 Handle<Object> Factory::ToBoolean(bool value) { 1427 Handle<Object> Factory::ToBoolean(bool value) {
1424 return Handle<Object>(value 1428 return Handle<Object>(value
1425 ? isolate()->heap()->true_value() 1429 ? isolate()->heap()->true_value()
1426 : isolate()->heap()->false_value()); 1430 : isolate()->heap()->false_value());
1427 } 1431 }
1428 1432
1429 1433
1430 } } // namespace v8::internal 1434 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698