| OLD | NEW |
| 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 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 String::cast(symbol->name())->StringShortPrint(accumulator); | 1721 String::cast(symbol->name())->StringShortPrint(accumulator); |
| 1722 } | 1722 } |
| 1723 accumulator->Add(">"); | 1723 accumulator->Add(">"); |
| 1724 break; | 1724 break; |
| 1725 } | 1725 } |
| 1726 case HEAP_NUMBER_TYPE: | 1726 case HEAP_NUMBER_TYPE: |
| 1727 accumulator->Add("<Number: "); | 1727 accumulator->Add("<Number: "); |
| 1728 HeapNumber::cast(this)->HeapNumberPrint(accumulator); | 1728 HeapNumber::cast(this)->HeapNumberPrint(accumulator); |
| 1729 accumulator->Put('>'); | 1729 accumulator->Put('>'); |
| 1730 break; | 1730 break; |
| 1731 case MUTABLE_HEAP_NUMBER_TYPE: |
| 1732 accumulator->Add("<MutableNumber: "); |
| 1733 HeapNumber::cast(this)->HeapNumberPrint(accumulator); |
| 1734 accumulator->Put('>'); |
| 1735 break; |
| 1731 case JS_PROXY_TYPE: | 1736 case JS_PROXY_TYPE: |
| 1732 accumulator->Add("<JSProxy>"); | 1737 accumulator->Add("<JSProxy>"); |
| 1733 break; | 1738 break; |
| 1734 case JS_FUNCTION_PROXY_TYPE: | 1739 case JS_FUNCTION_PROXY_TYPE: |
| 1735 accumulator->Add("<JSFunctionProxy>"); | 1740 accumulator->Add("<JSFunctionProxy>"); |
| 1736 break; | 1741 break; |
| 1737 case FOREIGN_TYPE: | 1742 case FOREIGN_TYPE: |
| 1738 accumulator->Add("<Foreign>"); | 1743 accumulator->Add("<Foreign>"); |
| 1739 break; | 1744 break; |
| 1740 case CELL_TYPE: | 1745 case CELL_TYPE: |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 Cell::BodyDescriptor::IterateBody(this, v); | 1849 Cell::BodyDescriptor::IterateBody(this, v); |
| 1845 break; | 1850 break; |
| 1846 case PROPERTY_CELL_TYPE: | 1851 case PROPERTY_CELL_TYPE: |
| 1847 PropertyCell::BodyDescriptor::IterateBody(this, v); | 1852 PropertyCell::BodyDescriptor::IterateBody(this, v); |
| 1848 break; | 1853 break; |
| 1849 case SYMBOL_TYPE: | 1854 case SYMBOL_TYPE: |
| 1850 Symbol::BodyDescriptor::IterateBody(this, v); | 1855 Symbol::BodyDescriptor::IterateBody(this, v); |
| 1851 break; | 1856 break; |
| 1852 | 1857 |
| 1853 case HEAP_NUMBER_TYPE: | 1858 case HEAP_NUMBER_TYPE: |
| 1859 case MUTABLE_HEAP_NUMBER_TYPE: |
| 1854 case FILLER_TYPE: | 1860 case FILLER_TYPE: |
| 1855 case BYTE_ARRAY_TYPE: | 1861 case BYTE_ARRAY_TYPE: |
| 1856 case FREE_SPACE_TYPE: | 1862 case FREE_SPACE_TYPE: |
| 1857 break; | 1863 break; |
| 1858 | 1864 |
| 1859 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1865 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 1860 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | 1866 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ |
| 1861 case FIXED_##TYPE##_ARRAY_TYPE: \ | 1867 case FIXED_##TYPE##_ARRAY_TYPE: \ |
| 1862 break; | 1868 break; |
| 1863 | 1869 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1900 } | 1906 } |
| 1901 if (u.bits.exp == 0) { | 1907 if (u.bits.exp == 0) { |
| 1902 // Detect +0, and -0 for IEEE double precision floating point. | 1908 // Detect +0, and -0 for IEEE double precision floating point. |
| 1903 if ((u.bits.man_low | u.bits.man_high) == 0) return false; | 1909 if ((u.bits.man_low | u.bits.man_high) == 0) return false; |
| 1904 } | 1910 } |
| 1905 return true; | 1911 return true; |
| 1906 } | 1912 } |
| 1907 | 1913 |
| 1908 | 1914 |
| 1909 void HeapNumber::HeapNumberPrint(FILE* out) { | 1915 void HeapNumber::HeapNumberPrint(FILE* out) { |
| 1910 PrintF(out, "%.16g", Number()); | 1916 PrintF(out, "%.16g", value()); |
| 1911 } | 1917 } |
| 1912 | 1918 |
| 1913 | 1919 |
| 1914 void HeapNumber::HeapNumberPrint(StringStream* accumulator) { | 1920 void HeapNumber::HeapNumberPrint(StringStream* accumulator) { |
| 1915 // The Windows version of vsnprintf can allocate when printing a %g string | 1921 // The Windows version of vsnprintf can allocate when printing a %g string |
| 1916 // into a buffer that may not be big enough. We don't want random memory | 1922 // into a buffer that may not be big enough. We don't want random memory |
| 1917 // allocation when producing post-crash stack traces, so we print into a | 1923 // allocation when producing post-crash stack traces, so we print into a |
| 1918 // buffer that is plenty big enough for any floating point number, then | 1924 // buffer that is plenty big enough for any floating point number, then |
| 1919 // print that using vsnprintf (which may truncate but never allocate if | 1925 // print that using vsnprintf (which may truncate but never allocate if |
| 1920 // there is no more space in the buffer). | 1926 // there is no more space in the buffer). |
| 1921 EmbeddedVector<char, 100> buffer; | 1927 EmbeddedVector<char, 100> buffer; |
| 1922 OS::SNPrintF(buffer, "%.16g", Number()); | 1928 OS::SNPrintF(buffer, "%.16g", value()); |
| 1923 accumulator->Add("%s", buffer.start()); | 1929 accumulator->Add("%s", buffer.start()); |
| 1924 } | 1930 } |
| 1925 | 1931 |
| 1926 | 1932 |
| 1927 String* JSReceiver::class_name() { | 1933 String* JSReceiver::class_name() { |
| 1928 if (IsJSFunction() && IsJSFunctionProxy()) { | 1934 if (IsJSFunction() && IsJSFunctionProxy()) { |
| 1929 return GetHeap()->function_class_string(); | 1935 return GetHeap()->function_class_string(); |
| 1930 } | 1936 } |
| 1931 if (map()->constructor()->IsJSFunction()) { | 1937 if (map()->constructor()->IsJSFunction()) { |
| 1932 JSFunction* constructor = JSFunction::cast(map()->constructor()); | 1938 JSFunction* constructor = JSFunction::cast(map()->constructor()); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2032 Representation representation = value->OptimalRepresentation(value_type); | 2038 Representation representation = value->OptimalRepresentation(value_type); |
| 2033 Handle<Map> new_map = CopyAddFieldDescriptor( | 2039 Handle<Map> new_map = CopyAddFieldDescriptor( |
| 2034 handle(object->map()), name, index, attributes, representation, flag); | 2040 handle(object->map()), name, index, attributes, representation, flag); |
| 2035 | 2041 |
| 2036 JSObject::MigrateToMap(object, new_map); | 2042 JSObject::MigrateToMap(object, new_map); |
| 2037 | 2043 |
| 2038 if (representation.IsDouble()) { | 2044 if (representation.IsDouble()) { |
| 2039 // Nothing more to be done. | 2045 // Nothing more to be done. |
| 2040 if (value->IsUninitialized()) return; | 2046 if (value->IsUninitialized()) return; |
| 2041 HeapNumber* box = HeapNumber::cast(object->RawFastPropertyAt(index)); | 2047 HeapNumber* box = HeapNumber::cast(object->RawFastPropertyAt(index)); |
| 2048 ASSERT(box->IsMutableHeapNumber()); |
| 2042 box->set_value(value->Number()); | 2049 box->set_value(value->Number()); |
| 2043 } else { | 2050 } else { |
| 2044 object->FastPropertyAtPut(index, *value); | 2051 object->FastPropertyAtPut(index, *value); |
| 2045 } | 2052 } |
| 2046 } | 2053 } |
| 2047 | 2054 |
| 2048 | 2055 |
| 2049 static MaybeObject* CopyAddConstantDescriptor(Map* map, | 2056 static MaybeObject* CopyAddConstantDescriptor(Map* map, |
| 2050 Name* name, | 2057 Name* name, |
| 2051 Object* value, | 2058 Object* value, |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2324 if (target_number_of_fields != number_of_fields) return true; | 2331 if (target_number_of_fields != number_of_fields) return true; |
| 2325 | 2332 |
| 2326 // If smi descriptors were replaced by double descriptors, rewrite. | 2333 // If smi descriptors were replaced by double descriptors, rewrite. |
| 2327 DescriptorArray* old_desc = instance_descriptors(); | 2334 DescriptorArray* old_desc = instance_descriptors(); |
| 2328 DescriptorArray* new_desc = target->instance_descriptors(); | 2335 DescriptorArray* new_desc = target->instance_descriptors(); |
| 2329 int limit = NumberOfOwnDescriptors(); | 2336 int limit = NumberOfOwnDescriptors(); |
| 2330 for (int i = 0; i < limit; i++) { | 2337 for (int i = 0; i < limit; i++) { |
| 2331 if (new_desc->GetDetails(i).representation().IsDouble() && | 2338 if (new_desc->GetDetails(i).representation().IsDouble() && |
| 2332 !old_desc->GetDetails(i).representation().IsDouble()) { | 2339 !old_desc->GetDetails(i).representation().IsDouble()) { |
| 2333 return true; | 2340 return true; |
| 2341 } else if (old_desc->GetDetails(i).representation().IsDouble() && |
| 2342 !new_desc->GetDetails(i).representation().IsDouble()) { |
| 2343 return true; |
| 2334 } | 2344 } |
| 2335 } | 2345 } |
| 2336 | 2346 |
| 2337 // If no fields were added, and no inobject properties were removed, setting | 2347 // If no fields were added, and no inobject properties were removed, setting |
| 2338 // the map is sufficient. | 2348 // the map is sufficient. |
| 2339 if (target_inobject == inobject_properties()) return false; | 2349 if (target_inobject == inobject_properties()) return false; |
| 2340 // In-object slack tracking may have reduced the object size of the new map. | 2350 // In-object slack tracking may have reduced the object size of the new map. |
| 2341 // In that case, succeed if all existing fields were inobject, and they still | 2351 // In that case, succeed if all existing fields were inobject, and they still |
| 2342 // fit within the new inobject size. | 2352 // fit within the new inobject size. |
| 2343 ASSERT(target_inobject < inobject_properties()); | 2353 ASSERT(target_inobject < inobject_properties()); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2406 Object* raw_value = old_details.type() == CONSTANT | 2416 Object* raw_value = old_details.type() == CONSTANT |
| 2407 ? old_descriptors->GetValue(i) | 2417 ? old_descriptors->GetValue(i) |
| 2408 : object->RawFastPropertyAt(old_descriptors->GetFieldIndex(i)); | 2418 : object->RawFastPropertyAt(old_descriptors->GetFieldIndex(i)); |
| 2409 Handle<Object> value(raw_value, isolate); | 2419 Handle<Object> value(raw_value, isolate); |
| 2410 if (!old_details.representation().IsDouble() && | 2420 if (!old_details.representation().IsDouble() && |
| 2411 details.representation().IsDouble()) { | 2421 details.representation().IsDouble()) { |
| 2412 if (old_details.representation().IsNone()) { | 2422 if (old_details.representation().IsNone()) { |
| 2413 value = handle(Smi::FromInt(0), isolate); | 2423 value = handle(Smi::FromInt(0), isolate); |
| 2414 } | 2424 } |
| 2415 value = NewStorageFor(isolate, value, details.representation()); | 2425 value = NewStorageFor(isolate, value, details.representation()); |
| 2426 } else if (old_details.representation().IsDouble() && |
| 2427 !details.representation().IsDouble()) { |
| 2428 Handle<HeapNumber> old_value = Handle<HeapNumber>::cast(value); |
| 2429 value = isolate->factory()->NewHeapNumber(old_value->value()); |
| 2416 } | 2430 } |
| 2417 ASSERT(!(details.representation().IsDouble() && value->IsSmi())); | 2431 ASSERT(!(details.representation().IsDouble() && value->IsSmi())); |
| 2418 int target_index = new_descriptors->GetFieldIndex(i) - inobject; | 2432 int target_index = new_descriptors->GetFieldIndex(i) - inobject; |
| 2419 if (target_index < 0) target_index += total_size; | 2433 if (target_index < 0) target_index += total_size; |
| 2420 array->set(target_index, *value); | 2434 array->set(target_index, *value); |
| 2421 } | 2435 } |
| 2422 | 2436 |
| 2423 for (int i = old_nof; i < new_nof; i++) { | 2437 for (int i = old_nof; i < new_nof; i++) { |
| 2424 PropertyDetails details = new_descriptors->GetDetails(i); | 2438 PropertyDetails details = new_descriptors->GetDetails(i); |
| 2425 if (details.type() != FIELD) continue; | 2439 if (details.type() != FIELD) continue; |
| 2426 if (details.representation().IsDouble()) { | 2440 if (details.representation().IsDouble()) { |
| 2427 int target_index = new_descriptors->GetFieldIndex(i) - inobject; | 2441 int target_index = new_descriptors->GetFieldIndex(i) - inobject; |
| 2428 if (target_index < 0) target_index += total_size; | 2442 if (target_index < 0) target_index += total_size; |
| 2429 Handle<Object> box = isolate->factory()->NewHeapNumber(0); | 2443 Handle<Object> box = isolate->factory()->NewHeapNumber(0, MUTABLE); |
| 2430 array->set(target_index, *box); | 2444 array->set(target_index, *box); |
| 2431 } | 2445 } |
| 2432 } | 2446 } |
| 2433 | 2447 |
| 2434 // From here on we cannot fail and we shouldn't GC anymore. | 2448 // From here on we cannot fail and we shouldn't GC anymore. |
| 2435 DisallowHeapAllocation no_allocation; | 2449 DisallowHeapAllocation no_allocation; |
| 2436 | 2450 |
| 2437 // Copy (real) inobject properties. If necessary, stop at number_of_fields to | 2451 // Copy (real) inobject properties. If necessary, stop at number_of_fields to |
| 2438 // avoid overwriting |one_pointer_filler_map|. | 2452 // avoid overwriting |one_pointer_filler_map|. |
| 2439 int limit = Min(inobject, number_of_fields); | 2453 int limit = Min(inobject, number_of_fields); |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3915 descriptors = transition_map->instance_descriptors(); | 3929 descriptors = transition_map->instance_descriptors(); |
| 3916 details = descriptors->GetDetails(descriptor); | 3930 details = descriptors->GetDetails(descriptor); |
| 3917 | 3931 |
| 3918 if (details.type() != FIELD) return value; | 3932 if (details.type() != FIELD) return value; |
| 3919 | 3933 |
| 3920 int field_index = descriptors->GetFieldIndex(descriptor); | 3934 int field_index = descriptors->GetFieldIndex(descriptor); |
| 3921 if (details.representation().IsDouble()) { | 3935 if (details.representation().IsDouble()) { |
| 3922 // Nothing more to be done. | 3936 // Nothing more to be done. |
| 3923 if (value->IsUninitialized()) return value; | 3937 if (value->IsUninitialized()) return value; |
| 3924 HeapNumber* box = HeapNumber::cast(object->RawFastPropertyAt(field_index)); | 3938 HeapNumber* box = HeapNumber::cast(object->RawFastPropertyAt(field_index)); |
| 3939 ASSERT(box->IsMutableHeapNumber()); |
| 3925 box->set_value(value->Number()); | 3940 box->set_value(value->Number()); |
| 3926 } else { | 3941 } else { |
| 3927 object->FastPropertyAtPut(field_index, *value); | 3942 object->FastPropertyAtPut(field_index, *value); |
| 3928 } | 3943 } |
| 3929 | 3944 |
| 3930 return value; | 3945 return value; |
| 3931 } | 3946 } |
| 3932 | 3947 |
| 3933 | 3948 |
| 3934 static void SetPropertyToField(LookupResult* lookup, | 3949 static void SetPropertyToField(LookupResult* lookup, |
| 3935 Handle<Name> name, | 3950 Handle<Name> name, |
| 3936 Handle<Object> value) { | 3951 Handle<Object> value) { |
| 3937 Representation representation = lookup->representation(); | 3952 Representation representation = lookup->representation(); |
| 3938 if (!value->FitsRepresentation(representation) || | 3953 if (!value->FitsRepresentation(representation) || |
| 3939 lookup->type() == CONSTANT) { | 3954 lookup->type() == CONSTANT) { |
| 3940 JSObject::GeneralizeFieldRepresentation(handle(lookup->holder()), | 3955 JSObject::GeneralizeFieldRepresentation(handle(lookup->holder()), |
| 3941 lookup->GetDescriptorIndex(), | 3956 lookup->GetDescriptorIndex(), |
| 3942 value->OptimalRepresentation(), | 3957 value->OptimalRepresentation(), |
| 3943 FORCE_FIELD); | 3958 FORCE_FIELD); |
| 3944 DescriptorArray* desc = lookup->holder()->map()->instance_descriptors(); | 3959 DescriptorArray* desc = lookup->holder()->map()->instance_descriptors(); |
| 3945 int descriptor = lookup->GetDescriptorIndex(); | 3960 int descriptor = lookup->GetDescriptorIndex(); |
| 3946 representation = desc->GetDetails(descriptor).representation(); | 3961 representation = desc->GetDetails(descriptor).representation(); |
| 3947 } | 3962 } |
| 3948 | 3963 |
| 3949 if (representation.IsDouble()) { | 3964 if (representation.IsDouble()) { |
| 3950 HeapNumber* storage = HeapNumber::cast(lookup->holder()->RawFastPropertyAt( | 3965 HeapNumber* storage = HeapNumber::cast(lookup->holder()->RawFastPropertyAt( |
| 3951 lookup->GetFieldIndex().field_index())); | 3966 lookup->GetFieldIndex().field_index())); |
| 3967 ASSERT(storage->IsMutableHeapNumber()); |
| 3952 storage->set_value(value->Number()); | 3968 storage->set_value(value->Number()); |
| 3953 return; | 3969 return; |
| 3954 } | 3970 } |
| 3955 | 3971 |
| 3956 lookup->holder()->FastPropertyAtPut( | 3972 lookup->holder()->FastPropertyAtPut( |
| 3957 lookup->GetFieldIndex().field_index(), *value); | 3973 lookup->GetFieldIndex().field_index(), *value); |
| 3958 } | 3974 } |
| 3959 | 3975 |
| 3960 | 3976 |
| 3961 static void ConvertAndSetLocalProperty(LookupResult* lookup, | 3977 static void ConvertAndSetLocalProperty(LookupResult* lookup, |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4592 Handle<Object> value(descs->GetConstant(i), isolate); | 4608 Handle<Object> value(descs->GetConstant(i), isolate); |
| 4593 PropertyDetails d = PropertyDetails( | 4609 PropertyDetails d = PropertyDetails( |
| 4594 details.attributes(), NORMAL, i + 1); | 4610 details.attributes(), NORMAL, i + 1); |
| 4595 dictionary = NameDictionaryAdd(dictionary, key, value, d); | 4611 dictionary = NameDictionaryAdd(dictionary, key, value, d); |
| 4596 break; | 4612 break; |
| 4597 } | 4613 } |
| 4598 case FIELD: { | 4614 case FIELD: { |
| 4599 Handle<Name> key(descs->GetKey(i)); | 4615 Handle<Name> key(descs->GetKey(i)); |
| 4600 Handle<Object> value( | 4616 Handle<Object> value( |
| 4601 object->RawFastPropertyAt(descs->GetFieldIndex(i)), isolate); | 4617 object->RawFastPropertyAt(descs->GetFieldIndex(i)), isolate); |
| 4618 if (details.representation().IsDouble()) { |
| 4619 ASSERT(value->IsMutableHeapNumber()); |
| 4620 Handle<HeapNumber> old = Handle<HeapNumber>::cast(value); |
| 4621 value = isolate->factory()->NewHeapNumber(old->value()); |
| 4622 } |
| 4602 PropertyDetails d = | 4623 PropertyDetails d = |
| 4603 PropertyDetails(details.attributes(), NORMAL, i + 1); | 4624 PropertyDetails(details.attributes(), NORMAL, i + 1); |
| 4604 dictionary = NameDictionaryAdd(dictionary, key, value, d); | 4625 dictionary = NameDictionaryAdd(dictionary, key, value, d); |
| 4605 break; | 4626 break; |
| 4606 } | 4627 } |
| 4607 case CALLBACKS: { | 4628 case CALLBACKS: { |
| 4608 Handle<Name> key(descs->GetKey(i)); | 4629 Handle<Name> key(descs->GetKey(i)); |
| 4609 Handle<Object> value(descs->GetCallbacksObject(i), isolate); | 4630 Handle<Object> value(descs->GetCallbacksObject(i), isolate); |
| 4610 PropertyDetails d = PropertyDetails( | 4631 PropertyDetails d = PropertyDetails( |
| 4611 details.attributes(), CALLBACKS, i + 1); | 4632 details.attributes(), CALLBACKS, i + 1); |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5634 } | 5655 } |
| 5635 | 5656 |
| 5636 | 5657 |
| 5637 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) { | 5658 Handle<JSObject> JSObject::Copy(Handle<JSObject> object) { |
| 5638 Isolate* isolate = object->GetIsolate(); | 5659 Isolate* isolate = object->GetIsolate(); |
| 5639 CALL_HEAP_FUNCTION(isolate, | 5660 CALL_HEAP_FUNCTION(isolate, |
| 5640 isolate->heap()->CopyJSObject(*object), JSObject); | 5661 isolate->heap()->CopyJSObject(*object), JSObject); |
| 5641 } | 5662 } |
| 5642 | 5663 |
| 5643 | 5664 |
| 5665 Handle<Object> JSObject::FastPropertyAt(Handle<JSObject> object, |
| 5666 Representation representation, |
| 5667 int index) { |
| 5668 Isolate* isolate = object->GetIsolate(); |
| 5669 CALL_HEAP_FUNCTION(isolate, |
| 5670 object->FastPropertyAt(representation, index), Object); |
| 5671 } |
| 5672 |
| 5673 |
| 5644 template<class ContextObject> | 5674 template<class ContextObject> |
| 5645 class JSObjectWalkVisitor { | 5675 class JSObjectWalkVisitor { |
| 5646 public: | 5676 public: |
| 5647 JSObjectWalkVisitor(ContextObject* site_context, bool copying, | 5677 JSObjectWalkVisitor(ContextObject* site_context, bool copying, |
| 5648 JSObject::DeepCopyHints hints) | 5678 JSObject::DeepCopyHints hints) |
| 5649 : site_context_(site_context), | 5679 : site_context_(site_context), |
| 5650 copying_(copying), | 5680 copying_(copying), |
| 5651 hints_(hints) {} | 5681 hints_(hints) {} |
| 5652 | 5682 |
| 5653 Handle<JSObject> StructureWalk(Handle<JSObject> object); | 5683 Handle<JSObject> StructureWalk(Handle<JSObject> object); |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6623 | 6653 |
| 6624 | 6654 |
| 6625 Object* JSObject::SlowReverseLookup(Object* value) { | 6655 Object* JSObject::SlowReverseLookup(Object* value) { |
| 6626 if (HasFastProperties()) { | 6656 if (HasFastProperties()) { |
| 6627 int number_of_own_descriptors = map()->NumberOfOwnDescriptors(); | 6657 int number_of_own_descriptors = map()->NumberOfOwnDescriptors(); |
| 6628 DescriptorArray* descs = map()->instance_descriptors(); | 6658 DescriptorArray* descs = map()->instance_descriptors(); |
| 6629 for (int i = 0; i < number_of_own_descriptors; i++) { | 6659 for (int i = 0; i < number_of_own_descriptors; i++) { |
| 6630 if (descs->GetType(i) == FIELD) { | 6660 if (descs->GetType(i) == FIELD) { |
| 6631 Object* property = RawFastPropertyAt(descs->GetFieldIndex(i)); | 6661 Object* property = RawFastPropertyAt(descs->GetFieldIndex(i)); |
| 6632 if (descs->GetDetails(i).representation().IsDouble()) { | 6662 if (descs->GetDetails(i).representation().IsDouble()) { |
| 6633 ASSERT(property->IsHeapNumber()); | 6663 ASSERT(property->IsMutableHeapNumber()); |
| 6634 if (value->IsNumber() && property->Number() == value->Number()) { | 6664 if (value->IsNumber() && property->Number() == value->Number()) { |
| 6635 return descs->GetKey(i); | 6665 return descs->GetKey(i); |
| 6636 } | 6666 } |
| 6637 } else if (property == value) { | 6667 } else if (property == value) { |
| 6638 return descs->GetKey(i); | 6668 return descs->GetKey(i); |
| 6639 } | 6669 } |
| 6640 } else if (descs->GetType(i) == CONSTANT) { | 6670 } else if (descs->GetType(i) == CONSTANT) { |
| 6641 if (descs->GetConstant(i) == value) { | 6671 if (descs->GetConstant(i) == value) { |
| 6642 return descs->GetKey(i); | 6672 return descs->GetKey(i); |
| 6643 } | 6673 } |
| (...skipping 9788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16432 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16462 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16433 static const char* error_messages_[] = { | 16463 static const char* error_messages_[] = { |
| 16434 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16464 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16435 }; | 16465 }; |
| 16436 #undef ERROR_MESSAGES_TEXTS | 16466 #undef ERROR_MESSAGES_TEXTS |
| 16437 return error_messages_[reason]; | 16467 return error_messages_[reason]; |
| 16438 } | 16468 } |
| 16439 | 16469 |
| 16440 | 16470 |
| 16441 } } // namespace v8::internal | 16471 } } // namespace v8::internal |
| OLD | NEW |