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

Side by Side Diff: src/bootstrapper.cc

Issue 8372027: Implement Harmony sets and maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/collection.js » ('j') | src/collection.js » ('J')
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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 1220
1221 // Initialize the data slot. 1221 // Initialize the data slot.
1222 global_context()->set_data(heap->undefined_value()); 1222 global_context()->set_data(heap->undefined_value());
1223 } 1223 }
1224 1224
1225 1225
1226 void Genesis::InitializeExperimentalGlobal() { 1226 void Genesis::InitializeExperimentalGlobal() {
1227 Handle<JSObject> global = Handle<JSObject>(global_context()->global()); 1227 Handle<JSObject> global = Handle<JSObject>(global_context()->global());
1228 1228
1229 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no 1229 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no
1230 // longer need to live behind a flag, so WeakMap gets added to the snapshot. 1230 // longer need to live behind a flag, so functions get added to the snapshot.
1231 if (FLAG_harmony_collections) { // -- S e t
1232 Handle<JSObject> prototype =
1233 factory()->NewJSObject(isolate()->object_function(), TENURED);
1234 InstallFunction(global, "Set", JS_SET_TYPE, JSSet::kSize,
1235 prototype, Builtins::kIllegal, true);
1236 }
1237 if (FLAG_harmony_collections) { // -- M a p
1238 Handle<JSObject> prototype =
1239 factory()->NewJSObject(isolate()->object_function(), TENURED);
1240 InstallFunction(global, "Map", JS_MAP_TYPE, JSMap::kSize,
1241 prototype, Builtins::kIllegal, true);
1242 }
1231 if (FLAG_harmony_weakmaps) { // -- W e a k M a p 1243 if (FLAG_harmony_weakmaps) { // -- W e a k M a p
1232 Handle<JSObject> prototype = 1244 Handle<JSObject> prototype =
1233 factory()->NewJSObject(isolate()->object_function(), TENURED); 1245 factory()->NewJSObject(isolate()->object_function(), TENURED);
1234 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, 1246 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize,
1235 prototype, Builtins::kIllegal, true); 1247 prototype, Builtins::kIllegal, true);
1236 } 1248 }
1237 } 1249 }
1238 1250
1239 1251
1240 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { 1252 bool Genesis::CompileBuiltin(Isolate* isolate, int index) {
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 1745
1734 bool Genesis::InstallExperimentalNatives() { 1746 bool Genesis::InstallExperimentalNatives() {
1735 for (int i = ExperimentalNatives::GetDebuggerCount(); 1747 for (int i = ExperimentalNatives::GetDebuggerCount();
1736 i < ExperimentalNatives::GetBuiltinsCount(); 1748 i < ExperimentalNatives::GetBuiltinsCount();
1737 i++) { 1749 i++) {
1738 if (FLAG_harmony_proxies && 1750 if (FLAG_harmony_proxies &&
1739 strcmp(ExperimentalNatives::GetScriptName(i).start(), 1751 strcmp(ExperimentalNatives::GetScriptName(i).start(),
1740 "native proxy.js") == 0) { 1752 "native proxy.js") == 0) {
1741 if (!CompileExperimentalBuiltin(isolate(), i)) return false; 1753 if (!CompileExperimentalBuiltin(isolate(), i)) return false;
1742 } 1754 }
1755 if (FLAG_harmony_collections &&
1756 strcmp(ExperimentalNatives::GetScriptName(i).start(),
1757 "native collection.js") == 0) {
1758 if (!CompileExperimentalBuiltin(isolate(), i)) return false;
1759 }
1743 if (FLAG_harmony_weakmaps && 1760 if (FLAG_harmony_weakmaps &&
1744 strcmp(ExperimentalNatives::GetScriptName(i).start(), 1761 strcmp(ExperimentalNatives::GetScriptName(i).start(),
1745 "native weakmap.js") == 0) { 1762 "native weakmap.js") == 0) {
1746 if (!CompileExperimentalBuiltin(isolate(), i)) return false; 1763 if (!CompileExperimentalBuiltin(isolate(), i)) return false;
1747 } 1764 }
1748 } 1765 }
1749 1766
1750 InstallExperimentalNativeFunctions(); 1767 InstallExperimentalNativeFunctions();
1751 1768
1752 return true; 1769 return true;
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 return from + sizeof(NestingCounterType); 2284 return from + sizeof(NestingCounterType);
2268 } 2285 }
2269 2286
2270 2287
2271 // Called when the top-level V8 mutex is destroyed. 2288 // Called when the top-level V8 mutex is destroyed.
2272 void Bootstrapper::FreeThreadResources() { 2289 void Bootstrapper::FreeThreadResources() {
2273 ASSERT(!IsActive()); 2290 ASSERT(!IsActive());
2274 } 2291 }
2275 2292
2276 } } // namespace v8::internal 2293 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/collection.js » ('j') | src/collection.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698