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

Side by Side Diff: src/bootstrapper.cc

Issue 7017008: Trying to move derived get trap from builtins to global context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments. Created 9 years, 7 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 | « no previous file | src/builtins.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // Similarly, we want to use the inner global that has been created by the 192 // Similarly, we want to use the inner global that has been created by the
193 // templates passed through the API. The inner global from the snapshot is 193 // templates passed through the API. The inner global from the snapshot is
194 // detached from the other objects in the snapshot. 194 // detached from the other objects in the snapshot.
195 void HookUpInnerGlobal(Handle<GlobalObject> inner_global); 195 void HookUpInnerGlobal(Handle<GlobalObject> inner_global);
196 // New context initialization. Used for creating a context from scratch. 196 // New context initialization. Used for creating a context from scratch.
197 void InitializeGlobal(Handle<GlobalObject> inner_global, 197 void InitializeGlobal(Handle<GlobalObject> inner_global,
198 Handle<JSFunction> empty_function); 198 Handle<JSFunction> empty_function);
199 // Installs the contents of the native .js files on the global objects. 199 // Installs the contents of the native .js files on the global objects.
200 // Used for creating a context from scratch. 200 // Used for creating a context from scratch.
201 void InstallNativeFunctions(); 201 void InstallNativeFunctions();
202 void InstallExperimentalNativeFunctions();
202 bool InstallNatives(); 203 bool InstallNatives();
203 bool InstallExperimentalNatives(); 204 bool InstallExperimentalNatives();
204 void InstallBuiltinFunctionIds(); 205 void InstallBuiltinFunctionIds();
205 void InstallJSFunctionResultCaches(); 206 void InstallJSFunctionResultCaches();
206 void InitializeNormalizedMapCaches(); 207 void InitializeNormalizedMapCaches();
207 // Used both for deserialized and from-scratch contexts to add the extensions 208 // Used both for deserialized and from-scratch contexts to add the extensions
208 // provided. 209 // provided.
209 static bool InstallExtensions(Handle<Context> global_context, 210 static bool InstallExtensions(Handle<Context> global_context,
210 v8::ExtensionConfiguration* extensions); 211 v8::ExtensionConfiguration* extensions);
211 static bool InstallExtension(const char* name); 212 static bool InstallExtension(const char* name);
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun); 1279 INSTALL_NATIVE(JSFunction, "ToUint32", to_uint32_fun);
1279 INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun); 1280 INSTALL_NATIVE(JSFunction, "ToInt32", to_int32_fun);
1280 INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun); 1281 INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun);
1281 INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun); 1282 INSTALL_NATIVE(JSFunction, "Instantiate", instantiate_fun);
1282 INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance", 1283 INSTALL_NATIVE(JSFunction, "ConfigureTemplateInstance",
1283 configure_instance_fun); 1284 configure_instance_fun);
1284 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun); 1285 INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun);
1285 INSTALL_NATIVE(JSObject, "functionCache", function_cache); 1286 INSTALL_NATIVE(JSObject, "functionCache", function_cache);
1286 } 1287 }
1287 1288
1289 void Genesis::InstallExperimentalNativeFunctions() {
1290 if (FLAG_harmony_proxies) {
1291 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap);
1292 }
1293 }
1294
1288 #undef INSTALL_NATIVE 1295 #undef INSTALL_NATIVE
1289 1296
1290 1297
1291 bool Genesis::InstallNatives() { 1298 bool Genesis::InstallNatives() {
1292 HandleScope scope; 1299 HandleScope scope;
1293 1300
1294 // Create a function for the builtins object. Allocate space for the 1301 // Create a function for the builtins object. Allocate space for the
1295 // JavaScript builtins, a reference to the builtins object 1302 // JavaScript builtins, a reference to the builtins object
1296 // (itself) and a reference to the global_context directly in the object. 1303 // (itself) and a reference to the global_context directly in the object.
1297 Handle<Code> code = Handle<Code>( 1304 Handle<Code> code = Handle<Code>(
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 bool Genesis::InstallExperimentalNatives() { 1647 bool Genesis::InstallExperimentalNatives() {
1641 for (int i = ExperimentalNatives::GetDebuggerCount(); 1648 for (int i = ExperimentalNatives::GetDebuggerCount();
1642 i < ExperimentalNatives::GetBuiltinsCount(); 1649 i < ExperimentalNatives::GetBuiltinsCount();
1643 i++) { 1650 i++) {
1644 if (FLAG_harmony_proxies && 1651 if (FLAG_harmony_proxies &&
1645 strcmp(ExperimentalNatives::GetScriptName(i).start(), 1652 strcmp(ExperimentalNatives::GetScriptName(i).start(),
1646 "native proxy.js") == 0) { 1653 "native proxy.js") == 0) {
1647 if (!CompileExperimentalBuiltin(isolate(), i)) return false; 1654 if (!CompileExperimentalBuiltin(isolate(), i)) return false;
1648 } 1655 }
1649 } 1656 }
1657
1658 InstallExperimentalNativeFunctions();
1659
1650 return true; 1660 return true;
1651 } 1661 }
1652 1662
1653 1663
1654 static Handle<JSObject> ResolveBuiltinIdHolder( 1664 static Handle<JSObject> ResolveBuiltinIdHolder(
1655 Handle<Context> global_context, 1665 Handle<Context> global_context,
1656 const char* holder_expr) { 1666 const char* holder_expr) {
1657 Factory* factory = global_context->GetIsolate()->factory(); 1667 Factory* factory = global_context->GetIsolate()->factory();
1658 Handle<GlobalObject> global(global_context->global()); 1668 Handle<GlobalObject> global(global_context->global());
1659 const char* period_pos = strchr(holder_expr, '.'); 1669 const char* period_pos = strchr(holder_expr, '.');
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 return from + sizeof(NestingCounterType); 2171 return from + sizeof(NestingCounterType);
2162 } 2172 }
2163 2173
2164 2174
2165 // Called when the top-level V8 mutex is destroyed. 2175 // Called when the top-level V8 mutex is destroyed.
2166 void Bootstrapper::FreeThreadResources() { 2176 void Bootstrapper::FreeThreadResources() {
2167 ASSERT(!IsActive()); 2177 ASSERT(!IsActive());
2168 } 2178 }
2169 2179
2170 } } // namespace v8::internal 2180 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698