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

Side by Side Diff: src/bootstrapper.cc

Issue 14710015: Prevent flushing of code that was set with %SetCode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/objects.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 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // of builtins. 448 // of builtins.
449 // Later the map is replaced with writable prototype map, allocated below. 449 // Later the map is replaced with writable prototype map, allocated below.
450 Handle<Map> function_map = CreateFunctionMap(ADD_READONLY_PROTOTYPE); 450 Handle<Map> function_map = CreateFunctionMap(ADD_READONLY_PROTOTYPE);
451 native_context()->set_function_map(*function_map); 451 native_context()->set_function_map(*function_map);
452 452
453 // The final map for functions. Writeable prototype. 453 // The final map for functions. Writeable prototype.
454 // This map is installed in MakeFunctionInstancePrototypeWritable. 454 // This map is installed in MakeFunctionInstancePrototypeWritable.
455 function_map_writable_prototype_ = CreateFunctionMap(ADD_WRITEABLE_PROTOTYPE); 455 function_map_writable_prototype_ = CreateFunctionMap(ADD_WRITEABLE_PROTOTYPE);
456 456
457 Factory* factory = isolate->factory(); 457 Factory* factory = isolate->factory();
458 Heap* heap = isolate->heap();
459 458
460 Handle<String> object_name = Handle<String>(heap->Object_string()); 459 Handle<String> object_name = factory->Object_string();
461 460
462 { // --- O b j e c t --- 461 { // --- O b j e c t ---
463 Handle<JSFunction> object_fun = 462 Handle<JSFunction> object_fun =
464 factory->NewFunction(object_name, factory->null_value()); 463 factory->NewFunction(object_name, factory->null_value());
465 Handle<Map> object_function_map = 464 Handle<Map> object_function_map =
466 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 465 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
467 object_fun->set_initial_map(*object_function_map); 466 object_fun->set_initial_map(*object_function_map);
468 object_function_map->set_constructor(*object_fun); 467 object_function_map->set_constructor(*object_fun);
469 468
470 native_context()->set_object_function(*object_fun); 469 native_context()->set_object_function(*object_fun);
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 // Security setup: Set the security token of the global object to 822 // Security setup: Set the security token of the global object to
824 // its the inner global. This makes the security check between two 823 // its the inner global. This makes the security check between two
825 // different contexts fail by default even in case of global 824 // different contexts fail by default even in case of global
826 // object reinitialization. 825 // object reinitialization.
827 native_context()->set_security_token(*inner_global); 826 native_context()->set_security_token(*inner_global);
828 827
829 Isolate* isolate = inner_global->GetIsolate(); 828 Isolate* isolate = inner_global->GetIsolate();
830 Factory* factory = isolate->factory(); 829 Factory* factory = isolate->factory();
831 Heap* heap = isolate->heap(); 830 Heap* heap = isolate->heap();
832 831
833 Handle<String> object_name = Handle<String>(heap->Object_string()); 832 Handle<String> object_name = factory->Object_string();
834 CHECK_NOT_EMPTY_HANDLE(isolate, 833 CHECK_NOT_EMPTY_HANDLE(isolate,
835 JSObject::SetLocalPropertyIgnoreAttributes( 834 JSObject::SetLocalPropertyIgnoreAttributes(
836 inner_global, object_name, 835 inner_global, object_name,
837 isolate->object_function(), DONT_ENUM)); 836 isolate->object_function(), DONT_ENUM));
838 837
839 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object()); 838 Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
840 839
841 // Install global Function object 840 // Install global Function object
842 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, 841 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
843 empty_function, Builtins::kIllegal, true); // ECMA native. 842 empty_function, Builtins::kIllegal, true); // ECMA native.
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 return from + sizeof(NestingCounterType); 2600 return from + sizeof(NestingCounterType);
2602 } 2601 }
2603 2602
2604 2603
2605 // Called when the top-level V8 mutex is destroyed. 2604 // Called when the top-level V8 mutex is destroyed.
2606 void Bootstrapper::FreeThreadResources() { 2605 void Bootstrapper::FreeThreadResources() {
2607 ASSERT(!IsActive()); 2606 ASSERT(!IsActive());
2608 } 2607 }
2609 2608
2610 } } // namespace v8::internal 2609 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698