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

Side by Side Diff: src/bootstrapper.cc

Issue 856503002: Massive renaming of PropertyType values and other implied stuff. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Spurious file addition fixed Created 5 years, 11 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
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/elements.cc » ('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 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 Handle<Map> map, FunctionMode function_mode) { 411 Handle<Map> map, FunctionMode function_mode) {
412 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4; 412 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4;
413 Map::EnsureDescriptorSlack(map, size); 413 Map::EnsureDescriptorSlack(map, size);
414 414
415 PropertyAttributes attribs = static_cast<PropertyAttributes>( 415 PropertyAttributes attribs = static_cast<PropertyAttributes>(
416 DONT_ENUM | DONT_DELETE | READ_ONLY); 416 DONT_ENUM | DONT_DELETE | READ_ONLY);
417 417
418 Handle<AccessorInfo> length = 418 Handle<AccessorInfo> length =
419 Accessors::FunctionLengthInfo(isolate(), attribs); 419 Accessors::FunctionLengthInfo(isolate(), attribs);
420 { // Add length. 420 { // Add length.
421 CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())), 421 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
422 length, attribs); 422 length, attribs);
423 map->AppendDescriptor(&d); 423 map->AppendDescriptor(&d);
424 } 424 }
425 Handle<AccessorInfo> name = 425 Handle<AccessorInfo> name =
426 Accessors::FunctionNameInfo(isolate(), attribs); 426 Accessors::FunctionNameInfo(isolate(), attribs);
427 { // Add name. 427 { // Add name.
428 CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())), 428 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
429 name, attribs); 429 attribs);
430 map->AppendDescriptor(&d); 430 map->AppendDescriptor(&d);
431 } 431 }
432 Handle<AccessorInfo> args = 432 Handle<AccessorInfo> args =
433 Accessors::FunctionArgumentsInfo(isolate(), attribs); 433 Accessors::FunctionArgumentsInfo(isolate(), attribs);
434 { // Add arguments. 434 { // Add arguments.
435 CallbacksDescriptor d(Handle<Name>(Name::cast(args->name())), 435 AccessorConstantDescriptor d(Handle<Name>(Name::cast(args->name())), args,
436 args, attribs); 436 attribs);
437 map->AppendDescriptor(&d); 437 map->AppendDescriptor(&d);
438 } 438 }
439 Handle<AccessorInfo> caller = 439 Handle<AccessorInfo> caller =
440 Accessors::FunctionCallerInfo(isolate(), attribs); 440 Accessors::FunctionCallerInfo(isolate(), attribs);
441 { // Add caller. 441 { // Add caller.
442 CallbacksDescriptor d(Handle<Name>(Name::cast(caller->name())), 442 AccessorConstantDescriptor d(Handle<Name>(Name::cast(caller->name())),
443 caller, attribs); 443 caller, attribs);
444 map->AppendDescriptor(&d); 444 map->AppendDescriptor(&d);
445 } 445 }
446 if (IsFunctionModeWithPrototype(function_mode)) { 446 if (IsFunctionModeWithPrototype(function_mode)) {
447 if (function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE) { 447 if (function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE) {
448 attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY); 448 attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY);
449 } 449 }
450 Handle<AccessorInfo> prototype = 450 Handle<AccessorInfo> prototype =
451 Accessors::FunctionPrototypeInfo(isolate(), attribs); 451 Accessors::FunctionPrototypeInfo(isolate(), attribs);
452 CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())), 452 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
453 prototype, attribs); 453 prototype, attribs);
454 map->AppendDescriptor(&d); 454 map->AppendDescriptor(&d);
455 } 455 }
456 } 456 }
457 457
458 458
459 Handle<Map> Genesis::CreateFunctionMap(FunctionMode function_mode) { 459 Handle<Map> Genesis::CreateFunctionMap(FunctionMode function_mode) {
460 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize); 460 Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
461 SetFunctionInstanceDescriptor(map, function_mode); 461 SetFunctionInstanceDescriptor(map, function_mode);
462 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode)); 462 map->set_function_with_prototype(IsFunctionModeWithPrototype(function_mode));
463 return map; 463 return map;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 Handle<AccessorPair> arguments(factory()->NewAccessorPair()); 567 Handle<AccessorPair> arguments(factory()->NewAccessorPair());
568 Handle<AccessorPair> caller(factory()->NewAccessorPair()); 568 Handle<AccessorPair> caller(factory()->NewAccessorPair());
569 PropertyAttributes rw_attribs = 569 PropertyAttributes rw_attribs =
570 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); 570 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
571 PropertyAttributes ro_attribs = 571 PropertyAttributes ro_attribs =
572 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 572 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
573 573
574 // Add length. 574 // Add length.
575 if (function_mode == BOUND_FUNCTION) { 575 if (function_mode == BOUND_FUNCTION) {
576 Handle<String> length_string = isolate()->factory()->length_string(); 576 Handle<String> length_string = isolate()->factory()->length_string();
577 FieldDescriptor d(length_string, 0, ro_attribs, Representation::Tagged()); 577 DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged());
578 map->AppendDescriptor(&d); 578 map->AppendDescriptor(&d);
579 } else { 579 } else {
580 DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || 580 DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ||
581 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE || 581 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE ||
582 function_mode == FUNCTION_WITHOUT_PROTOTYPE); 582 function_mode == FUNCTION_WITHOUT_PROTOTYPE);
583 Handle<AccessorInfo> length = 583 Handle<AccessorInfo> length =
584 Accessors::FunctionLengthInfo(isolate(), ro_attribs); 584 Accessors::FunctionLengthInfo(isolate(), ro_attribs);
585 CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())), 585 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
586 length, ro_attribs); 586 length, ro_attribs);
587 map->AppendDescriptor(&d); 587 map->AppendDescriptor(&d);
588 } 588 }
589 Handle<AccessorInfo> name = 589 Handle<AccessorInfo> name =
590 Accessors::FunctionNameInfo(isolate(), ro_attribs); 590 Accessors::FunctionNameInfo(isolate(), ro_attribs);
591 { // Add name. 591 { // Add name.
592 CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())), 592 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
593 name, ro_attribs); 593 ro_attribs);
594 map->AppendDescriptor(&d); 594 map->AppendDescriptor(&d);
595 } 595 }
596 { // Add arguments. 596 { // Add arguments.
597 CallbacksDescriptor d(factory()->arguments_string(), arguments, 597 AccessorConstantDescriptor d(factory()->arguments_string(), arguments,
598 rw_attribs); 598 rw_attribs);
599 map->AppendDescriptor(&d); 599 map->AppendDescriptor(&d);
600 } 600 }
601 { // Add caller. 601 { // Add caller.
602 CallbacksDescriptor d(factory()->caller_string(), caller, rw_attribs); 602 AccessorConstantDescriptor d(factory()->caller_string(), caller,
603 rw_attribs);
603 map->AppendDescriptor(&d); 604 map->AppendDescriptor(&d);
604 } 605 }
605 if (IsFunctionModeWithPrototype(function_mode)) { 606 if (IsFunctionModeWithPrototype(function_mode)) {
606 // Add prototype. 607 // Add prototype.
607 PropertyAttributes attribs = 608 PropertyAttributes attribs =
608 function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ? rw_attribs 609 function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ? rw_attribs
609 : ro_attribs; 610 : ro_attribs;
610 Handle<AccessorInfo> prototype = 611 Handle<AccessorInfo> prototype =
611 Accessors::FunctionPrototypeInfo(isolate(), attribs); 612 Accessors::FunctionPrototypeInfo(isolate(), attribs);
612 CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())), 613 AccessorConstantDescriptor d(Handle<Name>(Name::cast(prototype->name())),
613 prototype, attribs); 614 prototype, attribs);
614 map->AppendDescriptor(&d); 615 map->AppendDescriptor(&d);
615 } 616 }
616 } 617 }
617 618
618 619
619 // ECMAScript 5th Edition, 13.2.3 620 // ECMAScript 5th Edition, 13.2.3
620 Handle<JSFunction> Genesis::GetStrictPoisonFunction() { 621 Handle<JSFunction> Genesis::GetStrictPoisonFunction() {
621 if (strict_poison_function.is_null()) { 622 if (strict_poison_function.is_null()) {
622 Handle<String> name = factory()->InternalizeOneByteString( 623 Handle<String> name = factory()->InternalizeOneByteString(
623 STATIC_CHAR_VECTOR("ThrowTypeError")); 624 STATIC_CHAR_VECTOR("ThrowTypeError"));
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 accessors->set_setter(*func); 703 accessors->set_setter(*func);
703 } 704 }
704 705
705 706
706 static void ReplaceAccessors(Handle<Map> map, 707 static void ReplaceAccessors(Handle<Map> map,
707 Handle<String> name, 708 Handle<String> name,
708 PropertyAttributes attributes, 709 PropertyAttributes attributes,
709 Handle<AccessorPair> accessor_pair) { 710 Handle<AccessorPair> accessor_pair) {
710 DescriptorArray* descriptors = map->instance_descriptors(); 711 DescriptorArray* descriptors = map->instance_descriptors();
711 int idx = descriptors->SearchWithCache(*name, *map); 712 int idx = descriptors->SearchWithCache(*name, *map);
712 CallbacksDescriptor descriptor(name, accessor_pair, attributes); 713 AccessorConstantDescriptor descriptor(name, accessor_pair, attributes);
713 descriptors->Replace(idx, &descriptor); 714 descriptors->Replace(idx, &descriptor);
714 } 715 }
715 716
716 717
717 void Genesis::PoisonArgumentsAndCaller(Handle<Map> map) { 718 void Genesis::PoisonArgumentsAndCaller(Handle<Map> map) {
718 SetAccessors(map, factory()->arguments_string(), GetStrictPoisonFunction()); 719 SetAccessors(map, factory()->arguments_string(), GetStrictPoisonFunction());
719 SetAccessors(map, factory()->caller_string(), GetStrictPoisonFunction()); 720 SetAccessors(map, factory()->caller_string(), GetStrictPoisonFunction());
720 } 721 }
721 722
722 723
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 // HGraphBuilder::JSArrayBuilder::EmitMapCode() 943 // HGraphBuilder::JSArrayBuilder::EmitMapCode()
943 DCHECK(initial_map->elements_kind() == GetInitialFastElementsKind()); 944 DCHECK(initial_map->elements_kind() == GetInitialFastElementsKind());
944 Map::EnsureDescriptorSlack(initial_map, 1); 945 Map::EnsureDescriptorSlack(initial_map, 1);
945 946
946 PropertyAttributes attribs = static_cast<PropertyAttributes>( 947 PropertyAttributes attribs = static_cast<PropertyAttributes>(
947 DONT_ENUM | DONT_DELETE); 948 DONT_ENUM | DONT_DELETE);
948 949
949 Handle<AccessorInfo> array_length = 950 Handle<AccessorInfo> array_length =
950 Accessors::ArrayLengthInfo(isolate, attribs); 951 Accessors::ArrayLengthInfo(isolate, attribs);
951 { // Add length. 952 { // Add length.
952 CallbacksDescriptor d( 953 AccessorConstantDescriptor d(
953 Handle<Name>(Name::cast(array_length->name())), 954 Handle<Name>(Name::cast(array_length->name())), array_length,
954 array_length, attribs); 955 attribs);
955 initial_map->AppendDescriptor(&d); 956 initial_map->AppendDescriptor(&d);
956 } 957 }
957 958
958 // array_function is used internally. JS code creating array object should 959 // array_function is used internally. JS code creating array object should
959 // search for the 'Array' property on the global object and use that one 960 // search for the 'Array' property on the global object and use that one
960 // as the constructor. 'Array' property on a global object can be 961 // as the constructor. 'Array' property on a global object can be
961 // overwritten by JS code. 962 // overwritten by JS code.
962 native_context()->set_array_function(*array_function); 963 native_context()->set_array_function(*array_function);
963 964
964 // Cache the array maps, needed by ArrayConstructorStub 965 // Cache the array maps, needed by ArrayConstructorStub
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 Handle<Map> string_map = 997 Handle<Map> string_map =
997 Handle<Map>(native_context()->string_function()->initial_map()); 998 Handle<Map>(native_context()->string_function()->initial_map());
998 Map::EnsureDescriptorSlack(string_map, 1); 999 Map::EnsureDescriptorSlack(string_map, 1);
999 1000
1000 PropertyAttributes attribs = static_cast<PropertyAttributes>( 1001 PropertyAttributes attribs = static_cast<PropertyAttributes>(
1001 DONT_ENUM | DONT_DELETE | READ_ONLY); 1002 DONT_ENUM | DONT_DELETE | READ_ONLY);
1002 Handle<AccessorInfo> string_length( 1003 Handle<AccessorInfo> string_length(
1003 Accessors::StringLengthInfo(isolate, attribs)); 1004 Accessors::StringLengthInfo(isolate, attribs));
1004 1005
1005 { // Add length. 1006 { // Add length.
1006 CallbacksDescriptor d(factory->length_string(), string_length, attribs); 1007 AccessorConstantDescriptor d(factory->length_string(), string_length,
1008 attribs);
1007 string_map->AppendDescriptor(&d); 1009 string_map->AppendDescriptor(&d);
1008 } 1010 }
1009 } 1011 }
1010 1012
1011 { 1013 {
1012 // --- S y m b o l --- 1014 // --- S y m b o l ---
1013 Handle<JSFunction> symbol_fun = InstallFunction( 1015 Handle<JSFunction> symbol_fun = InstallFunction(
1014 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, 1016 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
1015 isolate->initial_object_prototype(), Builtins::kIllegal); 1017 isolate->initial_object_prototype(), Builtins::kIllegal);
1016 native_context()->set_symbol_function(*symbol_fun); 1018 native_context()->set_symbol_function(*symbol_fun);
(...skipping 24 matching lines...) Expand all
1041 DCHECK_EQ(0, initial_map->inobject_properties()); 1043 DCHECK_EQ(0, initial_map->inobject_properties());
1042 1044
1043 PropertyAttributes final = 1045 PropertyAttributes final =
1044 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1046 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1045 Map::EnsureDescriptorSlack(initial_map, 5); 1047 Map::EnsureDescriptorSlack(initial_map, 5);
1046 1048
1047 { 1049 {
1048 // ECMA-262, section 15.10.7.1. 1050 // ECMA-262, section 15.10.7.1.
1049 Handle<AccessorInfo> regexp_source( 1051 Handle<AccessorInfo> regexp_source(
1050 Accessors::RegExpSourceInfo(isolate, final)); 1052 Accessors::RegExpSourceInfo(isolate, final));
1051 CallbacksDescriptor d(factory->source_string(), regexp_source, final); 1053 AccessorConstantDescriptor d(factory->source_string(), regexp_source,
1054 final);
1052 initial_map->AppendDescriptor(&d); 1055 initial_map->AppendDescriptor(&d);
1053 } 1056 }
1054 { 1057 {
1055 // ECMA-262, section 15.10.7.2. 1058 // ECMA-262, section 15.10.7.2.
1056 FieldDescriptor field(factory->global_string(), 1059 DataDescriptor field(factory->global_string(),
1057 JSRegExp::kGlobalFieldIndex, 1060 JSRegExp::kGlobalFieldIndex, final,
1058 final, 1061 Representation::Tagged());
1059 Representation::Tagged());
1060 initial_map->AppendDescriptor(&field); 1062 initial_map->AppendDescriptor(&field);
1061 } 1063 }
1062 { 1064 {
1063 // ECMA-262, section 15.10.7.3. 1065 // ECMA-262, section 15.10.7.3.
1064 FieldDescriptor field(factory->ignore_case_string(), 1066 DataDescriptor field(factory->ignore_case_string(),
1065 JSRegExp::kIgnoreCaseFieldIndex, 1067 JSRegExp::kIgnoreCaseFieldIndex, final,
1066 final, 1068 Representation::Tagged());
1067 Representation::Tagged());
1068 initial_map->AppendDescriptor(&field); 1069 initial_map->AppendDescriptor(&field);
1069 } 1070 }
1070 { 1071 {
1071 // ECMA-262, section 15.10.7.4. 1072 // ECMA-262, section 15.10.7.4.
1072 FieldDescriptor field(factory->multiline_string(), 1073 DataDescriptor field(factory->multiline_string(),
1073 JSRegExp::kMultilineFieldIndex, 1074 JSRegExp::kMultilineFieldIndex, final,
1074 final, 1075 Representation::Tagged());
1075 Representation::Tagged());
1076 initial_map->AppendDescriptor(&field); 1076 initial_map->AppendDescriptor(&field);
1077 } 1077 }
1078 { 1078 {
1079 // ECMA-262, section 15.10.7.5. 1079 // ECMA-262, section 15.10.7.5.
1080 PropertyAttributes writable = 1080 PropertyAttributes writable =
1081 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); 1081 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
1082 FieldDescriptor field(factory->last_index_string(), 1082 DataDescriptor field(factory->last_index_string(),
1083 JSRegExp::kLastIndexFieldIndex, 1083 JSRegExp::kLastIndexFieldIndex, writable,
1084 writable, 1084 Representation::Tagged());
1085 Representation::Tagged());
1086 initial_map->AppendDescriptor(&field); 1085 initial_map->AppendDescriptor(&field);
1087 } 1086 }
1088 1087
1089 static const int num_fields = JSRegExp::kInObjectFieldCount; 1088 static const int num_fields = JSRegExp::kInObjectFieldCount;
1090 initial_map->set_inobject_properties(num_fields); 1089 initial_map->set_inobject_properties(num_fields);
1091 initial_map->set_pre_allocated_property_fields(num_fields); 1090 initial_map->set_pre_allocated_property_fields(num_fields);
1092 initial_map->set_unused_property_fields(0); 1091 initial_map->set_unused_property_fields(0);
1093 initial_map->set_instance_size(initial_map->instance_size() + 1092 initial_map->set_instance_size(initial_map->instance_size() +
1094 num_fields * kPointerSize); 1093 num_fields * kPointerSize);
1095 1094
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 Handle<JSFunction> object_function(native_context()->object_function()); 1171 Handle<JSFunction> object_function(native_context()->object_function());
1173 Handle<Map> iterator_result_map = 1172 Handle<Map> iterator_result_map =
1174 Map::Create(isolate, JSGeneratorObject::kResultPropertyCount); 1173 Map::Create(isolate, JSGeneratorObject::kResultPropertyCount);
1175 DCHECK_EQ(JSGeneratorObject::kResultSize, 1174 DCHECK_EQ(JSGeneratorObject::kResultSize,
1176 iterator_result_map->instance_size()); 1175 iterator_result_map->instance_size());
1177 DCHECK_EQ(JSGeneratorObject::kResultPropertyCount, 1176 DCHECK_EQ(JSGeneratorObject::kResultPropertyCount,
1178 iterator_result_map->inobject_properties()); 1177 iterator_result_map->inobject_properties());
1179 Map::EnsureDescriptorSlack(iterator_result_map, 1178 Map::EnsureDescriptorSlack(iterator_result_map,
1180 JSGeneratorObject::kResultPropertyCount); 1179 JSGeneratorObject::kResultPropertyCount);
1181 1180
1182 FieldDescriptor value_descr(factory->value_string(), 1181 DataDescriptor value_descr(factory->value_string(),
1183 JSGeneratorObject::kResultValuePropertyIndex, 1182 JSGeneratorObject::kResultValuePropertyIndex,
1184 NONE, Representation::Tagged()); 1183 NONE, Representation::Tagged());
1185 iterator_result_map->AppendDescriptor(&value_descr); 1184 iterator_result_map->AppendDescriptor(&value_descr);
1186 1185
1187 FieldDescriptor done_descr(factory->done_string(), 1186 DataDescriptor done_descr(factory->done_string(),
1188 JSGeneratorObject::kResultDonePropertyIndex, 1187 JSGeneratorObject::kResultDonePropertyIndex, NONE,
1189 NONE, Representation::Tagged()); 1188 Representation::Tagged());
1190 iterator_result_map->AppendDescriptor(&done_descr); 1189 iterator_result_map->AppendDescriptor(&done_descr);
1191 1190
1192 iterator_result_map->set_unused_property_fields(0); 1191 iterator_result_map->set_unused_property_fields(0);
1193 iterator_result_map->set_pre_allocated_property_fields( 1192 iterator_result_map->set_pre_allocated_property_fields(
1194 JSGeneratorObject::kResultPropertyCount); 1193 JSGeneratorObject::kResultPropertyCount);
1195 DCHECK_EQ(JSGeneratorObject::kResultSize, 1194 DCHECK_EQ(JSGeneratorObject::kResultSize,
1196 iterator_result_map->instance_size()); 1195 iterator_result_map->instance_size());
1197 native_context()->set_iterator_result_map(*iterator_result_map); 1196 native_context()->set_iterator_result_map(*iterator_result_map);
1198 } 1197 }
1199 1198
(...skipping 13 matching lines...) Expand all
1213 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( 1212 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype(
1214 arguments_string, code); 1213 arguments_string, code);
1215 function->shared()->set_instance_class_name(*arguments_string); 1214 function->shared()->set_instance_class_name(*arguments_string);
1216 1215
1217 Handle<Map> map = 1216 Handle<Map> map =
1218 factory->NewMap(JS_OBJECT_TYPE, Heap::kSloppyArgumentsObjectSize); 1217 factory->NewMap(JS_OBJECT_TYPE, Heap::kSloppyArgumentsObjectSize);
1219 // Create the descriptor array for the arguments object. 1218 // Create the descriptor array for the arguments object.
1220 Map::EnsureDescriptorSlack(map, 2); 1219 Map::EnsureDescriptorSlack(map, 2);
1221 1220
1222 { // length 1221 { // length
1223 FieldDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex, 1222 DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
1224 DONT_ENUM, Representation::Tagged()); 1223 DONT_ENUM, Representation::Tagged());
1225 map->AppendDescriptor(&d); 1224 map->AppendDescriptor(&d);
1226 } 1225 }
1227 { // callee 1226 { // callee
1228 FieldDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex, 1227 DataDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex,
1229 DONT_ENUM, Representation::Tagged()); 1228 DONT_ENUM, Representation::Tagged());
1230 map->AppendDescriptor(&d); 1229 map->AppendDescriptor(&d);
1231 } 1230 }
1232 // @@iterator method is added later. 1231 // @@iterator method is added later.
1233 1232
1234 map->set_function_with_prototype(true); 1233 map->set_function_with_prototype(true);
1235 map->set_pre_allocated_property_fields(2); 1234 map->set_pre_allocated_property_fields(2);
1236 map->set_inobject_properties(2); 1235 map->set_inobject_properties(2);
1237 native_context()->set_sloppy_arguments_map(*map); 1236 native_context()->set_sloppy_arguments_map(*map);
1238 1237
1239 DCHECK(!function->has_initial_map()); 1238 DCHECK(!function->has_initial_map());
(...skipping 30 matching lines...) Expand all
1270 caller->set_getter(*poison); 1269 caller->set_getter(*poison);
1271 caller->set_setter(*poison); 1270 caller->set_setter(*poison);
1272 1271
1273 // Create the map. Allocate one in-object field for length. 1272 // Create the map. Allocate one in-object field for length.
1274 Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, 1273 Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE,
1275 Heap::kStrictArgumentsObjectSize); 1274 Heap::kStrictArgumentsObjectSize);
1276 // Create the descriptor array for the arguments object. 1275 // Create the descriptor array for the arguments object.
1277 Map::EnsureDescriptorSlack(map, 3); 1276 Map::EnsureDescriptorSlack(map, 3);
1278 1277
1279 { // length 1278 { // length
1280 FieldDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex, 1279 DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
1281 DONT_ENUM, Representation::Tagged()); 1280 DONT_ENUM, Representation::Tagged());
1282 map->AppendDescriptor(&d); 1281 map->AppendDescriptor(&d);
1283 } 1282 }
1284 { // callee 1283 { // callee
1285 CallbacksDescriptor d(factory->callee_string(), callee, attributes); 1284 AccessorConstantDescriptor d(factory->callee_string(), callee,
1285 attributes);
1286 map->AppendDescriptor(&d); 1286 map->AppendDescriptor(&d);
1287 } 1287 }
1288 { // caller 1288 { // caller
1289 CallbacksDescriptor d(factory->caller_string(), caller, attributes); 1289 AccessorConstantDescriptor d(factory->caller_string(), caller,
1290 attributes);
1290 map->AppendDescriptor(&d); 1291 map->AppendDescriptor(&d);
1291 } 1292 }
1292 // @@iterator method is added later. 1293 // @@iterator method is added later.
1293 1294
1294 map->set_function_with_prototype(true); 1295 map->set_function_with_prototype(true);
1295 DCHECK_EQ(native_context()->object_function()->prototype(), 1296 DCHECK_EQ(native_context()->object_function()->prototype(),
1296 *isolate->initial_object_prototype()); 1297 *isolate->initial_object_prototype());
1297 map->SetPrototype(isolate->initial_object_prototype()); 1298 map->SetPrototype(isolate->initial_object_prototype());
1298 map->set_pre_allocated_property_fields(1); 1299 map->set_pre_allocated_property_fields(1);
1299 map->set_inobject_properties(1); 1300 map->set_inobject_properties(1);
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 1680
1680 // Make "length" magic on instances. 1681 // Make "length" magic on instances.
1681 Map::EnsureDescriptorSlack(initial_map, 1); 1682 Map::EnsureDescriptorSlack(initial_map, 1);
1682 1683
1683 PropertyAttributes attribs = static_cast<PropertyAttributes>( 1684 PropertyAttributes attribs = static_cast<PropertyAttributes>(
1684 DONT_ENUM | DONT_DELETE); 1685 DONT_ENUM | DONT_DELETE);
1685 1686
1686 Handle<AccessorInfo> array_length = 1687 Handle<AccessorInfo> array_length =
1687 Accessors::ArrayLengthInfo(isolate(), attribs); 1688 Accessors::ArrayLengthInfo(isolate(), attribs);
1688 { // Add length. 1689 { // Add length.
1689 CallbacksDescriptor d( 1690 AccessorConstantDescriptor d(Handle<Name>(Name::cast(array_length->name())),
1690 Handle<Name>(Name::cast(array_length->name())), array_length, attribs); 1691 array_length, attribs);
1691 initial_map->AppendDescriptor(&d); 1692 initial_map->AppendDescriptor(&d);
1692 } 1693 }
1693 1694
1694 return array_function; 1695 return array_function;
1695 } 1696 }
1696 1697
1697 1698
1698 bool Genesis::InstallNatives() { 1699 bool Genesis::InstallNatives() {
1699 HandleScope scope(isolate()); 1700 HandleScope scope(isolate());
1700 1701
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 1763
1763 Handle<Map> script_map = Handle<Map>(script_fun->initial_map()); 1764 Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1764 Map::EnsureDescriptorSlack(script_map, 14); 1765 Map::EnsureDescriptorSlack(script_map, 14);
1765 1766
1766 PropertyAttributes attribs = 1767 PropertyAttributes attribs =
1767 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1768 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1768 1769
1769 Handle<AccessorInfo> script_column = 1770 Handle<AccessorInfo> script_column =
1770 Accessors::ScriptColumnOffsetInfo(isolate(), attribs); 1771 Accessors::ScriptColumnOffsetInfo(isolate(), attribs);
1771 { 1772 {
1772 CallbacksDescriptor d(Handle<Name>(Name::cast(script_column->name())), 1773 AccessorConstantDescriptor d(
1773 script_column, attribs); 1774 Handle<Name>(Name::cast(script_column->name())), script_column,
1775 attribs);
1774 script_map->AppendDescriptor(&d); 1776 script_map->AppendDescriptor(&d);
1775 } 1777 }
1776 1778
1777 Handle<AccessorInfo> script_id = 1779 Handle<AccessorInfo> script_id =
1778 Accessors::ScriptIdInfo(isolate(), attribs); 1780 Accessors::ScriptIdInfo(isolate(), attribs);
1779 { 1781 {
1780 CallbacksDescriptor d(Handle<Name>(Name::cast(script_id->name())), 1782 AccessorConstantDescriptor d(Handle<Name>(Name::cast(script_id->name())),
1781 script_id, attribs); 1783 script_id, attribs);
1782 script_map->AppendDescriptor(&d); 1784 script_map->AppendDescriptor(&d);
1783 } 1785 }
1784 1786
1785 1787
1786 Handle<AccessorInfo> script_name = 1788 Handle<AccessorInfo> script_name =
1787 Accessors::ScriptNameInfo(isolate(), attribs); 1789 Accessors::ScriptNameInfo(isolate(), attribs);
1788 { 1790 {
1789 CallbacksDescriptor d(Handle<Name>(Name::cast(script_name->name())), 1791 AccessorConstantDescriptor d(
1790 script_name, attribs); 1792 Handle<Name>(Name::cast(script_name->name())), script_name, attribs);
1791 script_map->AppendDescriptor(&d); 1793 script_map->AppendDescriptor(&d);
1792 } 1794 }
1793 1795
1794 Handle<AccessorInfo> script_line = 1796 Handle<AccessorInfo> script_line =
1795 Accessors::ScriptLineOffsetInfo(isolate(), attribs); 1797 Accessors::ScriptLineOffsetInfo(isolate(), attribs);
1796 { 1798 {
1797 CallbacksDescriptor d(Handle<Name>(Name::cast(script_line->name())), 1799 AccessorConstantDescriptor d(
1798 script_line, attribs); 1800 Handle<Name>(Name::cast(script_line->name())), script_line, attribs);
1799 script_map->AppendDescriptor(&d); 1801 script_map->AppendDescriptor(&d);
1800 } 1802 }
1801 1803
1802 Handle<AccessorInfo> script_source = 1804 Handle<AccessorInfo> script_source =
1803 Accessors::ScriptSourceInfo(isolate(), attribs); 1805 Accessors::ScriptSourceInfo(isolate(), attribs);
1804 { 1806 {
1805 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source->name())), 1807 AccessorConstantDescriptor d(
1806 script_source, attribs); 1808 Handle<Name>(Name::cast(script_source->name())), script_source,
1809 attribs);
1807 script_map->AppendDescriptor(&d); 1810 script_map->AppendDescriptor(&d);
1808 } 1811 }
1809 1812
1810 Handle<AccessorInfo> script_type = 1813 Handle<AccessorInfo> script_type =
1811 Accessors::ScriptTypeInfo(isolate(), attribs); 1814 Accessors::ScriptTypeInfo(isolate(), attribs);
1812 { 1815 {
1813 CallbacksDescriptor d(Handle<Name>(Name::cast(script_type->name())), 1816 AccessorConstantDescriptor d(
1814 script_type, attribs); 1817 Handle<Name>(Name::cast(script_type->name())), script_type, attribs);
1815 script_map->AppendDescriptor(&d); 1818 script_map->AppendDescriptor(&d);
1816 } 1819 }
1817 1820
1818 Handle<AccessorInfo> script_compilation_type = 1821 Handle<AccessorInfo> script_compilation_type =
1819 Accessors::ScriptCompilationTypeInfo(isolate(), attribs); 1822 Accessors::ScriptCompilationTypeInfo(isolate(), attribs);
1820 { 1823 {
1821 CallbacksDescriptor d( 1824 AccessorConstantDescriptor d(
1822 Handle<Name>(Name::cast(script_compilation_type->name())), 1825 Handle<Name>(Name::cast(script_compilation_type->name())),
1823 script_compilation_type, attribs); 1826 script_compilation_type, attribs);
1824 script_map->AppendDescriptor(&d); 1827 script_map->AppendDescriptor(&d);
1825 } 1828 }
1826 1829
1827 Handle<AccessorInfo> script_line_ends = 1830 Handle<AccessorInfo> script_line_ends =
1828 Accessors::ScriptLineEndsInfo(isolate(), attribs); 1831 Accessors::ScriptLineEndsInfo(isolate(), attribs);
1829 { 1832 {
1830 CallbacksDescriptor d(Handle<Name>(Name::cast(script_line_ends->name())), 1833 AccessorConstantDescriptor d(
1831 script_line_ends, attribs); 1834 Handle<Name>(Name::cast(script_line_ends->name())), script_line_ends,
1835 attribs);
1832 script_map->AppendDescriptor(&d); 1836 script_map->AppendDescriptor(&d);
1833 } 1837 }
1834 1838
1835 Handle<AccessorInfo> script_context_data = 1839 Handle<AccessorInfo> script_context_data =
1836 Accessors::ScriptContextDataInfo(isolate(), attribs); 1840 Accessors::ScriptContextDataInfo(isolate(), attribs);
1837 { 1841 {
1838 CallbacksDescriptor d( 1842 AccessorConstantDescriptor d(
1839 Handle<Name>(Name::cast(script_context_data->name())), 1843 Handle<Name>(Name::cast(script_context_data->name())),
1840 script_context_data, attribs); 1844 script_context_data, attribs);
1841 script_map->AppendDescriptor(&d); 1845 script_map->AppendDescriptor(&d);
1842 } 1846 }
1843 1847
1844 Handle<AccessorInfo> script_eval_from_script = 1848 Handle<AccessorInfo> script_eval_from_script =
1845 Accessors::ScriptEvalFromScriptInfo(isolate(), attribs); 1849 Accessors::ScriptEvalFromScriptInfo(isolate(), attribs);
1846 { 1850 {
1847 CallbacksDescriptor d( 1851 AccessorConstantDescriptor d(
1848 Handle<Name>(Name::cast(script_eval_from_script->name())), 1852 Handle<Name>(Name::cast(script_eval_from_script->name())),
1849 script_eval_from_script, attribs); 1853 script_eval_from_script, attribs);
1850 script_map->AppendDescriptor(&d); 1854 script_map->AppendDescriptor(&d);
1851 } 1855 }
1852 1856
1853 Handle<AccessorInfo> script_eval_from_script_position = 1857 Handle<AccessorInfo> script_eval_from_script_position =
1854 Accessors::ScriptEvalFromScriptPositionInfo(isolate(), attribs); 1858 Accessors::ScriptEvalFromScriptPositionInfo(isolate(), attribs);
1855 { 1859 {
1856 CallbacksDescriptor d( 1860 AccessorConstantDescriptor d(
1857 Handle<Name>(Name::cast(script_eval_from_script_position->name())), 1861 Handle<Name>(Name::cast(script_eval_from_script_position->name())),
1858 script_eval_from_script_position, attribs); 1862 script_eval_from_script_position, attribs);
1859 script_map->AppendDescriptor(&d); 1863 script_map->AppendDescriptor(&d);
1860 } 1864 }
1861 1865
1862 Handle<AccessorInfo> script_eval_from_function_name = 1866 Handle<AccessorInfo> script_eval_from_function_name =
1863 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs); 1867 Accessors::ScriptEvalFromFunctionNameInfo(isolate(), attribs);
1864 { 1868 {
1865 CallbacksDescriptor d( 1869 AccessorConstantDescriptor d(
1866 Handle<Name>(Name::cast(script_eval_from_function_name->name())), 1870 Handle<Name>(Name::cast(script_eval_from_function_name->name())),
1867 script_eval_from_function_name, attribs); 1871 script_eval_from_function_name, attribs);
1868 script_map->AppendDescriptor(&d); 1872 script_map->AppendDescriptor(&d);
1869 } 1873 }
1870 1874
1871 Handle<AccessorInfo> script_source_url = 1875 Handle<AccessorInfo> script_source_url =
1872 Accessors::ScriptSourceUrlInfo(isolate(), attribs); 1876 Accessors::ScriptSourceUrlInfo(isolate(), attribs);
1873 { 1877 {
1874 CallbacksDescriptor d(Handle<Name>(Name::cast(script_source_url->name())), 1878 AccessorConstantDescriptor d(
1875 script_source_url, attribs); 1879 Handle<Name>(Name::cast(script_source_url->name())),
1880 script_source_url, attribs);
1876 script_map->AppendDescriptor(&d); 1881 script_map->AppendDescriptor(&d);
1877 } 1882 }
1878 1883
1879 Handle<AccessorInfo> script_source_mapping_url = 1884 Handle<AccessorInfo> script_source_mapping_url =
1880 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs); 1885 Accessors::ScriptSourceMappingUrlInfo(isolate(), attribs);
1881 { 1886 {
1882 CallbacksDescriptor d( 1887 AccessorConstantDescriptor d(
1883 Handle<Name>(Name::cast(script_source_mapping_url->name())), 1888 Handle<Name>(Name::cast(script_source_mapping_url->name())),
1884 script_source_mapping_url, attribs); 1889 script_source_mapping_url, attribs);
1885 script_map->AppendDescriptor(&d); 1890 script_map->AppendDescriptor(&d);
1886 } 1891 }
1887 1892
1888 // Allocate the empty script. 1893 // Allocate the empty script.
1889 Handle<Script> script = factory()->NewScript(factory()->empty_string()); 1894 Handle<Script> script = factory()->NewScript(factory()->empty_string());
1890 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 1895 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
1891 heap()->public_set_empty_script(*script); 1896 heap()->public_set_empty_script(*script);
1892 } 1897 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 Map::EnsureDescriptorSlack(initial_map, 3); 2102 Map::EnsureDescriptorSlack(initial_map, 3);
2098 2103
2099 { 2104 {
2100 JSFunction* array_function = native_context()->array_function(); 2105 JSFunction* array_function = native_context()->array_function();
2101 Handle<DescriptorArray> array_descriptors( 2106 Handle<DescriptorArray> array_descriptors(
2102 array_function->initial_map()->instance_descriptors()); 2107 array_function->initial_map()->instance_descriptors());
2103 Handle<String> length = factory()->length_string(); 2108 Handle<String> length = factory()->length_string();
2104 int old = array_descriptors->SearchWithCache( 2109 int old = array_descriptors->SearchWithCache(
2105 *length, array_function->initial_map()); 2110 *length, array_function->initial_map());
2106 DCHECK(old != DescriptorArray::kNotFound); 2111 DCHECK(old != DescriptorArray::kNotFound);
2107 CallbacksDescriptor desc(length, 2112 AccessorConstantDescriptor desc(
2108 handle(array_descriptors->GetValue(old), 2113 length, handle(array_descriptors->GetValue(old), isolate()),
2109 isolate()), 2114 array_descriptors->GetDetails(old).attributes());
2110 array_descriptors->GetDetails(old).attributes());
2111 initial_map->AppendDescriptor(&desc); 2115 initial_map->AppendDescriptor(&desc);
2112 } 2116 }
2113 { 2117 {
2114 FieldDescriptor index_field(factory()->index_string(), 2118 DataDescriptor index_field(factory()->index_string(),
2115 JSRegExpResult::kIndexIndex, 2119 JSRegExpResult::kIndexIndex, NONE,
2116 NONE, 2120 Representation::Tagged());
2117 Representation::Tagged());
2118 initial_map->AppendDescriptor(&index_field); 2121 initial_map->AppendDescriptor(&index_field);
2119 } 2122 }
2120 2123
2121 { 2124 {
2122 FieldDescriptor input_field(factory()->input_string(), 2125 DataDescriptor input_field(factory()->input_string(),
2123 JSRegExpResult::kInputIndex, 2126 JSRegExpResult::kInputIndex, NONE,
2124 NONE, 2127 Representation::Tagged());
2125 Representation::Tagged());
2126 initial_map->AppendDescriptor(&input_field); 2128 initial_map->AppendDescriptor(&input_field);
2127 } 2129 }
2128 2130
2129 initial_map->set_inobject_properties(2); 2131 initial_map->set_inobject_properties(2);
2130 initial_map->set_pre_allocated_property_fields(2); 2132 initial_map->set_pre_allocated_property_fields(2);
2131 initial_map->set_unused_property_fields(0); 2133 initial_map->set_unused_property_fields(0);
2132 2134
2133 native_context()->set_regexp_result_map(*initial_map); 2135 native_context()->set_regexp_result_map(*initial_map);
2134 } 2136 }
2135 2137
2136 // Add @@iterator method to the arguments object maps. 2138 // Add @@iterator method to the arguments object maps.
2137 { 2139 {
2138 PropertyAttributes attribs = DONT_ENUM; 2140 PropertyAttributes attribs = DONT_ENUM;
2139 Handle<AccessorInfo> arguments_iterator = 2141 Handle<AccessorInfo> arguments_iterator =
2140 Accessors::ArgumentsIteratorInfo(isolate(), attribs); 2142 Accessors::ArgumentsIteratorInfo(isolate(), attribs);
2141 { 2143 {
2142 CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator, 2144 AccessorConstantDescriptor d(factory()->iterator_symbol(),
2143 attribs); 2145 arguments_iterator, attribs);
2144 Handle<Map> map(native_context()->sloppy_arguments_map()); 2146 Handle<Map> map(native_context()->sloppy_arguments_map());
2145 Map::EnsureDescriptorSlack(map, 1); 2147 Map::EnsureDescriptorSlack(map, 1);
2146 map->AppendDescriptor(&d); 2148 map->AppendDescriptor(&d);
2147 } 2149 }
2148 { 2150 {
2149 CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator, 2151 AccessorConstantDescriptor d(factory()->iterator_symbol(),
2150 attribs); 2152 arguments_iterator, attribs);
2151 Handle<Map> map(native_context()->aliased_arguments_map()); 2153 Handle<Map> map(native_context()->aliased_arguments_map());
2152 Map::EnsureDescriptorSlack(map, 1); 2154 Map::EnsureDescriptorSlack(map, 1);
2153 map->AppendDescriptor(&d); 2155 map->AppendDescriptor(&d);
2154 } 2156 }
2155 { 2157 {
2156 CallbacksDescriptor d(factory()->iterator_symbol(), arguments_iterator, 2158 AccessorConstantDescriptor d(factory()->iterator_symbol(),
2157 attribs); 2159 arguments_iterator, attribs);
2158 Handle<Map> map(native_context()->strict_arguments_map()); 2160 Handle<Map> map(native_context()->strict_arguments_map());
2159 Map::EnsureDescriptorSlack(map, 1); 2161 Map::EnsureDescriptorSlack(map, 1);
2160 map->AppendDescriptor(&d); 2162 map->AppendDescriptor(&d);
2161 } 2163 }
2162 } 2164 }
2163 2165
2164 #ifdef VERIFY_HEAP 2166 #ifdef VERIFY_HEAP
2165 builtins->ObjectVerify(); 2167 builtins->ObjectVerify();
2166 #endif 2168 #endif
2167 2169
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 // it is likely due to both global objects sharing property name(s). 2576 // it is likely due to both global objects sharing property name(s).
2575 // Merging those two global objects is impossible. 2577 // Merging those two global objects is impossible.
2576 // The global template must not create properties that already exist 2578 // The global template must not create properties that already exist
2577 // in the snapshotted global object. 2579 // in the snapshotted global object.
2578 if (from->HasFastProperties()) { 2580 if (from->HasFastProperties()) {
2579 Handle<DescriptorArray> descs = 2581 Handle<DescriptorArray> descs =
2580 Handle<DescriptorArray>(from->map()->instance_descriptors()); 2582 Handle<DescriptorArray>(from->map()->instance_descriptors());
2581 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) { 2583 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) {
2582 PropertyDetails details = descs->GetDetails(i); 2584 PropertyDetails details = descs->GetDetails(i);
2583 switch (details.type()) { 2585 switch (details.type()) {
2584 case FIELD: { 2586 case DATA: {
2585 HandleScope inner(isolate()); 2587 HandleScope inner(isolate());
2586 Handle<Name> key = Handle<Name>(descs->GetKey(i)); 2588 Handle<Name> key = Handle<Name>(descs->GetKey(i));
2587 FieldIndex index = FieldIndex::ForDescriptor(from->map(), i); 2589 FieldIndex index = FieldIndex::ForDescriptor(from->map(), i);
2588 DCHECK(!descs->GetDetails(i).representation().IsDouble()); 2590 DCHECK(!descs->GetDetails(i).representation().IsDouble());
2589 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index), 2591 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index),
2590 isolate()); 2592 isolate());
2591 JSObject::AddProperty(to, key, value, details.attributes()); 2593 JSObject::AddProperty(to, key, value, details.attributes());
2592 break; 2594 break;
2593 } 2595 }
2594 case CONSTANT: { 2596 case DATA_CONSTANT: {
2595 HandleScope inner(isolate()); 2597 HandleScope inner(isolate());
2596 Handle<Name> key = Handle<Name>(descs->GetKey(i)); 2598 Handle<Name> key = Handle<Name>(descs->GetKey(i));
2597 Handle<Object> constant(descs->GetConstant(i), isolate()); 2599 Handle<Object> constant(descs->GetConstant(i), isolate());
2598 JSObject::AddProperty(to, key, constant, details.attributes()); 2600 JSObject::AddProperty(to, key, constant, details.attributes());
2599 break; 2601 break;
2600 } 2602 }
2601 case ACCESSOR_FIELD: 2603 case ACCESSOR:
2602 UNREACHABLE(); 2604 UNREACHABLE();
2603 case CALLBACKS: { 2605 case ACCESSOR_CONSTANT: {
2604 Handle<Name> key(descs->GetKey(i)); 2606 Handle<Name> key(descs->GetKey(i));
2605 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); 2607 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR);
2606 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); 2608 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state());
2607 // If the property is already there we skip it 2609 // If the property is already there we skip it
2608 if (it.IsFound()) continue; 2610 if (it.IsFound()) continue;
2609 HandleScope inner(isolate()); 2611 HandleScope inner(isolate());
2610 DCHECK(!to->HasFastProperties()); 2612 DCHECK(!to->HasFastProperties());
2611 // Add to dictionary. 2613 // Add to dictionary.
2612 Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate()); 2614 Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate());
2613 PropertyDetails d(details.attributes(), CALLBACKS, i + 1); 2615 PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1);
2614 JSObject::SetNormalizedProperty(to, key, callbacks, d); 2616 JSObject::SetNormalizedProperty(to, key, callbacks, d);
2615 break; 2617 break;
2616 } 2618 }
2617 } 2619 }
2618 } 2620 }
2619 } else { 2621 } else {
2620 Handle<NameDictionary> properties = 2622 Handle<NameDictionary> properties =
2621 Handle<NameDictionary>(from->property_dictionary()); 2623 Handle<NameDictionary>(from->property_dictionary());
2622 int capacity = properties->Capacity(); 2624 int capacity = properties->Capacity();
2623 for (int i = 0; i < capacity; i++) { 2625 for (int i = 0; i < capacity; i++) {
2624 Object* raw_key(properties->KeyAt(i)); 2626 Object* raw_key(properties->KeyAt(i));
2625 if (properties->IsKey(raw_key)) { 2627 if (properties->IsKey(raw_key)) {
2626 DCHECK(raw_key->IsName()); 2628 DCHECK(raw_key->IsName());
2627 // If the property is already there we skip it. 2629 // If the property is already there we skip it.
2628 Handle<Name> key(Name::cast(raw_key)); 2630 Handle<Name> key(Name::cast(raw_key));
2629 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR); 2631 LookupIterator it(to, key, LookupIterator::OWN_SKIP_INTERCEPTOR);
2630 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); 2632 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state());
2631 if (it.IsFound()) continue; 2633 if (it.IsFound()) continue;
2632 // Set the property. 2634 // Set the property.
2633 Handle<Object> value = Handle<Object>(properties->ValueAt(i), 2635 Handle<Object> value = Handle<Object>(properties->ValueAt(i),
2634 isolate()); 2636 isolate());
2635 DCHECK(!value->IsCell()); 2637 DCHECK(!value->IsCell());
2636 if (value->IsPropertyCell()) { 2638 if (value->IsPropertyCell()) {
2637 value = Handle<Object>(PropertyCell::cast(*value)->value(), 2639 value = Handle<Object>(PropertyCell::cast(*value)->value(),
2638 isolate()); 2640 isolate());
2639 } 2641 }
2640 PropertyDetails details = properties->DetailsAt(i); 2642 PropertyDetails details = properties->DetailsAt(i);
2641 DCHECK_EQ(DATA, details.kind()); 2643 DCHECK_EQ(kData, details.kind());
2642 JSObject::AddProperty(to, key, value, details.attributes()); 2644 JSObject::AddProperty(to, key, value, details.attributes());
2643 } 2645 }
2644 } 2646 }
2645 } 2647 }
2646 } 2648 }
2647 2649
2648 2650
2649 void Genesis::TransferIndexedProperties(Handle<JSObject> from, 2651 void Genesis::TransferIndexedProperties(Handle<JSObject> from,
2650 Handle<JSObject> to) { 2652 Handle<JSObject> to) {
2651 // Cloning the elements array is sufficient. 2653 // Cloning the elements array is sufficient.
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 return from + sizeof(NestingCounterType); 2857 return from + sizeof(NestingCounterType);
2856 } 2858 }
2857 2859
2858 2860
2859 // Called when the top-level V8 mutex is destroyed. 2861 // Called when the top-level V8 mutex is destroyed.
2860 void Bootstrapper::FreeThreadResources() { 2862 void Bootstrapper::FreeThreadResources() {
2861 DCHECK(!IsActive()); 2863 DCHECK(!IsActive());
2862 } 2864 }
2863 2865
2864 } } // namespace v8::internal 2866 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698