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

Side by Side Diff: src/objects.cc

Issue 194783002: Use MigrateToMap instead of set_map to update the map of a JSObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 static Handle<Object> NewStorageFor(Isolate* isolate, 1968 static Handle<Object> NewStorageFor(Isolate* isolate,
1969 Handle<Object> object, 1969 Handle<Object> object,
1970 Representation representation) { 1970 Representation representation) {
1971 Heap* heap = isolate->heap(); 1971 Heap* heap = isolate->heap();
1972 CALL_HEAP_FUNCTION(isolate, 1972 CALL_HEAP_FUNCTION(isolate,
1973 object->AllocateNewStorageFor(heap, representation), 1973 object->AllocateNewStorageFor(heap, representation),
1974 Object); 1974 Object);
1975 } 1975 }
1976 1976
1977 1977
1978 void JSObject::AddFastPropertyUsingMap(Handle<JSObject> object,
1979 Handle<Map> new_map,
1980 Handle<Name> name,
1981 Handle<Object> value,
1982 int field_index,
1983 Representation representation) {
1984 Isolate* isolate = object->GetIsolate();
1985
1986 // This method is used to transition to a field. If we are transitioning to a
1987 // double field, allocate new storage.
1988 Handle<Object> storage = NewStorageFor(isolate, value, representation);
1989
1990 if (object->map()->unused_property_fields() == 0) {
1991 int new_unused = new_map->unused_property_fields();
1992 Handle<FixedArray> properties(object->properties());
1993 Handle<FixedArray> values = isolate->factory()->CopySizeFixedArray(
1994 properties, properties->length() + new_unused + 1);
1995 object->set_properties(*values);
1996 }
1997
1998 object->set_map(*new_map);
1999 object->FastPropertyAtPut(field_index, *storage);
2000 }
2001
2002
2003 static MaybeObject* CopyAddFieldDescriptor(Map* map, 1978 static MaybeObject* CopyAddFieldDescriptor(Map* map,
2004 Name* name, 1979 Name* name,
2005 int index, 1980 int index,
2006 PropertyAttributes attributes, 1981 PropertyAttributes attributes,
2007 Representation representation, 1982 Representation representation,
2008 TransitionFlag flag) { 1983 TransitionFlag flag) {
2009 Map* new_map; 1984 Map* new_map;
2010 FieldDescriptor new_field_desc(name, index, attributes, representation); 1985 FieldDescriptor new_field_desc(name, index, attributes, representation);
2011 MaybeObject* maybe_map = map->CopyAddDescriptor(&new_field_desc, flag); 1986 MaybeObject* maybe_map = map->CopyAddDescriptor(&new_field_desc, flag);
2012 if (!maybe_map->To(&new_map)) return maybe_map; 1987 if (!maybe_map->To(&new_map)) return maybe_map;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 2032
2058 // Compute the new index for new field. 2033 // Compute the new index for new field.
2059 int index = object->map()->NextFreePropertyIndex(); 2034 int index = object->map()->NextFreePropertyIndex();
2060 2035
2061 // Allocate new instance descriptors with (name, index) added 2036 // Allocate new instance descriptors with (name, index) added
2062 if (object->IsJSContextExtensionObject()) value_type = FORCE_TAGGED; 2037 if (object->IsJSContextExtensionObject()) value_type = FORCE_TAGGED;
2063 Representation representation = value->OptimalRepresentation(value_type); 2038 Representation representation = value->OptimalRepresentation(value_type);
2064 Handle<Map> new_map = CopyAddFieldDescriptor( 2039 Handle<Map> new_map = CopyAddFieldDescriptor(
2065 handle(object->map()), name, index, attributes, representation, flag); 2040 handle(object->map()), name, index, attributes, representation, flag);
2066 2041
2067 AddFastPropertyUsingMap(object, new_map, name, value, index, representation); 2042 JSObject::MigrateToMap(object, new_map);
2043
2044 if (representation.IsDouble()) {
2045 // Nothing more to be done.
2046 if (value->IsUninitialized()) return;
2047 HeapNumber* box = HeapNumber::cast(object->RawFastPropertyAt(index));
2048 box->set_value(value->Number());
2049 } else {
2050 object->FastPropertyAtPut(index, *value);
2051 }
2068 } 2052 }
2069 2053
2070 2054
2071 static MaybeObject* CopyAddConstantDescriptor(Map* map, 2055 static MaybeObject* CopyAddConstantDescriptor(Map* map,
2072 Name* name, 2056 Name* name,
2073 Object* value, 2057 Object* value,
2074 PropertyAttributes attributes, 2058 PropertyAttributes attributes,
2075 TransitionFlag flag) { 2059 TransitionFlag flag) {
2076 ConstantDescriptor new_constant_desc(name, value, attributes); 2060 ConstantDescriptor new_constant_desc(name, value, attributes);
2077 return map->CopyAddDescriptor(&new_constant_desc, flag); 2061 return map->CopyAddDescriptor(&new_constant_desc, flag);
(...skipping 23 matching lines...) Expand all
2101 // Don't add transitions to special properties with non-trivial 2085 // Don't add transitions to special properties with non-trivial
2102 // attributes. 2086 // attributes.
2103 attributes != NONE) 2087 attributes != NONE)
2104 ? OMIT_TRANSITION 2088 ? OMIT_TRANSITION
2105 : initial_flag; 2089 : initial_flag;
2106 2090
2107 // Allocate new instance descriptors with (name, constant) added. 2091 // Allocate new instance descriptors with (name, constant) added.
2108 Handle<Map> new_map = CopyAddConstantDescriptor( 2092 Handle<Map> new_map = CopyAddConstantDescriptor(
2109 handle(object->map()), name, constant, attributes, flag); 2093 handle(object->map()), name, constant, attributes, flag);
2110 2094
2111 object->set_map(*new_map); 2095 JSObject::MigrateToMap(object, new_map);
2112 } 2096 }
2113 2097
2114 2098
2115 void JSObject::AddSlowProperty(Handle<JSObject> object, 2099 void JSObject::AddSlowProperty(Handle<JSObject> object,
2116 Handle<Name> name, 2100 Handle<Name> name,
2117 Handle<Object> value, 2101 Handle<Object> value,
2118 PropertyAttributes attributes) { 2102 PropertyAttributes attributes) {
2119 ASSERT(!object->HasFastProperties()); 2103 ASSERT(!object->HasFastProperties());
2120 Isolate* isolate = object->GetIsolate(); 2104 Isolate* isolate = object->GetIsolate();
2121 Handle<NameDictionary> dict(object->property_dictionary()); 2105 Handle<NameDictionary> dict(object->property_dictionary());
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2344 profiler->UpdateObjectSizeEvent(elms->address(), elms->Size()); 2328 profiler->UpdateObjectSizeEvent(elms->address(), elms->Size());
2345 } 2329 }
2346 } 2330 }
2347 2331
2348 2332
2349 bool Map::InstancesNeedRewriting(Map* target, 2333 bool Map::InstancesNeedRewriting(Map* target,
2350 int target_number_of_fields, 2334 int target_number_of_fields,
2351 int target_inobject, 2335 int target_inobject,
2352 int target_unused) { 2336 int target_unused) {
2353 // If fields were added (or removed), rewrite the instance. 2337 // If fields were added (or removed), rewrite the instance.
2354 int number_of_fields = NumberOfFields(); 2338 int number_of_fields = NumberOfFields(NumberOfOwnDescriptors());
Igor Sheludko 2014/03/11 14:17:37 NumberOfFields() would be also fine here.
2355 ASSERT(target_number_of_fields >= number_of_fields); 2339 ASSERT(target_number_of_fields >= number_of_fields);
2356 if (target_number_of_fields != number_of_fields) return true; 2340 if (target_number_of_fields != number_of_fields) return true;
2357 2341
2358 // If smi descriptors were replaced by double descriptors, rewrite. 2342 // If smi descriptors were replaced by double descriptors, rewrite.
2359 DescriptorArray* old_desc = instance_descriptors(); 2343 DescriptorArray* old_desc = instance_descriptors();
2360 DescriptorArray* new_desc = target->instance_descriptors(); 2344 DescriptorArray* new_desc = target->instance_descriptors();
2361 int limit = NumberOfOwnDescriptors(); 2345 int limit = NumberOfOwnDescriptors();
2362 for (int i = 0; i < limit; i++) { 2346 for (int i = 0; i < limit; i++) {
2363 if (new_desc->GetDetails(i).representation().IsDouble() && 2347 if (new_desc->GetDetails(i).representation().IsDouble() &&
2364 !old_desc->GetDetails(i).representation().IsDouble()) { 2348 !old_desc->GetDetails(i).representation().IsDouble()) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 object->set_map(*new_map); 2395 object->set_map(*new_map);
2412 return; 2396 return;
2413 } 2397 }
2414 2398
2415 int total_size = number_of_fields + unused; 2399 int total_size = number_of_fields + unused;
2416 int external = total_size - inobject; 2400 int external = total_size - inobject;
2417 Handle<FixedArray> array = isolate->factory()->NewFixedArray(total_size); 2401 Handle<FixedArray> array = isolate->factory()->NewFixedArray(total_size);
2418 2402
2419 Handle<DescriptorArray> old_descriptors(old_map->instance_descriptors()); 2403 Handle<DescriptorArray> old_descriptors(old_map->instance_descriptors());
2420 Handle<DescriptorArray> new_descriptors(new_map->instance_descriptors()); 2404 Handle<DescriptorArray> new_descriptors(new_map->instance_descriptors());
2421 int descriptors = new_map->NumberOfOwnDescriptors(); 2405 int old_nof = old_map->NumberOfOwnDescriptors();
2406 int new_nof = new_map->NumberOfOwnDescriptors();
2422 2407
2423 for (int i = 0; i < descriptors; i++) { 2408 // This method only supports generalizing instances to at least the same
2409 // number of properties.
2410 ASSERT(old_nof <= new_nof);
2411
2412 for (int i = 0; i < old_nof; i++) {
2424 PropertyDetails details = new_descriptors->GetDetails(i); 2413 PropertyDetails details = new_descriptors->GetDetails(i);
2425 if (details.type() != FIELD) continue; 2414 if (details.type() != FIELD) continue;
2426 PropertyDetails old_details = old_descriptors->GetDetails(i); 2415 PropertyDetails old_details = old_descriptors->GetDetails(i);
2427 if (old_details.type() == CALLBACKS) { 2416 if (old_details.type() == CALLBACKS) {
2428 ASSERT(details.representation().IsTagged()); 2417 ASSERT(details.representation().IsTagged());
2429 continue; 2418 continue;
2430 } 2419 }
2431 ASSERT(old_details.type() == CONSTANT || 2420 ASSERT(old_details.type() == CONSTANT ||
2432 old_details.type() == FIELD); 2421 old_details.type() == FIELD);
2433 Object* raw_value = old_details.type() == CONSTANT 2422 Object* raw_value = old_details.type() == CONSTANT
2434 ? old_descriptors->GetValue(i) 2423 ? old_descriptors->GetValue(i)
2435 : object->RawFastPropertyAt(old_descriptors->GetFieldIndex(i)); 2424 : object->RawFastPropertyAt(old_descriptors->GetFieldIndex(i));
2436 Handle<Object> value(raw_value, isolate); 2425 Handle<Object> value(raw_value, isolate);
2437 if (!old_details.representation().IsDouble() && 2426 if (!old_details.representation().IsDouble() &&
2438 details.representation().IsDouble()) { 2427 details.representation().IsDouble()) {
2439 if (old_details.representation().IsNone()) { 2428 if (old_details.representation().IsNone()) {
2440 value = handle(Smi::FromInt(0), isolate); 2429 value = handle(Smi::FromInt(0), isolate);
2441 } 2430 }
2442 value = NewStorageFor(isolate, value, details.representation()); 2431 value = NewStorageFor(isolate, value, details.representation());
2443 } 2432 }
2444 ASSERT(!(details.representation().IsDouble() && value->IsSmi())); 2433 ASSERT(!(details.representation().IsDouble() && value->IsSmi()));
2445 int target_index = new_descriptors->GetFieldIndex(i) - inobject; 2434 int target_index = new_descriptors->GetFieldIndex(i) - inobject;
2446 if (target_index < 0) target_index += total_size; 2435 if (target_index < 0) target_index += total_size;
2447 array->set(target_index, *value); 2436 array->set(target_index, *value);
2448 } 2437 }
2449 2438
2439 for (int i = old_nof; i < new_nof; i++) {
2440 PropertyDetails details = new_descriptors->GetDetails(i);
2441 if (details.type() != FIELD) continue;
2442 if (details.representation().IsDouble()) {
2443 int target_index = new_descriptors->GetFieldIndex(i) - inobject;
2444 if (target_index < 0) target_index += total_size;
2445 Handle<Object> box = isolate->factory()->NewHeapNumber(0);
2446 array->set(target_index, *box);
2447 }
2448 }
2449
2450 // From here on we cannot fail and we shouldn't GC anymore. 2450 // From here on we cannot fail and we shouldn't GC anymore.
2451 DisallowHeapAllocation no_allocation; 2451 DisallowHeapAllocation no_allocation;
2452 2452
2453 // Copy (real) inobject properties. If necessary, stop at number_of_fields to 2453 // Copy (real) inobject properties. If necessary, stop at number_of_fields to
2454 // avoid overwriting |one_pointer_filler_map|. 2454 // avoid overwriting |one_pointer_filler_map|.
2455 int limit = Min(inobject, number_of_fields); 2455 int limit = Min(inobject, number_of_fields);
2456 for (int i = 0; i < limit; i++) { 2456 for (int i = 0; i < limit; i++) {
2457 object->FastPropertyAtPut(i, array->get(external + i)); 2457 object->FastPropertyAtPut(i, array->get(external + i));
2458 } 2458 }
2459 2459
(...skipping 29 matching lines...) Expand all
2489 int modify_index, 2489 int modify_index,
2490 Representation new_representation, 2490 Representation new_representation,
2491 StoreMode store_mode) { 2491 StoreMode store_mode) {
2492 Handle<Map> new_map = Map::GeneralizeRepresentation( 2492 Handle<Map> new_map = Map::GeneralizeRepresentation(
2493 handle(object->map()), modify_index, new_representation, store_mode); 2493 handle(object->map()), modify_index, new_representation, store_mode);
2494 if (object->map() == *new_map) return; 2494 if (object->map() == *new_map) return;
2495 return MigrateToMap(object, new_map); 2495 return MigrateToMap(object, new_map);
2496 } 2496 }
2497 2497
2498 2498
2499 int Map::NumberOfFields() { 2499 int Map::NumberOfFields(int limit) {
2500 int nof = limit == -1 ? NumberOfOwnDescriptors() : limit;
Igor Sheludko 2014/03/11 14:17:37 Do we really need this change?
2500 DescriptorArray* descriptors = instance_descriptors(); 2501 DescriptorArray* descriptors = instance_descriptors();
2501 int result = 0; 2502 int result = 0;
2502 for (int i = 0; i < NumberOfOwnDescriptors(); i++) { 2503 for (int i = 0; i < nof; i++) {
2503 if (descriptors->GetDetails(i).type() == FIELD) result++; 2504 if (descriptors->GetDetails(i).type() == FIELD) result++;
2504 } 2505 }
2505 return result; 2506 return result;
2506 } 2507 }
2507 2508
2508 2509
2509 Handle<Map> Map::CopyGeneralizeAllRepresentations(Handle<Map> map, 2510 Handle<Map> Map::CopyGeneralizeAllRepresentations(Handle<Map> map,
2510 int modify_index, 2511 int modify_index,
2511 StoreMode store_mode, 2512 StoreMode store_mode,
2512 PropertyAttributes attributes, 2513 PropertyAttributes attributes,
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
3852 IsDictionaryElementsKind(obj_kind)) { 3853 IsDictionaryElementsKind(obj_kind)) {
3853 to_kind = obj_kind; 3854 to_kind = obj_kind;
3854 } 3855 }
3855 if (IsDictionaryElementsKind(to_kind)) { 3856 if (IsDictionaryElementsKind(to_kind)) {
3856 NormalizeElements(object); 3857 NormalizeElements(object);
3857 } else { 3858 } else {
3858 TransitionElementsKind(object, to_kind); 3859 TransitionElementsKind(object, to_kind);
3859 } 3860 }
3860 map = MapAsElementsKind(map, to_kind); 3861 map = MapAsElementsKind(map, to_kind);
3861 } 3862 }
3862 int total_size = 3863 JSObject::MigrateToMap(object, map);
3863 map->NumberOfOwnDescriptors() + map->unused_property_fields();
3864 int out_of_object = total_size - map->inobject_properties();
3865 if (out_of_object != object->properties()->length()) {
3866 Isolate* isolate = object->GetIsolate();
3867 Handle<FixedArray> new_properties = isolate->factory()->CopySizeFixedArray(
3868 handle(object->properties()), out_of_object);
3869 object->set_properties(*new_properties);
3870 }
3871 object->set_map(*map);
3872 } 3864 }
3873 3865
3874 3866
3875 void JSObject::MigrateInstance(Handle<JSObject> object) { 3867 void JSObject::MigrateInstance(Handle<JSObject> object) {
3876 // Converting any field to the most specific type will cause the 3868 // Converting any field to the most specific type will cause the
3877 // GeneralizeFieldRepresentation algorithm to create the most general existing 3869 // GeneralizeFieldRepresentation algorithm to create the most general existing
3878 // transition that matches the object. This achieves what is needed. 3870 // transition that matches the object. This achieves what is needed.
3879 Handle<Map> original_map(object->map()); 3871 Handle<Map> original_map(object->map());
3880 GeneralizeFieldRepresentation( 3872 GeneralizeFieldRepresentation(
3881 object, 0, Representation::None(), ALLOW_AS_CONSTANT); 3873 object, 0, Representation::None(), ALLOW_AS_CONSTANT);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3917 return JSObject::AddProperty( 3909 return JSObject::AddProperty(
3918 object, name, value, attributes, kNonStrictMode, 3910 object, name, value, attributes, kNonStrictMode,
3919 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED, 3911 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED,
3920 JSReceiver::OMIT_EXTENSIBILITY_CHECK, 3912 JSReceiver::OMIT_EXTENSIBILITY_CHECK,
3921 JSObject::FORCE_TAGGED, FORCE_FIELD, OMIT_TRANSITION); 3913 JSObject::FORCE_TAGGED, FORCE_FIELD, OMIT_TRANSITION);
3922 } 3914 }
3923 3915
3924 // Keep the target CONSTANT if the same value is stored. 3916 // Keep the target CONSTANT if the same value is stored.
3925 // TODO(verwaest): Also support keeping the placeholder 3917 // TODO(verwaest): Also support keeping the placeholder
3926 // (value->IsUninitialized) as constant. 3918 // (value->IsUninitialized) as constant.
3927 if (details.type() == CONSTANT && 3919 if (!value->FitsRepresentation(details.representation()) ||
3928 descriptors->GetValue(descriptor) == *value) { 3920 (details.type() == CONSTANT &&
3929 object->set_map(*transition_map); 3921 descriptors->GetValue(descriptor) != *value)) {
3930 return value; 3922 transition_map = Map::GeneralizeRepresentation(transition_map,
3923 descriptor, value->OptimalRepresentation(), FORCE_FIELD);
3931 } 3924 }
3932 3925
3933 Representation representation = details.representation(); 3926 JSObject::MigrateToMap(object, transition_map);
3934 3927
3935 if (!value->FitsRepresentation(representation) || 3928 // Reload.
3936 details.type() == CONSTANT) { 3929 descriptors = transition_map->instance_descriptors();
3937 transition_map = Map::GeneralizeRepresentation(transition_map, 3930 details = descriptors->GetDetails(descriptor);
3938 descriptor, value->OptimalRepresentation(), FORCE_FIELD); 3931
3939 Object* back = transition_map->GetBackPointer(); 3932 if (details.type() != FIELD) return value;
3940 if (back->IsMap()) { 3933
3941 MigrateToMap(object, handle(Map::cast(back))); 3934 int field_index = descriptors->GetFieldIndex(descriptor);
3942 } 3935 if (details.representation().IsDouble()) {
3943 descriptors = transition_map->instance_descriptors(); 3936 // Nothing more to be done.
3944 representation = descriptors->GetDetails(descriptor).representation(); 3937 if (value->IsUninitialized()) return value;
3938 HeapNumber* box = HeapNumber::cast(object->RawFastPropertyAt(field_index));
3939 box->set_value(value->Number());
3940 } else {
3941 object->FastPropertyAtPut(field_index, *value);
3945 } 3942 }
3946 3943
3947 int field_index = descriptors->GetFieldIndex(descriptor);
3948 AddFastPropertyUsingMap(
3949 object, transition_map, name, value, field_index, representation);
3950 return value; 3944 return value;
3951 } 3945 }
3952 3946
3953 3947
3954 static void SetPropertyToField(LookupResult* lookup, 3948 static void SetPropertyToField(LookupResult* lookup,
3955 Handle<Name> name, 3949 Handle<Name> name,
3956 Handle<Object> value) { 3950 Handle<Object> value) {
3957 Representation representation = lookup->representation(); 3951 Representation representation = lookup->representation();
3958 if (!value->FitsRepresentation(representation) || 3952 if (!value->FitsRepresentation(representation) ||
3959 lookup->type() == CONSTANT) { 3953 lookup->type() == CONSTANT) {
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
4761 // Switch to using the dictionary as the backing storage for elements. 4755 // Switch to using the dictionary as the backing storage for elements.
4762 if (is_arguments) { 4756 if (is_arguments) {
4763 FixedArray::cast(elements())->set(1, dictionary); 4757 FixedArray::cast(elements())->set(1, dictionary);
4764 } else { 4758 } else {
4765 // Set the new map first to satify the elements type assert in 4759 // Set the new map first to satify the elements type assert in
4766 // set_elements(). 4760 // set_elements().
4767 Map* new_map; 4761 Map* new_map;
4768 MaybeObject* maybe = GetElementsTransitionMap(GetIsolate(), 4762 MaybeObject* maybe = GetElementsTransitionMap(GetIsolate(),
4769 DICTIONARY_ELEMENTS); 4763 DICTIONARY_ELEMENTS);
4770 if (!maybe->To(&new_map)) return maybe; 4764 if (!maybe->To(&new_map)) return maybe;
4765 // TODO(verwaest): Replace by MigrateToMap.
4771 set_map(new_map); 4766 set_map(new_map);
4772 set_elements(dictionary); 4767 set_elements(dictionary);
4773 } 4768 }
4774 4769
4775 old_map->GetHeap()->isolate()->counters()->elements_to_dictionary()-> 4770 old_map->GetHeap()->isolate()->counters()->elements_to_dictionary()->
4776 Increment(); 4771 Increment();
4777 4772
4778 #ifdef DEBUG 4773 #ifdef DEBUG
4779 if (FLAG_trace_normalization) { 4774 if (FLAG_trace_normalization) {
4780 PrintF("Object elements have been normalized:\n"); 4775 PrintF("Object elements have been normalized:\n");
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
5489 5484
5490 // Make sure that we never go back to fast case. 5485 // Make sure that we never go back to fast case.
5491 dictionary->set_requires_slow_elements(); 5486 dictionary->set_requires_slow_elements();
5492 5487
5493 // Do a map transition, other objects with this map may still 5488 // Do a map transition, other objects with this map may still
5494 // be extensible. 5489 // be extensible.
5495 // TODO(adamk): Extend the NormalizedMapCache to handle non-extensible maps. 5490 // TODO(adamk): Extend the NormalizedMapCache to handle non-extensible maps.
5496 Handle<Map> new_map = Map::Copy(handle(object->map())); 5491 Handle<Map> new_map = Map::Copy(handle(object->map()));
5497 5492
5498 new_map->set_is_extensible(false); 5493 new_map->set_is_extensible(false);
5499 object->set_map(*new_map); 5494 JSObject::MigrateToMap(object, new_map);
5500 ASSERT(!object->map()->is_extensible()); 5495 ASSERT(!object->map()->is_extensible());
5501 5496
5502 if (object->map()->is_observed()) { 5497 if (object->map()->is_observed()) {
5503 EnqueueChangeRecord(object, "preventExtensions", Handle<Name>(), 5498 EnqueueChangeRecord(object, "preventExtensions", Handle<Name>(),
5504 isolate->factory()->the_hole_value()); 5499 isolate->factory()->the_hole_value());
5505 } 5500 }
5506 return object; 5501 return object;
5507 } 5502 }
5508 5503
5509 5504
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
5582 // No existing elements, use a pre-allocated empty backing store 5577 // No existing elements, use a pre-allocated empty backing store
5583 new_element_dictionary = 5578 new_element_dictionary =
5584 isolate->factory()->empty_slow_element_dictionary(); 5579 isolate->factory()->empty_slow_element_dictionary();
5585 } 5580 }
5586 } 5581 }
5587 5582
5588 LookupResult result(isolate); 5583 LookupResult result(isolate);
5589 Handle<Map> old_map(object->map()); 5584 Handle<Map> old_map(object->map());
5590 old_map->LookupTransition(*object, isolate->heap()->frozen_symbol(), &result); 5585 old_map->LookupTransition(*object, isolate->heap()->frozen_symbol(), &result);
5591 if (result.IsTransition()) { 5586 if (result.IsTransition()) {
5592 Map* transition_map = result.GetTransitionTarget(); 5587 Handle<Map> transition_map(result.GetTransitionTarget());
5593 ASSERT(transition_map->has_dictionary_elements()); 5588 ASSERT(transition_map->has_dictionary_elements());
5594 ASSERT(transition_map->is_frozen()); 5589 ASSERT(transition_map->is_frozen());
5595 ASSERT(!transition_map->is_extensible()); 5590 ASSERT(!transition_map->is_extensible());
5596 object->set_map(transition_map); 5591 JSObject::MigrateToMap(object, transition_map);
5597 } else if (object->HasFastProperties() && old_map->CanHaveMoreTransitions()) { 5592 } else if (object->HasFastProperties() && old_map->CanHaveMoreTransitions()) {
5598 // Create a new descriptor array with fully-frozen properties 5593 // Create a new descriptor array with fully-frozen properties
5599 int num_descriptors = old_map->NumberOfOwnDescriptors(); 5594 int num_descriptors = old_map->NumberOfOwnDescriptors();
5600 Handle<DescriptorArray> new_descriptors = 5595 Handle<DescriptorArray> new_descriptors =
5601 DescriptorArray::CopyUpToAddAttributes( 5596 DescriptorArray::CopyUpToAddAttributes(
5602 handle(old_map->instance_descriptors()), num_descriptors, FROZEN); 5597 handle(old_map->instance_descriptors()), num_descriptors, FROZEN);
5603 Handle<Map> new_map = Map::CopyReplaceDescriptors( 5598 Handle<Map> new_map = Map::CopyReplaceDescriptors(
5604 old_map, new_descriptors, INSERT_TRANSITION, 5599 old_map, new_descriptors, INSERT_TRANSITION,
5605 isolate->factory()->frozen_symbol()); 5600 isolate->factory()->frozen_symbol());
5606 new_map->freeze(); 5601 new_map->freeze();
5607 new_map->set_is_extensible(false); 5602 new_map->set_is_extensible(false);
5608 new_map->set_elements_kind(DICTIONARY_ELEMENTS); 5603 new_map->set_elements_kind(DICTIONARY_ELEMENTS);
5609 object->set_map(*new_map); 5604 JSObject::MigrateToMap(object, new_map);
5610 } else { 5605 } else {
5611 // Slow path: need to normalize properties for safety 5606 // Slow path: need to normalize properties for safety
5612 NormalizeProperties(object, CLEAR_INOBJECT_PROPERTIES, 0); 5607 NormalizeProperties(object, CLEAR_INOBJECT_PROPERTIES, 0);
5613 5608
5614 // Create a new map, since other objects with this map may be extensible. 5609 // Create a new map, since other objects with this map may be extensible.
5615 // TODO(adamk): Extend the NormalizedMapCache to handle non-extensible maps. 5610 // TODO(adamk): Extend the NormalizedMapCache to handle non-extensible maps.
5616 Handle<Map> new_map = Map::Copy(handle(object->map())); 5611 Handle<Map> new_map = Map::Copy(handle(object->map()));
5617 new_map->freeze(); 5612 new_map->freeze();
5618 new_map->set_is_extensible(false); 5613 new_map->set_is_extensible(false);
5619 new_map->set_elements_kind(DICTIONARY_ELEMENTS); 5614 new_map->set_elements_kind(DICTIONARY_ELEMENTS);
5620 object->set_map(*new_map); 5615 JSObject::MigrateToMap(object, new_map);
5621 5616
5622 // Freeze dictionary-mode properties 5617 // Freeze dictionary-mode properties
5623 FreezeDictionary(object->property_dictionary()); 5618 FreezeDictionary(object->property_dictionary());
5624 } 5619 }
5625 5620
5626 ASSERT(object->map()->has_dictionary_elements()); 5621 ASSERT(object->map()->has_dictionary_elements());
5627 if (!new_element_dictionary.is_null()) { 5622 if (!new_element_dictionary.is_null()) {
5628 object->set_elements(*new_element_dictionary); 5623 object->set_elements(*new_element_dictionary);
5629 } 5624 }
5630 5625
(...skipping 23 matching lines...) Expand all
5654 Handle<Map> new_map; 5649 Handle<Map> new_map;
5655 if (result.IsTransition()) { 5650 if (result.IsTransition()) {
5656 new_map = handle(result.GetTransitionTarget()); 5651 new_map = handle(result.GetTransitionTarget());
5657 ASSERT(new_map->is_observed()); 5652 ASSERT(new_map->is_observed());
5658 } else if (object->map()->CanHaveMoreTransitions()) { 5653 } else if (object->map()->CanHaveMoreTransitions()) {
5659 new_map = Map::CopyForObserved(handle(object->map())); 5654 new_map = Map::CopyForObserved(handle(object->map()));
5660 } else { 5655 } else {
5661 new_map = Map::Copy(handle(object->map())); 5656 new_map = Map::Copy(handle(object->map()));
5662 new_map->set_is_observed(); 5657 new_map->set_is_observed();
5663 } 5658 }
5664 object->set_map(*new_map); 5659 JSObject::MigrateToMap(object, new_map);
5665 } 5660 }
5666 5661
5667 5662
5668 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) { 5663 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) {
5669 Isolate* isolate = object->GetIsolate(); 5664 Isolate* isolate = object->GetIsolate();
5670 CALL_HEAP_FUNCTION(isolate, 5665 CALL_HEAP_FUNCTION(isolate,
5671 isolate->heap()->CopyJSObject(*object), JSObject); 5666 isolate->heap()->CopyJSObject(*object), JSObject);
5672 } 5667 }
5673 5668
5674 5669
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
6384 object, name, getter, setter, attributes, access_control); 6379 object, name, getter, setter, attributes, access_control);
6385 } 6380 }
6386 6381
6387 if (is_observed) { 6382 if (is_observed) {
6388 const char* type = preexists ? "reconfigure" : "add"; 6383 const char* type = preexists ? "reconfigure" : "add";
6389 EnqueueChangeRecord(object, type, name, old_value); 6384 EnqueueChangeRecord(object, type, name, old_value);
6390 } 6385 }
6391 } 6386 }
6392 6387
6393 6388
6394 static bool TryAccessorTransition(JSObject* self, 6389 static bool TryAccessorTransition(Handle<JSObject> self,
6395 Map* transitioned_map, 6390 Handle<Map> transitioned_map,
6396 int target_descriptor, 6391 int target_descriptor,
6397 AccessorComponent component, 6392 AccessorComponent component,
6398 Object* accessor, 6393 Handle<Object> accessor,
6399 PropertyAttributes attributes) { 6394 PropertyAttributes attributes) {
6400 DescriptorArray* descs = transitioned_map->instance_descriptors(); 6395 DescriptorArray* descs = transitioned_map->instance_descriptors();
6401 PropertyDetails details = descs->GetDetails(target_descriptor); 6396 PropertyDetails details = descs->GetDetails(target_descriptor);
6402 6397
6403 // If the transition target was not callbacks, fall back to the slow case. 6398 // If the transition target was not callbacks, fall back to the slow case.
6404 if (details.type() != CALLBACKS) return false; 6399 if (details.type() != CALLBACKS) return false;
6405 Object* descriptor = descs->GetCallbacksObject(target_descriptor); 6400 Object* descriptor = descs->GetCallbacksObject(target_descriptor);
6406 if (!descriptor->IsAccessorPair()) return false; 6401 if (!descriptor->IsAccessorPair()) return false;
6407 6402
6408 Object* target_accessor = AccessorPair::cast(descriptor)->get(component); 6403 Object* target_accessor = AccessorPair::cast(descriptor)->get(component);
6409 PropertyAttributes target_attributes = details.attributes(); 6404 PropertyAttributes target_attributes = details.attributes();
6410 6405
6411 // Reuse transition if adding same accessor with same attributes. 6406 // Reuse transition if adding same accessor with same attributes.
6412 if (target_accessor == accessor && target_attributes == attributes) { 6407 if (target_accessor == *accessor && target_attributes == attributes) {
6413 self->set_map(transitioned_map); 6408 JSObject::MigrateToMap(self, transitioned_map);
6414 return true; 6409 return true;
6415 } 6410 }
6416 6411
6417 // If either not the same accessor, or not the same attributes, fall back to 6412 // If either not the same accessor, or not the same attributes, fall back to
6418 // the slow case. 6413 // the slow case.
6419 return false; 6414 return false;
6420 } 6415 }
6421 6416
6422 6417
6423 static MaybeObject* CopyInsertDescriptor(Map* map, 6418 static MaybeObject* CopyInsertDescriptor(Map* map,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
6465 } 6460 }
6466 } else { 6461 } else {
6467 return false; 6462 return false;
6468 } 6463 }
6469 6464
6470 int descriptor_number = result.GetDescriptorIndex(); 6465 int descriptor_number = result.GetDescriptorIndex();
6471 6466
6472 object->map()->LookupTransition(*object, *name, &result); 6467 object->map()->LookupTransition(*object, *name, &result);
6473 6468
6474 if (result.IsFound()) { 6469 if (result.IsFound()) {
6475 Map* target = result.GetTransitionTarget(); 6470 Handle<Map> target(result.GetTransitionTarget());
6476 ASSERT(target->NumberOfOwnDescriptors() == 6471 ASSERT(target->NumberOfOwnDescriptors() ==
6477 object->map()->NumberOfOwnDescriptors()); 6472 object->map()->NumberOfOwnDescriptors());
6478 // This works since descriptors are sorted in order of addition. 6473 // This works since descriptors are sorted in order of addition.
6479 ASSERT(object->map()->instance_descriptors()-> 6474 ASSERT(object->map()->instance_descriptors()->
6480 GetKey(descriptor_number) == *name); 6475 GetKey(descriptor_number) == *name);
6481 return TryAccessorTransition(*object, target, descriptor_number, 6476 return TryAccessorTransition(object, target, descriptor_number,
6482 component, *accessor, attributes); 6477 component, accessor, attributes);
6483 } 6478 }
6484 } else { 6479 } else {
6485 // If not, lookup a transition. 6480 // If not, lookup a transition.
6486 object->map()->LookupTransition(*object, *name, &result); 6481 object->map()->LookupTransition(*object, *name, &result);
6487 6482
6488 // If there is a transition, try to follow it. 6483 // If there is a transition, try to follow it.
6489 if (result.IsFound()) { 6484 if (result.IsFound()) {
6490 Map* target = result.GetTransitionTarget(); 6485 Handle<Map> target(result.GetTransitionTarget());
6491 int descriptor_number = target->LastAdded(); 6486 int descriptor_number = target->LastAdded();
6492 ASSERT(target->instance_descriptors()->GetKey(descriptor_number) 6487 ASSERT(target->instance_descriptors()->GetKey(descriptor_number)
6493 ->Equals(*name)); 6488 ->Equals(*name));
6494 return TryAccessorTransition(*object, target, descriptor_number, 6489 return TryAccessorTransition(object, target, descriptor_number,
6495 component, *accessor, attributes); 6490 component, accessor, attributes);
6496 } 6491 }
6497 } 6492 }
6498 6493
6499 // If there is no transition yet, add a transition to the a new accessor pair 6494 // If there is no transition yet, add a transition to the a new accessor pair
6500 // containing the accessor. Allocate a new pair if there were no source 6495 // containing the accessor. Allocate a new pair if there were no source
6501 // accessors. Otherwise, copy the pair and modify the accessor. 6496 // accessors. Otherwise, copy the pair and modify the accessor.
6502 Handle<AccessorPair> accessors = source_accessors != NULL 6497 Handle<AccessorPair> accessors = source_accessors != NULL
6503 ? AccessorPair::Copy(Handle<AccessorPair>(source_accessors)) 6498 ? AccessorPair::Copy(Handle<AccessorPair>(source_accessors))
6504 : isolate->factory()->NewAccessorPair(); 6499 : isolate->factory()->NewAccessorPair();
6505 accessors->set(component, *accessor); 6500 accessors->set(component, *accessor);
6506 Handle<Map> new_map = CopyInsertDescriptor(Handle<Map>(object->map()), 6501 Handle<Map> new_map = CopyInsertDescriptor(Handle<Map>(object->map()),
6507 name, accessors, attributes); 6502 name, accessors, attributes);
6508 object->set_map(*new_map); 6503 JSObject::MigrateToMap(object, new_map);
6509 return true; 6504 return true;
6510 } 6505 }
6511 6506
6512 6507
6513 Handle<Object> JSObject::SetAccessor(Handle<JSObject> object, 6508 Handle<Object> JSObject::SetAccessor(Handle<JSObject> object,
6514 Handle<AccessorInfo> info) { 6509 Handle<AccessorInfo> info) {
6515 Isolate* isolate = object->GetIsolate(); 6510 Isolate* isolate = object->GetIsolate();
6516 Factory* factory = isolate->factory(); 6511 Factory* factory = isolate->factory();
6517 Handle<Name> name(Name::cast(info->name())); 6512 Handle<Name> name(Name::cast(info->name()));
6518 6513
(...skipping 3263 matching lines...) Expand 10 before | Expand all | Expand 10 after
9782 // If the value is not a JSReceiver, store the value in the map's 9777 // If the value is not a JSReceiver, store the value in the map's
9783 // constructor field so it can be accessed. Also, set the prototype 9778 // constructor field so it can be accessed. Also, set the prototype
9784 // used for constructing objects to the original object prototype. 9779 // used for constructing objects to the original object prototype.
9785 // See ECMA-262 13.2.2. 9780 // See ECMA-262 13.2.2.
9786 if (!value->IsJSReceiver()) { 9781 if (!value->IsJSReceiver()) {
9787 // Copy the map so this does not affect unrelated functions. 9782 // Copy the map so this does not affect unrelated functions.
9788 // Remove map transitions because they point to maps with a 9783 // Remove map transitions because they point to maps with a
9789 // different prototype. 9784 // different prototype.
9790 Handle<Map> new_map = Map::Copy(handle(function->map())); 9785 Handle<Map> new_map = Map::Copy(handle(function->map()));
9791 9786
9792 function->set_map(*new_map); 9787 JSObject::MigrateToMap(function, new_map);
9793 new_map->set_constructor(*value); 9788 new_map->set_constructor(*value);
9794 new_map->set_non_instance_prototype(true); 9789 new_map->set_non_instance_prototype(true);
9795 Isolate* isolate = new_map->GetIsolate(); 9790 Isolate* isolate = new_map->GetIsolate();
9796 construct_prototype = handle( 9791 construct_prototype = handle(
9797 isolate->context()->native_context()->initial_object_prototype(), 9792 isolate->context()->native_context()->initial_object_prototype(),
9798 isolate); 9793 isolate);
9799 } else { 9794 } else {
9800 function->map()->set_non_instance_prototype(false); 9795 function->map()->set_non_instance_prototype(false);
9801 } 9796 }
9802 9797
(...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after
11856 JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value)); 11851 JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value));
11857 } 11852 }
11858 11853
11859 Handle<Map> new_map = Map::GetPrototypeTransition(map, value); 11854 Handle<Map> new_map = Map::GetPrototypeTransition(map, value);
11860 if (new_map.is_null()) { 11855 if (new_map.is_null()) {
11861 new_map = Map::Copy(map); 11856 new_map = Map::Copy(map);
11862 Map::PutPrototypeTransition(map, value, new_map); 11857 Map::PutPrototypeTransition(map, value, new_map);
11863 new_map->set_prototype(*value); 11858 new_map->set_prototype(*value);
11864 } 11859 }
11865 ASSERT(new_map->prototype() == *value); 11860 ASSERT(new_map->prototype() == *value);
11866 real_receiver->set_map(*new_map); 11861 JSObject::MigrateToMap(real_receiver, new_map);
11867 11862
11868 if (!dictionary_elements_in_chain && 11863 if (!dictionary_elements_in_chain &&
11869 new_map->DictionaryElementsInPrototypeChainOnly()) { 11864 new_map->DictionaryElementsInPrototypeChainOnly()) {
11870 // If the prototype chain didn't previously have element callbacks, then 11865 // If the prototype chain didn't previously have element callbacks, then
11871 // KeyedStoreICs need to be cleared to ensure any that involve this 11866 // KeyedStoreICs need to be cleared to ensure any that involve this
11872 // map go generic. 11867 // map go generic.
11873 object->GetHeap()->ClearAllICsByKind(Code::KEYED_STORE_IC); 11868 object->GetHeap()->ClearAllICsByKind(Code::KEYED_STORE_IC);
11874 } 11869 }
11875 11870
11876 heap->ClearInstanceofCache(); 11871 heap->ClearInstanceofCache();
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
12197 return value; 12192 return value;
12198 } 12193 }
12199 // Change elements kind from Smi-only to generic FAST if necessary. 12194 // Change elements kind from Smi-only to generic FAST if necessary.
12200 if (object->HasFastSmiElements() && !value->IsSmi()) { 12195 if (object->HasFastSmiElements() && !value->IsSmi()) {
12201 ElementsKind kind = object->HasFastHoleyElements() 12196 ElementsKind kind = object->HasFastHoleyElements()
12202 ? FAST_HOLEY_ELEMENTS 12197 ? FAST_HOLEY_ELEMENTS
12203 : FAST_ELEMENTS; 12198 : FAST_ELEMENTS;
12204 12199
12205 UpdateAllocationSite(object, kind); 12200 UpdateAllocationSite(object, kind);
12206 Handle<Map> new_map = GetElementsTransitionMap(object, kind); 12201 Handle<Map> new_map = GetElementsTransitionMap(object, kind);
12207 object->set_map(*new_map); 12202 JSObject::MigrateToMap(object, new_map);
12208 ASSERT(IsFastObjectElementsKind(object->GetElementsKind())); 12203 ASSERT(IsFastObjectElementsKind(object->GetElementsKind()));
12209 } 12204 }
12210 // Increase backing store capacity if that's been decided previously. 12205 // Increase backing store capacity if that's been decided previously.
12211 if (new_capacity != capacity) { 12206 if (new_capacity != capacity) {
12212 SetFastElementsCapacitySmiMode smi_mode = 12207 SetFastElementsCapacitySmiMode smi_mode =
12213 value->IsSmi() && object->HasFastSmiElements() 12208 value->IsSmi() && object->HasFastSmiElements()
12214 ? kAllowSmiElements 12209 ? kAllowSmiElements
12215 : kDontAllowSmiElements; 12210 : kDontAllowSmiElements;
12216 Handle<FixedArray> new_elements = 12211 Handle<FixedArray> new_elements =
12217 SetFastElementsCapacityAndLength(object, new_capacity, array_length, 12212 SetFastElementsCapacityAndLength(object, new_capacity, array_length,
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
12886 (IsFastSmiOrObjectElementsKind(from_kind) && 12881 (IsFastSmiOrObjectElementsKind(from_kind) &&
12887 IsFastSmiOrObjectElementsKind(to_kind)) || 12882 IsFastSmiOrObjectElementsKind(to_kind)) ||
12888 (from_kind == FAST_DOUBLE_ELEMENTS && 12883 (from_kind == FAST_DOUBLE_ELEMENTS &&
12889 to_kind == FAST_HOLEY_DOUBLE_ELEMENTS)) { 12884 to_kind == FAST_HOLEY_DOUBLE_ELEMENTS)) {
12890 ASSERT(from_kind != TERMINAL_FAST_ELEMENTS_KIND); 12885 ASSERT(from_kind != TERMINAL_FAST_ELEMENTS_KIND);
12891 // No change is needed to the elements() buffer, the transition 12886 // No change is needed to the elements() buffer, the transition
12892 // only requires a map change. 12887 // only requires a map change.
12893 MaybeObject* maybe_new_map = GetElementsTransitionMap(isolate, to_kind); 12888 MaybeObject* maybe_new_map = GetElementsTransitionMap(isolate, to_kind);
12894 Map* new_map; 12889 Map* new_map;
12895 if (!maybe_new_map->To(&new_map)) return maybe_new_map; 12890 if (!maybe_new_map->To(&new_map)) return maybe_new_map;
12891 // TODO(verwaest): Replace by MigrateToMap.
12896 set_map(new_map); 12892 set_map(new_map);
12897 if (FLAG_trace_elements_transitions) { 12893 if (FLAG_trace_elements_transitions) {
12898 FixedArrayBase* elms = FixedArrayBase::cast(elements()); 12894 FixedArrayBase* elms = FixedArrayBase::cast(elements());
12899 PrintElementsTransition(stdout, from_kind, elms, to_kind, elms); 12895 PrintElementsTransition(stdout, from_kind, elms, to_kind, elms);
12900 } 12896 }
12901 return this; 12897 return this;
12902 } 12898 }
12903 12899
12904 FixedArrayBase* elms = FixedArrayBase::cast(elements()); 12900 FixedArrayBase* elms = FixedArrayBase::cast(elements());
12905 uint32_t capacity = static_cast<uint32_t>(elms->length()); 12901 uint32_t capacity = static_cast<uint32_t>(elms->length());
(...skipping 3592 matching lines...) Expand 10 before | Expand all | Expand 10 after
16498 #define ERROR_MESSAGES_TEXTS(C, T) T, 16494 #define ERROR_MESSAGES_TEXTS(C, T) T,
16499 static const char* error_messages_[] = { 16495 static const char* error_messages_[] = {
16500 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16496 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16501 }; 16497 };
16502 #undef ERROR_MESSAGES_TEXTS 16498 #undef ERROR_MESSAGES_TEXTS
16503 return error_messages_[reason]; 16499 return error_messages_[reason];
16504 } 16500 }
16505 16501
16506 16502
16507 } } // namespace v8::internal 16503 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698