OLD | NEW |
---|---|
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 v->Synchronize(VisitorSynchronization::kExtensions); | 296 v->Synchronize(VisitorSynchronization::kExtensions); |
297 } | 297 } |
298 | 298 |
299 | 299 |
300 Handle<Context> Bootstrapper::CreateEnvironment( | 300 Handle<Context> Bootstrapper::CreateEnvironment( |
301 Handle<Object> global_object, | 301 Handle<Object> global_object, |
302 v8::Handle<v8::ObjectTemplate> global_template, | 302 v8::Handle<v8::ObjectTemplate> global_template, |
303 v8::ExtensionConfiguration* extensions) { | 303 v8::ExtensionConfiguration* extensions) { |
304 HandleScope scope(isolate_); | 304 HandleScope scope(isolate_); |
305 Genesis genesis(isolate_, global_object, global_template, extensions); | 305 Genesis genesis(isolate_, global_object, global_template, extensions); |
306 if (!genesis.result().is_null()) { | 306 Handle<Context> env = genesis.result(); |
307 Handle<Object> ctx(isolate_->global_handles()->Create(*genesis.result())); | 307 if (!env.is_null()) { |
308 Handle<Context> env = Handle<Context>::cast(ctx); | |
309 if (InstallExtensions(env, extensions)) { | 308 if (InstallExtensions(env, extensions)) { |
Sven Panne
2013/04/09 07:08:33
Merge the "if"s, move the last "return" to an "els
Michael Starzinger
2013/04/09 13:29:18
Done.
| |
310 return env; | 309 return scope.CloseAndEscape(env); |
311 } | 310 } |
312 } | 311 } |
313 return Handle<Context>(); | 312 return Handle<Context>(); |
314 } | 313 } |
315 | 314 |
316 | 315 |
317 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) { | 316 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) { |
318 // object.__proto__ = proto; | 317 // object.__proto__ = proto; |
319 Factory* factory = object->GetIsolate()->factory(); | 318 Factory* factory = object->GetIsolate()->factory(); |
320 Handle<Map> old_to_map = Handle<Map>(object->map()); | 319 Handle<Map> old_to_map = Handle<Map>(object->map()); |
(...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2495 return from + sizeof(NestingCounterType); | 2494 return from + sizeof(NestingCounterType); |
2496 } | 2495 } |
2497 | 2496 |
2498 | 2497 |
2499 // Called when the top-level V8 mutex is destroyed. | 2498 // Called when the top-level V8 mutex is destroyed. |
2500 void Bootstrapper::FreeThreadResources() { | 2499 void Bootstrapper::FreeThreadResources() { |
2501 ASSERT(!IsActive()); | 2500 ASSERT(!IsActive()); |
2502 } | 2501 } |
2503 | 2502 |
2504 } } // namespace v8::internal | 2503 } } // namespace v8::internal |
OLD | NEW |