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

Side by Side Diff: src/bootstrapper.cc

Issue 768633002: Add infrastructure to keep track of references to prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 6 years 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
« no previous file with comments | « no previous file | src/factory.cc » ('j') | src/objects.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/extensions/externalize-string-extension.h" 9 #include "src/extensions/externalize-string-extension.h"
10 #include "src/extensions/free-buffer-extension.h" 10 #include "src/extensions/free-buffer-extension.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 return Handle<Context>(); 355 return Handle<Context>();
356 } 356 }
357 return scope.CloseAndEscape(env); 357 return scope.CloseAndEscape(env);
358 } 358 }
359 359
360 360
361 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) { 361 static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
362 // object.__proto__ = proto; 362 // object.__proto__ = proto;
363 Handle<Map> old_map = Handle<Map>(object->map()); 363 Handle<Map> old_map = Handle<Map>(object->map());
364 Handle<Map> new_map = Map::Copy(old_map, "SetObjectPrototype"); 364 Handle<Map> new_map = Map::Copy(old_map, "SetObjectPrototype");
365 new_map->set_prototype(*proto); 365 new_map->SetPrototype(proto, FAST_PROTOTYPE);
366 JSObject::MigrateToMap(object, new_map); 366 JSObject::MigrateToMap(object, new_map);
367 } 367 }
368 368
369 369
370 void Bootstrapper::DetachGlobal(Handle<Context> env) { 370 void Bootstrapper::DetachGlobal(Handle<Context> env) {
371 Factory* factory = env->GetIsolate()->factory(); 371 Factory* factory = env->GetIsolate()->factory();
372 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy())); 372 Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy()));
373 global_proxy->set_native_context(*factory->null_value()); 373 global_proxy->set_native_context(*factory->null_value());
374 SetObjectPrototype(global_proxy, factory->null_value()); 374 SetObjectPrototype(global_proxy, factory->null_value());
375 global_proxy->map()->set_constructor(*factory->null_value()); 375 global_proxy->map()->set_constructor(*factory->null_value());
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 486
487 // The final map for functions. Writeable prototype. 487 // The final map for functions. Writeable prototype.
488 // This map is installed in MakeFunctionInstancePrototypeWritable. 488 // This map is installed in MakeFunctionInstancePrototypeWritable.
489 sloppy_function_map_writable_prototype_ = 489 sloppy_function_map_writable_prototype_ =
490 CreateFunctionMap(FUNCTION_WITH_WRITEABLE_PROTOTYPE); 490 CreateFunctionMap(FUNCTION_WITH_WRITEABLE_PROTOTYPE);
491 491
492 Factory* factory = isolate->factory(); 492 Factory* factory = isolate->factory();
493 493
494 Handle<String> object_name = factory->Object_string(); 494 Handle<String> object_name = factory->Object_string();
495 495
496 Handle<JSObject> object_function_prototype;
497
496 { // --- O b j e c t --- 498 { // --- O b j e c t ---
497 Handle<JSFunction> object_fun = factory->NewFunction(object_name); 499 Handle<JSFunction> object_fun = factory->NewFunction(object_name);
498 int unused = JSObject::kInitialGlobalObjectUnusedPropertiesCount; 500 int unused = JSObject::kInitialGlobalObjectUnusedPropertiesCount;
499 int instance_size = JSObject::kHeaderSize + kPointerSize * unused; 501 int instance_size = JSObject::kHeaderSize + kPointerSize * unused;
500 Handle<Map> object_function_map = 502 Handle<Map> object_function_map =
501 factory->NewMap(JS_OBJECT_TYPE, instance_size); 503 factory->NewMap(JS_OBJECT_TYPE, instance_size);
502 object_function_map->set_inobject_properties(unused); 504 object_function_map->set_inobject_properties(unused);
503 JSFunction::SetInitialMap(object_fun, object_function_map, 505 JSFunction::SetInitialMap(object_fun, object_function_map,
504 isolate->factory()->null_value()); 506 isolate->factory()->null_value());
505 object_function_map->set_unused_property_fields(unused); 507 object_function_map->set_unused_property_fields(unused);
506 508
507 native_context()->set_object_function(*object_fun); 509 native_context()->set_object_function(*object_fun);
508 510
509 // Allocate a new prototype for the object function. 511 // Allocate a new prototype for the object function.
510 Handle<JSObject> prototype = factory->NewJSObject( 512 object_function_prototype =
511 isolate->object_function(), 513 factory->NewJSObject(isolate->object_function(), TENURED);
512 TENURED); 514 Handle<Map> map = Map::Copy(handle(object_function_prototype->map()),
513 Handle<Map> map = 515 "EmptyObjectPrototype");
514 Map::Copy(handle(prototype->map()), "EmptyObjectPrototype");
515 map->set_is_prototype_map(true); 516 map->set_is_prototype_map(true);
516 prototype->set_map(*map); 517 object_function_prototype->set_map(*map);
517 518
518 native_context()->set_initial_object_prototype(*prototype); 519 native_context()->set_initial_object_prototype(*object_function_prototype);
519 // For bootstrapping set the array prototype to be the same as the object 520 // For bootstrapping set the array prototype to be the same as the object
520 // prototype, otherwise the missing initial_array_prototype will cause 521 // prototype, otherwise the missing initial_array_prototype will cause
521 // assertions during startup. 522 // assertions during startup.
522 native_context()->set_initial_array_prototype(*prototype); 523 native_context()->set_initial_array_prototype(*object_function_prototype);
523 Accessors::FunctionSetPrototype(object_fun, prototype).Assert(); 524 Accessors::FunctionSetPrototype(object_fun, object_function_prototype)
525 .Assert();
524 } 526 }
525 527
526 // Allocate the empty function as the prototype for function ECMAScript 528 // Allocate the empty function as the prototype for function ECMAScript
527 // 262 15.3.4. 529 // 262 15.3.4.
528 Handle<String> empty_string = 530 Handle<String> empty_string =
529 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("Empty")); 531 factory->InternalizeOneByteString(STATIC_CHAR_VECTOR("Empty"));
530 Handle<Code> code(isolate->builtins()->builtin(Builtins::kEmptyFunction)); 532 Handle<Code> code(isolate->builtins()->builtin(Builtins::kEmptyFunction));
531 Handle<JSFunction> empty_function = factory->NewFunctionWithoutPrototype( 533 Handle<JSFunction> empty_function = factory->NewFunctionWithoutPrototype(
532 empty_string, code); 534 empty_string, code);
533 535
534 // Allocate the function map first and then patch the prototype later 536 // Allocate the function map first and then patch the prototype later
535 Handle<Map> empty_function_map = 537 Handle<Map> empty_function_map =
536 CreateFunctionMap(FUNCTION_WITHOUT_PROTOTYPE); 538 CreateFunctionMap(FUNCTION_WITHOUT_PROTOTYPE);
537 DCHECK(!empty_function_map->is_dictionary_map()); 539 DCHECK(!empty_function_map->is_dictionary_map());
538 empty_function_map->set_prototype( 540 empty_function_map->SetPrototype(object_function_prototype);
539 native_context()->object_function()->prototype());
540 empty_function_map->set_is_prototype_map(true); 541 empty_function_map->set_is_prototype_map(true);
541 empty_function->set_map(*empty_function_map); 542 empty_function->set_map(*empty_function_map);
542 543
543 // --- E m p t y --- 544 // --- E m p t y ---
544 Handle<String> source = factory->NewStringFromStaticChars("() {}"); 545 Handle<String> source = factory->NewStringFromStaticChars("() {}");
545 Handle<Script> script = factory->NewScript(source); 546 Handle<Script> script = factory->NewScript(source);
546 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 547 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
547 empty_function->shared()->set_script(*script); 548 empty_function->shared()->set_script(*script);
548 empty_function->shared()->set_start_position(0); 549 empty_function->shared()->set_start_position(0);
549 empty_function->shared()->set_end_position(source->length()); 550 empty_function->shared()->set_end_position(source->length());
550 empty_function->shared()->DontAdaptArguments(); 551 empty_function->shared()->DontAdaptArguments();
551 552
552 // Set prototypes for the function maps. 553 // Set prototypes for the function maps.
553 native_context()->sloppy_function_map()->set_prototype(*empty_function); 554 native_context()->sloppy_function_map()->SetPrototype(empty_function);
554 native_context()->sloppy_function_without_prototype_map()-> 555 native_context()->sloppy_function_without_prototype_map()->SetPrototype(
555 set_prototype(*empty_function); 556 empty_function);
556 sloppy_function_map_writable_prototype_->set_prototype(*empty_function); 557 sloppy_function_map_writable_prototype_->SetPrototype(empty_function);
557 return empty_function; 558 return empty_function;
558 } 559 }
559 560
560 561
561 void Genesis::SetStrictFunctionInstanceDescriptor( 562 void Genesis::SetStrictFunctionInstanceDescriptor(
562 Handle<Map> map, FunctionMode function_mode) { 563 Handle<Map> map, FunctionMode function_mode) {
563 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4; 564 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4;
564 Map::EnsureDescriptorSlack(map, size); 565 Map::EnsureDescriptorSlack(map, size);
565 566
566 Handle<AccessorPair> arguments(factory()->NewAccessorPair()); 567 Handle<AccessorPair> arguments(factory()->NewAccessorPair());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 return generator_poison_function; 649 return generator_poison_function;
649 } 650 }
650 651
651 652
652 Handle<Map> Genesis::CreateStrictFunctionMap( 653 Handle<Map> Genesis::CreateStrictFunctionMap(
653 FunctionMode function_mode, 654 FunctionMode function_mode,
654 Handle<JSFunction> empty_function) { 655 Handle<JSFunction> empty_function) {
655 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); 656 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
656 SetStrictFunctionInstanceDescriptor(map, function_mode); 657 SetStrictFunctionInstanceDescriptor(map, function_mode);
657 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode)); 658 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode));
658 map->set_prototype(*empty_function); 659 map->SetPrototype(empty_function);
659 return map; 660 return map;
660 } 661 }
661 662
662 663
663 void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) { 664 void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) {
664 // Allocate map for the prototype-less strict mode instances. 665 // Allocate map for the prototype-less strict mode instances.
665 Handle<Map> strict_function_without_prototype_map = 666 Handle<Map> strict_function_without_prototype_map =
666 CreateStrictFunctionMap(FUNCTION_WITHOUT_PROTOTYPE, empty); 667 CreateStrictFunctionMap(FUNCTION_WITHOUT_PROTOTYPE, empty);
667 native_context()->set_strict_function_without_prototype_map( 668 native_context()->set_strict_function_without_prototype_map(
668 *strict_function_without_prototype_map); 669 *strict_function_without_prototype_map);
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 1087
1087 static const int num_fields = JSRegExp::kInObjectFieldCount; 1088 static const int num_fields = JSRegExp::kInObjectFieldCount;
1088 initial_map->set_inobject_properties(num_fields); 1089 initial_map->set_inobject_properties(num_fields);
1089 initial_map->set_pre_allocated_property_fields(num_fields); 1090 initial_map->set_pre_allocated_property_fields(num_fields);
1090 initial_map->set_unused_property_fields(0); 1091 initial_map->set_unused_property_fields(0);
1091 initial_map->set_instance_size(initial_map->instance_size() + 1092 initial_map->set_instance_size(initial_map->instance_size() +
1092 num_fields * kPointerSize); 1093 num_fields * kPointerSize);
1093 1094
1094 // RegExp prototype object is itself a RegExp. 1095 // RegExp prototype object is itself a RegExp.
1095 Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype"); 1096 Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype");
1096 proto_map->set_prototype(native_context()->initial_object_prototype()); 1097 DCHECK(proto_map->prototype() == *isolate->initial_object_prototype());
1097 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map); 1098 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
1098 proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, 1099 proto->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex,
1099 heap->false_value()); 1100 heap->false_value());
1100 proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, 1101 proto->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex,
1101 heap->false_value()); 1102 heap->false_value());
1102 proto->InObjectPropertyAtPut(JSRegExp::kMultilineFieldIndex, 1103 proto->InObjectPropertyAtPut(JSRegExp::kMultilineFieldIndex,
1103 heap->false_value()); 1104 heap->false_value());
1104 proto->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, 1105 proto->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
1105 Smi::FromInt(0), 1106 Smi::FromInt(0),
1106 SKIP_WRITE_BARRIER); // It's a Smi. 1107 SKIP_WRITE_BARRIER); // It's a Smi.
1107 proto_map->set_is_prototype_map(true); 1108 proto_map->set_is_prototype_map(true);
1108 initial_map->set_prototype(*proto); 1109 initial_map->SetPrototype(proto);
1109 factory->SetRegExpIrregexpData(Handle<JSRegExp>::cast(proto), 1110 factory->SetRegExpIrregexpData(Handle<JSRegExp>::cast(proto),
1110 JSRegExp::IRREGEXP, factory->empty_string(), 1111 JSRegExp::IRREGEXP, factory->empty_string(),
1111 JSRegExp::Flags(0), 0); 1112 JSRegExp::Flags(0), 0);
1112 } 1113 }
1113 1114
1114 { // -- J S O N 1115 { // -- J S O N
1115 Handle<String> name = factory->InternalizeUtf8String("JSON"); 1116 Handle<String> name = factory->InternalizeUtf8String("JSON");
1116 Handle<JSFunction> cons = factory->NewFunction(name); 1117 Handle<JSFunction> cons = factory->NewFunction(name);
1117 JSFunction::SetInstancePrototype(cons, 1118 JSFunction::SetInstancePrototype(cons,
1118 Handle<Object>(native_context()->initial_object_prototype(), isolate)); 1119 Handle<Object>(native_context()->initial_object_prototype(), isolate));
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 CallbacksDescriptor d(factory->callee_string(), callee, attributes); 1284 CallbacksDescriptor d(factory->callee_string(), callee, attributes);
1284 map->AppendDescriptor(&d); 1285 map->AppendDescriptor(&d);
1285 } 1286 }
1286 { // caller 1287 { // caller
1287 CallbacksDescriptor d(factory->caller_string(), caller, attributes); 1288 CallbacksDescriptor d(factory->caller_string(), caller, attributes);
1288 map->AppendDescriptor(&d); 1289 map->AppendDescriptor(&d);
1289 } 1290 }
1290 // @@iterator method is added later. 1291 // @@iterator method is added later.
1291 1292
1292 map->set_function_with_prototype(true); 1293 map->set_function_with_prototype(true);
1293 map->set_prototype(native_context()->object_function()->prototype()); 1294 DCHECK_EQ(native_context()->object_function()->prototype(),
1295 *isolate->initial_object_prototype());
1296 map->SetPrototype(isolate->initial_object_prototype());
1294 map->set_pre_allocated_property_fields(1); 1297 map->set_pre_allocated_property_fields(1);
1295 map->set_inobject_properties(1); 1298 map->set_inobject_properties(1);
1296 1299
1297 // Copy constructor from the sloppy arguments boilerplate. 1300 // Copy constructor from the sloppy arguments boilerplate.
1298 map->set_constructor( 1301 map->set_constructor(
1299 native_context()->sloppy_arguments_map()->constructor()); 1302 native_context()->sloppy_arguments_map()->constructor());
1300 1303
1301 native_context()->set_strict_arguments_map(*map); 1304 native_context()->set_strict_arguments_map(*map);
1302 1305
1303 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex); 1306 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex);
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 JS_FUNCTION_TYPE, JSFunction::kHeaderSize, 1934 JS_FUNCTION_TYPE, JSFunction::kHeaderSize,
1932 generator_object_prototype, Builtins::kIllegal); 1935 generator_object_prototype, Builtins::kIllegal);
1933 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE, 1936 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE,
1934 JSFunction::kSize, generator_function_prototype, 1937 JSFunction::kSize, generator_function_prototype,
1935 Builtins::kIllegal); 1938 Builtins::kIllegal);
1936 1939
1937 // Create maps for generator functions and their prototypes. Store those 1940 // Create maps for generator functions and their prototypes. Store those
1938 // maps in the native context. 1941 // maps in the native context.
1939 Handle<Map> generator_function_map = 1942 Handle<Map> generator_function_map =
1940 Map::Copy(sloppy_function_map_writable_prototype_, "GeneratorFunction"); 1943 Map::Copy(sloppy_function_map_writable_prototype_, "GeneratorFunction");
1941 generator_function_map->set_prototype(*generator_function_prototype); 1944 generator_function_map->SetPrototype(generator_function_prototype);
1942 native_context()->set_sloppy_generator_function_map( 1945 native_context()->set_sloppy_generator_function_map(
1943 *generator_function_map); 1946 *generator_function_map);
1944 1947
1945 // The "arguments" and "caller" instance properties aren't specified, so 1948 // The "arguments" and "caller" instance properties aren't specified, so
1946 // technically we could leave them out. They make even less sense for 1949 // technically we could leave them out. They make even less sense for
1947 // generators than for functions. Still, the same argument that it makes 1950 // generators than for functions. Still, the same argument that it makes
1948 // sense to keep them around but poisoned in strict mode applies to 1951 // sense to keep them around but poisoned in strict mode applies to
1949 // generators as well. With poisoned accessors, naive callers can still 1952 // generators as well. With poisoned accessors, naive callers can still
1950 // iterate over the properties without accessing them. 1953 // iterate over the properties without accessing them.
1951 // 1954 //
(...skipping 12 matching lines...) Expand all
1964 poison_pair->set_setter(*poison_function); 1967 poison_pair->set_setter(*poison_function);
1965 ReplaceAccessors(generator_function_map, factory()->arguments_string(), 1968 ReplaceAccessors(generator_function_map, factory()->arguments_string(),
1966 rw_attribs, poison_pair); 1969 rw_attribs, poison_pair);
1967 ReplaceAccessors(generator_function_map, factory()->caller_string(), 1970 ReplaceAccessors(generator_function_map, factory()->caller_string(),
1968 rw_attribs, poison_pair); 1971 rw_attribs, poison_pair);
1969 1972
1970 Handle<Map> strict_function_map(native_context()->strict_function_map()); 1973 Handle<Map> strict_function_map(native_context()->strict_function_map());
1971 Handle<Map> strict_generator_function_map = 1974 Handle<Map> strict_generator_function_map =
1972 Map::Copy(strict_function_map, "StrictGeneratorFunction"); 1975 Map::Copy(strict_function_map, "StrictGeneratorFunction");
1973 // "arguments" and "caller" already poisoned. 1976 // "arguments" and "caller" already poisoned.
1974 strict_generator_function_map->set_prototype(*generator_function_prototype); 1977 strict_generator_function_map->SetPrototype(generator_function_prototype);
1975 native_context()->set_strict_generator_function_map( 1978 native_context()->set_strict_generator_function_map(
1976 *strict_generator_function_map); 1979 *strict_generator_function_map);
1977 1980
1978 Handle<JSFunction> object_function(native_context()->object_function()); 1981 Handle<JSFunction> object_function(native_context()->object_function());
1979 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0); 1982 Handle<Map> generator_object_prototype_map = Map::Create(isolate(), 0);
1980 generator_object_prototype_map->set_prototype(*generator_object_prototype); 1983 generator_object_prototype_map->SetPrototype(generator_object_prototype);
1981 native_context()->set_generator_object_prototype_map( 1984 native_context()->set_generator_object_prototype_map(
1982 *generator_object_prototype_map); 1985 *generator_object_prototype_map);
1983 } 1986 }
1984 1987
1985 if (FLAG_disable_native_files) { 1988 if (FLAG_disable_native_files) {
1986 PrintF("Warning: Running without installed natives!\n"); 1989 PrintF("Warning: Running without installed natives!\n");
1987 return true; 1990 return true;
1988 } 1991 }
1989 1992
1990 // Install public symbols. 1993 // Install public symbols.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 Handle<JSObject> array_prototype( 2074 Handle<JSObject> array_prototype(
2072 JSObject::cast(array_constructor->instance_prototype())); 2075 JSObject::cast(array_constructor->instance_prototype()));
2073 2076
2074 // Add initial map. 2077 // Add initial map.
2075 Handle<Map> initial_map = 2078 Handle<Map> initial_map =
2076 factory()->NewMap(JS_ARRAY_TYPE, JSRegExpResult::kSize); 2079 factory()->NewMap(JS_ARRAY_TYPE, JSRegExpResult::kSize);
2077 initial_map->set_constructor(*array_constructor); 2080 initial_map->set_constructor(*array_constructor);
2078 2081
2079 // Set prototype on map. 2082 // Set prototype on map.
2080 initial_map->set_non_instance_prototype(false); 2083 initial_map->set_non_instance_prototype(false);
2081 initial_map->set_prototype(*array_prototype); 2084 initial_map->SetPrototype(array_prototype);
2082 2085
2083 // Update map with length accessor from Array and add "index" and "input". 2086 // Update map with length accessor from Array and add "index" and "input".
2084 Map::EnsureDescriptorSlack(initial_map, 3); 2087 Map::EnsureDescriptorSlack(initial_map, 3);
2085 2088
2086 { 2089 {
2087 JSFunction* array_function = native_context()->array_function(); 2090 JSFunction* array_function = native_context()->array_function();
2088 Handle<DescriptorArray> array_descriptors( 2091 Handle<DescriptorArray> array_descriptors(
2089 array_function->initial_map()->instance_descriptors()); 2092 array_function->initial_map()->instance_descriptors());
2090 Handle<String> length = factory()->length_string(); 2093 Handle<String> length = factory()->length_string();
2091 int old = array_descriptors->SearchWithCache( 2094 int old = array_descriptors->SearchWithCache(
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
2834 return from + sizeof(NestingCounterType); 2837 return from + sizeof(NestingCounterType);
2835 } 2838 }
2836 2839
2837 2840
2838 // Called when the top-level V8 mutex is destroyed. 2841 // Called when the top-level V8 mutex is destroyed.
2839 void Bootstrapper::FreeThreadResources() { 2842 void Bootstrapper::FreeThreadResources() {
2840 DCHECK(!IsActive()); 2843 DCHECK(!IsActive());
2841 } 2844 }
2842 2845
2843 } } // namespace v8::internal 2846 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/factory.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698