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

Side by Side Diff: src/bootstrapper.cc

Issue 988283003: use a hash table for the function cache as blink is leaking functiontemplates (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/api-natives.cc ('k') | src/contexts.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 int i = Natives::GetDebuggerCount(); 2110 int i = Natives::GetDebuggerCount();
2111 if (!CompileBuiltin(isolate(), i)) return false; 2111 if (!CompileBuiltin(isolate(), i)) return false;
2112 if (!InstallJSBuiltins(builtins)) return false; 2112 if (!InstallJSBuiltins(builtins)) return false;
2113 2113
2114 for (++i; i < Natives::GetBuiltinsCount(); ++i) { 2114 for (++i; i < Natives::GetBuiltinsCount(); ++i) {
2115 if (!CompileBuiltin(isolate(), i)) return false; 2115 if (!CompileBuiltin(isolate(), i)) return false;
2116 } 2116 }
2117 2117
2118 InstallNativeFunctions(); 2118 InstallNativeFunctions();
2119 2119
2120 native_context()->set_function_cache(heap()->empty_fixed_array()); 2120 auto function_cache =
2121 ObjectHashTable::New(isolate(), ApiNatives::kInitialFunctionCacheSize);
2122 native_context()->set_function_cache(*function_cache);
2121 2123
2122 // Store the map for the string prototype after the natives has been compiled 2124 // Store the map for the string prototype after the natives has been compiled
2123 // and the String function has been set up. 2125 // and the String function has been set up.
2124 Handle<JSFunction> string_function(native_context()->string_function()); 2126 Handle<JSFunction> string_function(native_context()->string_function());
2125 DCHECK(JSObject::cast( 2127 DCHECK(JSObject::cast(
2126 string_function->initial_map()->prototype())->HasFastProperties()); 2128 string_function->initial_map()->prototype())->HasFastProperties());
2127 native_context()->set_string_function_prototype_map( 2129 native_context()->set_string_function_prototype_map(
2128 HeapObject::cast(string_function->initial_map()->prototype())->map()); 2130 HeapObject::cast(string_function->initial_map()->prototype())->map());
2129 2131
2130 // Install Function.prototype.call and apply. 2132 // Install Function.prototype.call and apply.
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
2922 return from + sizeof(NestingCounterType); 2924 return from + sizeof(NestingCounterType);
2923 } 2925 }
2924 2926
2925 2927
2926 // Called when the top-level V8 mutex is destroyed. 2928 // Called when the top-level V8 mutex is destroyed.
2927 void Bootstrapper::FreeThreadResources() { 2929 void Bootstrapper::FreeThreadResources() {
2928 DCHECK(!IsActive()); 2930 DCHECK(!IsActive());
2929 } 2931 }
2930 2932
2931 } } // namespace v8::internal 2933 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api-natives.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698