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

Side by Side Diff: src/runtime.cc

Issue 178463007: Moved type feedback vector to SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports and comment response. Created 6 years, 9 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 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 // Mark both, the source and the target, as un-flushable because the 2940 // Mark both, the source and the target, as un-flushable because the
2941 // shared unoptimized code makes them impossible to enqueue in a list. 2941 // shared unoptimized code makes them impossible to enqueue in a list.
2942 ASSERT(target_shared->code()->gc_metadata() == NULL); 2942 ASSERT(target_shared->code()->gc_metadata() == NULL);
2943 ASSERT(source_shared->code()->gc_metadata() == NULL); 2943 ASSERT(source_shared->code()->gc_metadata() == NULL);
2944 target_shared->set_dont_flush(true); 2944 target_shared->set_dont_flush(true);
2945 source_shared->set_dont_flush(true); 2945 source_shared->set_dont_flush(true);
2946 2946
2947 // Set the code, scope info, formal parameter count, and the length 2947 // Set the code, scope info, formal parameter count, and the length
2948 // of the target shared function info. 2948 // of the target shared function info.
2949 target_shared->ReplaceCode(source_shared->code()); 2949 target_shared->ReplaceCode(source_shared->code());
2950 target_shared->set_feedback_vector(source_shared->feedback_vector());
2950 target_shared->set_scope_info(source_shared->scope_info()); 2951 target_shared->set_scope_info(source_shared->scope_info());
2951 target_shared->set_length(source_shared->length()); 2952 target_shared->set_length(source_shared->length());
2952 target_shared->set_formal_parameter_count( 2953 target_shared->set_formal_parameter_count(
2953 source_shared->formal_parameter_count()); 2954 source_shared->formal_parameter_count());
2954 target_shared->set_script(source_shared->script()); 2955 target_shared->set_script(source_shared->script());
2955 target_shared->set_start_position_and_type( 2956 target_shared->set_start_position_and_type(
2956 source_shared->start_position_and_type()); 2957 source_shared->start_position_and_type());
2957 target_shared->set_end_position(source_shared->end_position()); 2958 target_shared->set_end_position(source_shared->end_position());
2958 bool was_native = target_shared->native(); 2959 bool was_native = target_shared->native();
2959 target_shared->set_compiler_hints(source_shared->compiler_hints()); 2960 target_shared->set_compiler_hints(source_shared->compiler_hints());
(...skipping 5591 matching lines...) Expand 10 before | Expand all | Expand 10 after
8551 } 8552 }
8552 8553
8553 8554
8554 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) { 8555 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) {
8555 HandleScope scope(isolate); 8556 HandleScope scope(isolate);
8556 ASSERT(args.length() == 1); 8557 ASSERT(args.length() == 1);
8557 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 8558 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8558 Code* unoptimized = function->shared()->code(); 8559 Code* unoptimized = function->shared()->code();
8559 if (unoptimized->kind() == Code::FUNCTION) { 8560 if (unoptimized->kind() == Code::FUNCTION) {
8560 unoptimized->ClearInlineCaches(); 8561 unoptimized->ClearInlineCaches();
8561 unoptimized->ClearTypeFeedbackInfo(isolate->heap()); 8562 function->shared()->ClearTypeFeedbackInfo(isolate->heap());
Benedikt Meurer 2014/03/05 07:22:56 This should be done unconditionally.
mvstanton 2014/03/05 08:48:02 Done.
8562 } 8563 }
8563 return isolate->heap()->undefined_value(); 8564 return isolate->heap()->undefined_value();
8564 } 8565 }
8565 8566
8566 8567
8567 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) { 8568 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) {
8568 SealHandleScope shs(isolate); 8569 SealHandleScope shs(isolate);
8569 #if defined(USE_SIMULATOR) 8570 #if defined(USE_SIMULATOR)
8570 return isolate->heap()->true_value(); 8571 return isolate->heap()->true_value();
8571 #else 8572 #else
(...skipping 6393 matching lines...) Expand 10 before | Expand all | Expand 10 after
14965 // Handle last resort GC and make sure to allow future allocations 14966 // Handle last resort GC and make sure to allow future allocations
14966 // to grow the heap without causing GCs (if possible). 14967 // to grow the heap without causing GCs (if possible).
14967 isolate->counters()->gc_last_resort_from_js()->Increment(); 14968 isolate->counters()->gc_last_resort_from_js()->Increment();
14968 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14969 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14969 "Runtime::PerformGC"); 14970 "Runtime::PerformGC");
14970 } 14971 }
14971 } 14972 }
14972 14973
14973 14974
14974 } } // namespace v8::internal 14975 } } // namespace v8::internal
OLDNEW
« src/objects-printer.cc ('K') | « src/objects-visiting-inl.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698