OLD | NEW |
---|---|
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 Loading... | |
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 // Setup the call-as-function delegate. |
Erik Corry
2011/08/30 09:13:01
"Setup" is a noun and "Set up" is a verb. And one
Michael Starzinger
2011/08/30 09:34:41
Done.
| |
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 |
(...skipping 11 matching lines...) Expand all Loading... | |
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 Loading... | |
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 |
OLD | NEW |