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

Side by Side Diff: src/bootstrapper.cc

Issue 14200035: Rollback of r13728 in 3.17 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.17
Patch Set: Created 7 years, 8 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/factory.h » ('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 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 Handle<JSFunction> object_fun = 478 Handle<JSFunction> object_fun =
479 factory->NewFunction(object_name, factory->null_value()); 479 factory->NewFunction(object_name, factory->null_value());
480 Handle<Map> object_function_map = 480 Handle<Map> object_function_map =
481 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 481 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
482 object_fun->set_initial_map(*object_function_map); 482 object_fun->set_initial_map(*object_function_map);
483 object_function_map->set_constructor(*object_fun); 483 object_function_map->set_constructor(*object_fun);
484 484
485 native_context()->set_object_function(*object_fun); 485 native_context()->set_object_function(*object_fun);
486 486
487 // Allocate a new prototype for the object function. 487 // Allocate a new prototype for the object function.
488 Handle<Map> object_prototype_map = 488 Handle<JSObject> prototype = factory->NewJSObject(
489 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 489 isolate->object_function(),
490 Handle<DescriptorArray> prototype_descriptors( 490 TENURED);
491 factory->NewDescriptorArray(0, 1));
492 DescriptorArray::WhitenessWitness witness(*prototype_descriptors);
493 491
494 Handle<Foreign> object_prototype(
495 factory->NewForeign(&Accessors::ObjectPrototype));
496 PropertyAttributes attribs = static_cast<PropertyAttributes>(
497 DONT_ENUM | DONT_DELETE);
498 object_prototype_map->set_instance_descriptors(*prototype_descriptors);
499
500 { // Add __proto__.
501 CallbacksDescriptor d(heap->Proto_symbol(), *object_prototype, attribs);
502 object_prototype_map->AppendDescriptor(&d, witness);
503 }
504
505 Handle<JSObject> prototype = factory->NewJSObjectFromMap(
506 object_prototype_map,
507 TENURED);
508 native_context()->set_initial_object_prototype(*prototype); 492 native_context()->set_initial_object_prototype(*prototype);
509 SetPrototype(object_fun, prototype); 493 SetPrototype(object_fun, prototype);
510 } 494 }
511 495
512 // Allocate the empty function as the prototype for function ECMAScript 496 // Allocate the empty function as the prototype for function ECMAScript
513 // 262 15.3.4. 497 // 262 15.3.4.
514 Handle<String> symbol = 498 Handle<String> symbol =
515 factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("Empty")); 499 factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("Empty"));
516 Handle<JSFunction> empty_function = 500 Handle<JSFunction> empty_function =
517 factory->NewFunctionWithoutPrototype(symbol, CLASSIC_MODE); 501 factory->NewFunctionWithoutPrototype(symbol, CLASSIC_MODE);
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 return from + sizeof(NestingCounterType); 2467 return from + sizeof(NestingCounterType);
2484 } 2468 }
2485 2469
2486 2470
2487 // Called when the top-level V8 mutex is destroyed. 2471 // Called when the top-level V8 mutex is destroyed.
2488 void Bootstrapper::FreeThreadResources() { 2472 void Bootstrapper::FreeThreadResources() {
2489 ASSERT(!IsActive()); 2473 ASSERT(!IsActive());
2490 } 2474 }
2491 2475
2492 } } // namespace v8::internal 2476 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698