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

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

Powered by Google App Engine
This is Rietveld 408576698