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

Side by Side Diff: src/bootstrapper.cc

Issue 565047: * Add the partial context snapshot to the VM executable if... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 10 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 } 1255 }
1256 1256
1257 1257
1258 bool Genesis::InstallExtensions(v8::ExtensionConfiguration* extensions) { 1258 bool Genesis::InstallExtensions(v8::ExtensionConfiguration* extensions) {
1259 // Clear coloring of extension list 1259 // Clear coloring of extension list
1260 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension(); 1260 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
1261 while (current != NULL) { 1261 while (current != NULL) {
1262 current->set_state(v8::UNVISITED); 1262 current->set_state(v8::UNVISITED);
1263 current = current->next(); 1263 current = current->next();
1264 } 1264 }
1265 // Install auto extensions 1265 // Install auto extensions. Coordinate with AutoExtensionsExist below.
1266 current = v8::RegisteredExtension::first_extension(); 1266 current = v8::RegisteredExtension::first_extension();
1267 while (current != NULL) { 1267 while (current != NULL) {
1268 if (current->extension()->auto_enable()) 1268 if (current->extension()->auto_enable())
1269 InstallExtension(current); 1269 InstallExtension(current);
1270 current = current->next(); 1270 current = current->next();
1271 } 1271 }
1272 1272
1273 if (FLAG_expose_gc) InstallExtension("v8/gc"); 1273 if (FLAG_expose_gc) InstallExtension("v8/gc");
1274 1274
1275 if (extensions == NULL) return true; 1275 if (extensions == NULL) return true;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 return Genesis::RestoreState(from); 1608 return Genesis::RestoreState(from);
1609 } 1609 }
1610 1610
1611 1611
1612 // Called when the top-level V8 mutex is destroyed. 1612 // Called when the top-level V8 mutex is destroyed.
1613 void Bootstrapper::FreeThreadResources() { 1613 void Bootstrapper::FreeThreadResources() {
1614 ASSERT(Genesis::current() == NULL); 1614 ASSERT(Genesis::current() == NULL);
1615 } 1615 }
1616 1616
1617 1617
1618 // Are there extensions that should be installed even if no extension was
1619 // specified?
1620 bool Bootstrapper::AutoExtensionsExist() {
1621 // Find auto extensions.
1622 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
1623 while (current != NULL) {
1624 if (current->extension()->auto_enable()) return true;
1625 current = current->next();
1626 }
1627 return FLAG_expose_gc;
1628 }
1629
1630
1618 // Reserve space for statics needing saving and restoring. 1631 // Reserve space for statics needing saving and restoring.
1619 int Genesis::ArchiveSpacePerThread() { 1632 int Genesis::ArchiveSpacePerThread() {
1620 return sizeof(current_); 1633 return sizeof(current_);
1621 } 1634 }
1622 1635
1623 1636
1624 // Archive statics that are thread local. 1637 // Archive statics that are thread local.
1625 char* Genesis::ArchiveState(char* to) { 1638 char* Genesis::ArchiveState(char* to) {
1626 *reinterpret_cast<Genesis**>(to) = current_; 1639 *reinterpret_cast<Genesis**>(to) = current_;
1627 current_ = NULL; 1640 current_ = NULL;
1628 return to + sizeof(current_); 1641 return to + sizeof(current_);
1629 } 1642 }
1630 1643
1631 1644
1632 // Restore statics that are thread local. 1645 // Restore statics that are thread local.
1633 char* Genesis::RestoreState(char* from) { 1646 char* Genesis::RestoreState(char* from) {
1634 current_ = *reinterpret_cast<Genesis**>(from); 1647 current_ = *reinterpret_cast<Genesis**>(from);
1635 return from + sizeof(current_); 1648 return from + sizeof(current_);
1636 } 1649 }
1637 1650
1638 } } // namespace v8::internal 1651 } } // namespace v8::internal
OLDNEW
« src/api.cc ('K') | « src/bootstrapper.h ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698