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

Side by Side Diff: src/bootstrapper.cc

Issue 7624041: Fix initial prototype of WeakMap function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix grammar of comments. Created 9 years, 3 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/weakmap.js » ('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 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 code, 1153 code,
1154 true); 1154 true);
1155 1155
1156 Handle<String> name = factory->LookupAsciiSymbol("context_extension"); 1156 Handle<String> name = factory->LookupAsciiSymbol("context_extension");
1157 context_extension_fun->shared()->set_instance_class_name(*name); 1157 context_extension_fun->shared()->set_instance_class_name(*name);
1158 global_context()->set_context_extension_function(*context_extension_fun); 1158 global_context()->set_context_extension_function(*context_extension_fun);
1159 } 1159 }
1160 1160
1161 1161
1162 { 1162 {
1163 // Setup the call-as-function delegate. 1163 // Set up the call-as-function delegate.
1164 Handle<Code> code = 1164 Handle<Code> code =
1165 Handle<Code>(isolate->builtins()->builtin( 1165 Handle<Code>(isolate->builtins()->builtin(
1166 Builtins::kHandleApiCallAsFunction)); 1166 Builtins::kHandleApiCallAsFunction));
1167 Handle<JSFunction> delegate = 1167 Handle<JSFunction> delegate =
1168 factory->NewFunction(factory->empty_symbol(), JS_OBJECT_TYPE, 1168 factory->NewFunction(factory->empty_symbol(), JS_OBJECT_TYPE,
1169 JSObject::kHeaderSize, code, true); 1169 JSObject::kHeaderSize, code, true);
1170 global_context()->set_call_as_function_delegate(*delegate); 1170 global_context()->set_call_as_function_delegate(*delegate);
1171 delegate->shared()->DontAdaptArguments(); 1171 delegate->shared()->DontAdaptArguments();
1172 } 1172 }
1173 1173
1174 { 1174 {
1175 // Setup the call-as-constructor delegate. 1175 // Set up the call-as-constructor delegate.
1176 Handle<Code> code = 1176 Handle<Code> code =
1177 Handle<Code>(isolate->builtins()->builtin( 1177 Handle<Code>(isolate->builtins()->builtin(
1178 Builtins::kHandleApiCallAsConstructor)); 1178 Builtins::kHandleApiCallAsConstructor));
1179 Handle<JSFunction> delegate = 1179 Handle<JSFunction> delegate =
1180 factory->NewFunction(factory->empty_symbol(), JS_OBJECT_TYPE, 1180 factory->NewFunction(factory->empty_symbol(), JS_OBJECT_TYPE,
1181 JSObject::kHeaderSize, code, true); 1181 JSObject::kHeaderSize, code, true);
1182 global_context()->set_call_as_constructor_delegate(*delegate); 1182 global_context()->set_call_as_constructor_delegate(*delegate);
1183 delegate->shared()->DontAdaptArguments(); 1183 delegate->shared()->DontAdaptArguments();
1184 } 1184 }
1185 1185
1186 // Initialize the out of memory slot. 1186 // Initialize the out of memory slot.
1187 global_context()->set_out_of_memory(heap->false_value()); 1187 global_context()->set_out_of_memory(heap->false_value());
1188 1188
1189 // Initialize the data slot. 1189 // Initialize the data slot.
1190 global_context()->set_data(heap->undefined_value()); 1190 global_context()->set_data(heap->undefined_value());
1191 } 1191 }
1192 1192
1193 1193
1194 void Genesis::InitializeExperimentalGlobal() { 1194 void Genesis::InitializeExperimentalGlobal() {
1195 Isolate* isolate = this->isolate();
1196 Handle<JSObject> global = Handle<JSObject>(global_context()->global()); 1195 Handle<JSObject> global = Handle<JSObject>(global_context()->global());
1197 1196
1198 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no 1197 // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no
1199 // longer need to live behind a flag, so WeakMap gets added to the snapshot. 1198 // longer need to live behind a flag, so WeakMap gets added to the snapshot.
1200 if (FLAG_harmony_weakmaps) { // -- W e a k M a p 1199 if (FLAG_harmony_weakmaps) { // -- W e a k M a p
1200 Handle<JSObject> prototype =
1201 factory()->NewJSObject(isolate()->object_function(), TENURED);
1201 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, 1202 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize,
1202 isolate->initial_object_prototype(), 1203 prototype, Builtins::kIllegal, true);
1203 Builtins::kIllegal, true);
1204 } 1204 }
1205 } 1205 }
1206 1206
1207 1207
1208 bool Genesis::CompileBuiltin(Isolate* isolate, int index) { 1208 bool Genesis::CompileBuiltin(Isolate* isolate, int index) {
1209 Vector<const char> name = Natives::GetScriptName(index); 1209 Vector<const char> name = Natives::GetScriptName(index);
1210 Handle<String> source_code = 1210 Handle<String> source_code =
1211 isolate->bootstrapper()->NativesSourceLookup(index); 1211 isolate->bootstrapper()->NativesSourceLookup(index);
1212 return CompileNative(name, source_code); 1212 return CompileNative(name, source_code);
1213 } 1213 }
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
2219 return from + sizeof(NestingCounterType); 2219 return from + sizeof(NestingCounterType);
2220 } 2220 }
2221 2221
2222 2222
2223 // Called when the top-level V8 mutex is destroyed. 2223 // Called when the top-level V8 mutex is destroyed.
2224 void Bootstrapper::FreeThreadResources() { 2224 void Bootstrapper::FreeThreadResources() {
2225 ASSERT(!IsActive()); 2225 ASSERT(!IsActive());
2226 } 2226 }
2227 2227
2228 } } // namespace v8::internal 2228 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/weakmap.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698