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

Side by Side Diff: src/objects.cc

Issue 8357004: Add flag to tracing element kind transitions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix nits Created 9 years, 2 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 return context->string_function()->instance_prototype(); 706 return context->string_function()->instance_prototype();
707 } 707 }
708 if (heap_object->IsBoolean()) { 708 if (heap_object->IsBoolean()) {
709 return context->boolean_function()->instance_prototype(); 709 return context->boolean_function()->instance_prototype();
710 } else { 710 } else {
711 return heap->null_value(); 711 return heap->null_value();
712 } 712 }
713 } 713 }
714 714
715 715
716 void Object::MiniPrint() {
717 if (IsSmi()) {
718 PrintF("%d", Smi::cast(this)->value());
719 } else if (IsString() || IsSymbol()) {
720 String::cast(this)->MiniPrint();
721 } else if (IsNumber()) {
722 PrintF("%g", Number());
723 } else if (IsFailure()) {
724 PrintF("<failure>");
725 } else if (IsUndefined()) {
726 PrintF("<undefined>");
727 } else if (IsNull()) {
728 PrintF("<null>");
729 } else if (IsTrue()) {
730 PrintF("<true>");
731 } else if (IsFalse()) {
732 PrintF("<false>");
733 } else {
734 PrintF("%p", reinterpret_cast<void*>(this));
735 }
736 }
737
738
716 void Object::ShortPrint(FILE* out) { 739 void Object::ShortPrint(FILE* out) {
717 HeapStringAllocator allocator; 740 HeapStringAllocator allocator;
718 StringStream accumulator(&allocator); 741 StringStream accumulator(&allocator);
719 ShortPrint(&accumulator); 742 ShortPrint(&accumulator);
720 accumulator.OutputToFile(out); 743 accumulator.OutputToFile(out);
721 } 744 }
722 745
723 746
724 void Object::ShortPrint(StringStream* accumulator) { 747 void Object::ShortPrint(StringStream* accumulator) {
725 if (IsSmi()) { 748 if (IsSmi()) {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 int new_size = this->Size(); // Byte size of the external String object. 962 int new_size = this->Size(); // Byte size of the external String object.
940 heap->CreateFillerObjectAt(this->address() + new_size, size - new_size); 963 heap->CreateFillerObjectAt(this->address() + new_size, size - new_size);
941 if (Marking::IsBlack(Marking::MarkBitFrom(this))) { 964 if (Marking::IsBlack(Marking::MarkBitFrom(this))) {
942 MemoryChunk::IncrementLiveBytes(this->address(), new_size - size); 965 MemoryChunk::IncrementLiveBytes(this->address(), new_size - size);
943 } 966 }
944 967
945 return true; 968 return true;
946 } 969 }
947 970
948 971
972 void String::MiniPrint() {
973 // not uncommon to have empty strings
974 if (length() > 0) {
975 SmartArrayPointer<char> s =
976 ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
977 PrintF("%s", *s);
978 }
979 }
980
981
949 void String::StringShortPrint(StringStream* accumulator) { 982 void String::StringShortPrint(StringStream* accumulator) {
950 int len = length(); 983 int len = length();
951 if (len > kMaxShortPrintLength) { 984 if (len > kMaxShortPrintLength) {
952 accumulator->Add("<Very long string[%u]>", len); 985 accumulator->Add("<Very long string[%u]>", len);
953 return; 986 return;
954 } 987 }
955 988
956 if (!LooksValid()) { 989 if (!LooksValid()) {
957 accumulator->Add("<Invalid String>"); 990 accumulator->Add("<Invalid String>");
958 return; 991 return;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 accumulator->Add(" value = "); 1113 accumulator->Add(" value = ");
1081 JSValue::cast(this)->value()->ShortPrint(accumulator); 1114 JSValue::cast(this)->value()->ShortPrint(accumulator);
1082 } 1115 }
1083 accumulator->Put('>'); 1116 accumulator->Put('>');
1084 break; 1117 break;
1085 } 1118 }
1086 } 1119 }
1087 } 1120 }
1088 1121
1089 1122
1123 void JSObject::PrintElementsTransition(
1124 FILE* file, ElementsKind from_kind, FixedArrayBase* from_elements,
1125 ElementsKind to_kind, FixedArrayBase* to_elements) {
1126 PrintF("elements transition [");
Jakob Kummerow 2011/10/19 16:02:28 It doesn't make a difference for the current usage
danno 2011/10/20 08:51:17 Done.
1127 PrintElementsKind(file, from_kind);
1128 PrintF(" -> ");
1129 PrintElementsKind(file, to_kind);
1130 PrintF("] in ");
1131 JavaScriptFrame::PrintTop(false, true);
1132 PrintF(" for ");
1133 ShortPrint(file);
1134 PrintF(" from ");
1135 from_elements->ShortPrint(file);
1136 PrintF(" to ");
1137 to_elements->ShortPrint(file);
1138 PrintF("\n");
1139 }
1140
1141
1090 void HeapObject::HeapObjectShortPrint(StringStream* accumulator) { 1142 void HeapObject::HeapObjectShortPrint(StringStream* accumulator) {
1091 Heap* heap = GetHeap(); 1143 Heap* heap = GetHeap();
1092 if (!heap->Contains(this)) { 1144 if (!heap->Contains(this)) {
1093 accumulator->Add("!!!INVALID POINTER!!!"); 1145 accumulator->Add("!!!INVALID POINTER!!!");
1094 return; 1146 return;
1095 } 1147 }
1096 if (!heap->Contains(map())) { 1148 if (!heap->Contains(map())) {
1097 accumulator->Add("!!!INVALID MAP!!!"); 1149 accumulator->Add("!!!INVALID MAP!!!");
1098 return; 1150 return;
1099 } 1151 }
1100 1152
1101 accumulator->Add("%p ", this); 1153 accumulator->Add("%p ", this);
1102 1154
1103 if (IsString()) { 1155 if (IsString()) {
1104 String::cast(this)->StringShortPrint(accumulator); 1156 String::cast(this)->StringShortPrint(accumulator);
1105 return; 1157 return;
1106 } 1158 }
1107 if (IsJSObject()) { 1159 if (IsJSObject()) {
1108 JSObject::cast(this)->JSObjectShortPrint(accumulator); 1160 JSObject::cast(this)->JSObjectShortPrint(accumulator);
1109 return; 1161 return;
1110 } 1162 }
1111 switch (map()->instance_type()) { 1163 switch (map()->instance_type()) {
1112 case MAP_TYPE: 1164 case MAP_TYPE:
1113 accumulator->Add("<Map(elements=%u)>", Map::cast(this)->elements_kind()); 1165 accumulator->Add("<Map(elements=%u)>", Map::cast(this)->elements_kind());
1114 break; 1166 break;
1115 case FIXED_ARRAY_TYPE: 1167 case FIXED_ARRAY_TYPE:
1116 accumulator->Add("<FixedArray[%u]>", FixedArray::cast(this)->length()); 1168 accumulator->Add("<FixedArray[%u]>", FixedArray::cast(this)->length());
1117 break; 1169 break;
1170 case FIXED_DOUBLE_ARRAY_TYPE:
1171 accumulator->Add("<FixedDoubleArray[%u]>",
1172 FixedDoubleArray::cast(this)->length());
1173 break;
1118 case BYTE_ARRAY_TYPE: 1174 case BYTE_ARRAY_TYPE:
1119 accumulator->Add("<ByteArray[%u]>", ByteArray::cast(this)->length()); 1175 accumulator->Add("<ByteArray[%u]>", ByteArray::cast(this)->length());
1120 break; 1176 break;
1121 case FREE_SPACE_TYPE: 1177 case FREE_SPACE_TYPE:
1122 accumulator->Add("<FreeSpace[%u]>", FreeSpace::cast(this)->Size()); 1178 accumulator->Add("<FreeSpace[%u]>", FreeSpace::cast(this)->Size());
1123 break; 1179 break;
1124 case EXTERNAL_PIXEL_ARRAY_TYPE: 1180 case EXTERNAL_PIXEL_ARRAY_TYPE:
1125 accumulator->Add("<ExternalPixelArray[%u]>", 1181 accumulator->Add("<ExternalPixelArray[%u]>",
1126 ExternalPixelArray::cast(this)->length()); 1182 ExternalPixelArray::cast(this)->length());
1127 break; 1183 break;
(...skipping 6802 matching lines...) Expand 10 before | Expand all | Expand 10 after
7930 (elements()->map()->has_fast_smi_only_elements() || 7986 (elements()->map()->has_fast_smi_only_elements() ||
7931 elements() == heap->empty_fixed_array()); 7987 elements() == heap->empty_fixed_array());
7932 ElementsKind elements_kind = has_fast_smi_only_elements 7988 ElementsKind elements_kind = has_fast_smi_only_elements
7933 ? FAST_SMI_ONLY_ELEMENTS 7989 ? FAST_SMI_ONLY_ELEMENTS
7934 : FAST_ELEMENTS; 7990 : FAST_ELEMENTS;
7935 MaybeObject* maybe = GetElementsTransitionMap(elements_kind); 7991 MaybeObject* maybe = GetElementsTransitionMap(elements_kind);
7936 if (!maybe->ToObject(&object)) return maybe; 7992 if (!maybe->ToObject(&object)) return maybe;
7937 new_map = Map::cast(object); 7993 new_map = Map::cast(object);
7938 } 7994 }
7939 7995
7996 FixedArrayBase* old_elements_raw = elements();
7940 ElementsKind elements_kind = GetElementsKind(); 7997 ElementsKind elements_kind = GetElementsKind();
7941 switch (elements_kind) { 7998 switch (elements_kind) {
7942 case FAST_SMI_ONLY_ELEMENTS: 7999 case FAST_SMI_ONLY_ELEMENTS:
7943 case FAST_ELEMENTS: { 8000 case FAST_ELEMENTS: {
7944 AssertNoAllocation no_gc; 8001 AssertNoAllocation no_gc;
7945 WriteBarrierMode mode(new_elements->GetWriteBarrierMode(no_gc)); 8002 WriteBarrierMode mode(new_elements->GetWriteBarrierMode(no_gc));
7946 CopyFastElementsToFast(FixedArray::cast(elements()), new_elements, mode); 8003 CopyFastElementsToFast(FixedArray::cast(old_elements_raw),
8004 new_elements, mode);
7947 set_map(new_map); 8005 set_map(new_map);
7948 set_elements(new_elements); 8006 set_elements(new_elements);
7949 break; 8007 break;
7950 } 8008 }
7951 case DICTIONARY_ELEMENTS: { 8009 case DICTIONARY_ELEMENTS: {
7952 AssertNoAllocation no_gc; 8010 AssertNoAllocation no_gc;
7953 WriteBarrierMode mode = new_elements->GetWriteBarrierMode(no_gc); 8011 WriteBarrierMode mode = new_elements->GetWriteBarrierMode(no_gc);
7954 CopySlowElementsToFast(NumberDictionary::cast(elements()), 8012 CopySlowElementsToFast(NumberDictionary::cast(old_elements_raw),
7955 new_elements, 8013 new_elements,
7956 mode); 8014 mode);
7957 set_map(new_map); 8015 set_map(new_map);
7958 set_elements(new_elements); 8016 set_elements(new_elements);
7959 break; 8017 break;
7960 } 8018 }
7961 case NON_STRICT_ARGUMENTS_ELEMENTS: { 8019 case NON_STRICT_ARGUMENTS_ELEMENTS: {
7962 AssertNoAllocation no_gc; 8020 AssertNoAllocation no_gc;
7963 WriteBarrierMode mode = new_elements->GetWriteBarrierMode(no_gc); 8021 WriteBarrierMode mode = new_elements->GetWriteBarrierMode(no_gc);
7964 // The object's map and the parameter map are unchanged, the unaliased 8022 // The object's map and the parameter map are unchanged, the unaliased
7965 // arguments are copied to the new backing store. 8023 // arguments are copied to the new backing store.
7966 FixedArray* parameter_map = FixedArray::cast(elements()); 8024 FixedArray* parameter_map = FixedArray::cast(old_elements_raw);
7967 FixedArray* arguments = FixedArray::cast(parameter_map->get(1)); 8025 FixedArray* arguments = FixedArray::cast(parameter_map->get(1));
7968 if (arguments->IsDictionary()) { 8026 if (arguments->IsDictionary()) {
7969 CopySlowElementsToFast(NumberDictionary::cast(arguments), 8027 CopySlowElementsToFast(NumberDictionary::cast(arguments),
7970 new_elements, 8028 new_elements,
7971 mode); 8029 mode);
7972 } else { 8030 } else {
7973 CopyFastElementsToFast(arguments, new_elements, mode); 8031 CopyFastElementsToFast(arguments, new_elements, mode);
7974 } 8032 }
7975 parameter_map->set(1, new_elements); 8033 parameter_map->set(1, new_elements);
7976 break; 8034 break;
7977 } 8035 }
7978 case FAST_DOUBLE_ELEMENTS: { 8036 case FAST_DOUBLE_ELEMENTS: {
7979 FixedDoubleArray* old_elements = FixedDoubleArray::cast(elements()); 8037 FixedDoubleArray* old_elements = FixedDoubleArray::cast(old_elements_raw);
7980 uint32_t old_length = static_cast<uint32_t>(old_elements->length()); 8038 uint32_t old_length = static_cast<uint32_t>(old_elements->length());
7981 // Fill out the new array with this content and array holes. 8039 // Fill out the new array with this content and array holes.
7982 for (uint32_t i = 0; i < old_length; i++) { 8040 for (uint32_t i = 0; i < old_length; i++) {
7983 if (!old_elements->is_the_hole(i)) { 8041 if (!old_elements->is_the_hole(i)) {
7984 Object* obj; 8042 Object* obj;
7985 // Objects must be allocated in the old object space, since the 8043 // Objects must be allocated in the old object space, since the
7986 // overall number of HeapNumbers needed for the conversion might 8044 // overall number of HeapNumbers needed for the conversion might
7987 // exceed the capacity of new space, and we would fail repeatedly 8045 // exceed the capacity of new space, and we would fail repeatedly
7988 // trying to convert the FixedDoubleArray. 8046 // trying to convert the FixedDoubleArray.
7989 MaybeObject* maybe_value_object = 8047 MaybeObject* maybe_value_object =
(...skipping 17 matching lines...) Expand all
8007 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 8065 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
8008 case EXTERNAL_INT_ELEMENTS: 8066 case EXTERNAL_INT_ELEMENTS:
8009 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 8067 case EXTERNAL_UNSIGNED_INT_ELEMENTS:
8010 case EXTERNAL_FLOAT_ELEMENTS: 8068 case EXTERNAL_FLOAT_ELEMENTS:
8011 case EXTERNAL_DOUBLE_ELEMENTS: 8069 case EXTERNAL_DOUBLE_ELEMENTS:
8012 case EXTERNAL_PIXEL_ELEMENTS: 8070 case EXTERNAL_PIXEL_ELEMENTS:
8013 UNREACHABLE(); 8071 UNREACHABLE();
8014 break; 8072 break;
8015 } 8073 }
8016 8074
8075 if (FLAG_trace_element_transitions) {
8076 PrintElementsTransition(stdout, elements_kind, old_elements_raw,
8077 FAST_ELEMENTS, new_elements);
8078 }
8079
8017 // Update the length if necessary. 8080 // Update the length if necessary.
8018 if (IsJSArray()) { 8081 if (IsJSArray()) {
8019 JSArray::cast(this)->set_length(Smi::FromInt(length)); 8082 JSArray::cast(this)->set_length(Smi::FromInt(length));
8020 } 8083 }
8021 8084
8022 return new_elements; 8085 return new_elements;
8023 } 8086 }
8024 8087
8025 8088
8026 MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( 8089 MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength(
8027 int capacity, 8090 int capacity,
8028 int length) { 8091 int length) {
8029 Heap* heap = GetHeap(); 8092 Heap* heap = GetHeap();
8030 // We should never end in here with a pixel or external array. 8093 // We should never end in here with a pixel or external array.
8031 ASSERT(!HasExternalArrayElements()); 8094 ASSERT(!HasExternalArrayElements());
8032 8095
8033 Object* obj; 8096 Object* obj;
8034 { MaybeObject* maybe_obj = 8097 { MaybeObject* maybe_obj =
8035 heap->AllocateUninitializedFixedDoubleArray(capacity); 8098 heap->AllocateUninitializedFixedDoubleArray(capacity);
8036 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 8099 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
8037 } 8100 }
8038 FixedDoubleArray* elems = FixedDoubleArray::cast(obj); 8101 FixedDoubleArray* elems = FixedDoubleArray::cast(obj);
8039 8102
8040 { MaybeObject* maybe_obj = 8103 { MaybeObject* maybe_obj =
8041 GetElementsTransitionMap(FAST_DOUBLE_ELEMENTS); 8104 GetElementsTransitionMap(FAST_DOUBLE_ELEMENTS);
8042 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 8105 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
8043 } 8106 }
8044 Map* new_map = Map::cast(obj); 8107 Map* new_map = Map::cast(obj);
8045 8108
8109 FixedArrayBase* old_elements = elements();
8110 ElementsKind elements_kind(GetElementsKind());
Jakob Kummerow 2011/10/19 16:02:28 nit: for consistency with line 8156: ElementsKind
8046 AssertNoAllocation no_gc; 8111 AssertNoAllocation no_gc;
8047 switch (GetElementsKind()) { 8112 switch (elements_kind) {
8048 case FAST_SMI_ONLY_ELEMENTS: 8113 case FAST_SMI_ONLY_ELEMENTS:
8049 case FAST_ELEMENTS: { 8114 case FAST_ELEMENTS: {
8050 elems->Initialize(FixedArray::cast(elements())); 8115 elems->Initialize(FixedArray::cast(old_elements));
8051 break; 8116 break;
8052 } 8117 }
8053 case FAST_DOUBLE_ELEMENTS: { 8118 case FAST_DOUBLE_ELEMENTS: {
8054 elems->Initialize(FixedDoubleArray::cast(elements())); 8119 elems->Initialize(FixedDoubleArray::cast(old_elements));
8055 break; 8120 break;
8056 } 8121 }
8057 case DICTIONARY_ELEMENTS: { 8122 case DICTIONARY_ELEMENTS: {
8058 elems->Initialize(NumberDictionary::cast(elements())); 8123 elems->Initialize(NumberDictionary::cast(old_elements));
8059 break; 8124 break;
8060 } 8125 }
8061 default: 8126 default:
8062 UNREACHABLE(); 8127 UNREACHABLE();
8063 break; 8128 break;
8064 } 8129 }
8065 8130
8131 if (FLAG_trace_element_transitions) {
8132 PrintElementsTransition(stdout, elements_kind, old_elements,
8133 FAST_DOUBLE_ELEMENTS, elems);
8134 }
8135
8066 ASSERT(new_map->has_fast_double_elements()); 8136 ASSERT(new_map->has_fast_double_elements());
8067 set_map(new_map); 8137 set_map(new_map);
8068 ASSERT(elems->IsFixedDoubleArray()); 8138 ASSERT(elems->IsFixedDoubleArray());
8069 set_elements(elems); 8139 set_elements(elems);
8070 8140
8071 if (IsJSArray()) { 8141 if (IsJSArray()) {
8072 JSArray::cast(this)->set_length(Smi::FromInt(length)); 8142 JSArray::cast(this)->set_length(Smi::FromInt(length));
8073 } 8143 }
8074 8144
8075 return this; 8145 return this;
8076 } 8146 }
8077 8147
8078 8148
8079 MaybeObject* JSObject::SetSlowElements(Object* len) { 8149 MaybeObject* JSObject::SetSlowElements(Object* len) {
8080 // We should never end in here with a pixel or external array. 8150 // We should never end in here with a pixel or external array.
8081 ASSERT(!HasExternalArrayElements()); 8151 ASSERT(!HasExternalArrayElements());
8082 8152
8083 uint32_t new_length = static_cast<uint32_t>(len->Number()); 8153 uint32_t new_length = static_cast<uint32_t>(len->Number());
8084 8154
8085 switch (GetElementsKind()) { 8155 FixedArrayBase* old_elements = elements();
8156 ElementsKind elements_kind = GetElementsKind();
8157 switch (elements_kind) {
8086 case FAST_SMI_ONLY_ELEMENTS: 8158 case FAST_SMI_ONLY_ELEMENTS:
8087 case FAST_ELEMENTS: 8159 case FAST_ELEMENTS:
8088 case FAST_DOUBLE_ELEMENTS: { 8160 case FAST_DOUBLE_ELEMENTS: {
8089 // Make sure we never try to shrink dense arrays into sparse arrays. 8161 // Make sure we never try to shrink dense arrays into sparse arrays.
8090 ASSERT(static_cast<uint32_t>( 8162 ASSERT(static_cast<uint32_t>(old_elements->length()) <= new_length);
8091 FixedArrayBase::cast(elements())->length()) <= new_length);
8092 MaybeObject* result = NormalizeElements(); 8163 MaybeObject* result = NormalizeElements();
8093 if (result->IsFailure()) return result; 8164 if (result->IsFailure()) return result;
8094 8165
8095 // Update length for JSArrays. 8166 // Update length for JSArrays.
8096 if (IsJSArray()) JSArray::cast(this)->set_length(len); 8167 if (IsJSArray()) JSArray::cast(this)->set_length(len);
8097 break; 8168 break;
8098 } 8169 }
8099 case DICTIONARY_ELEMENTS: { 8170 case DICTIONARY_ELEMENTS: {
8100 if (IsJSArray()) { 8171 if (IsJSArray()) {
8101 uint32_t old_length = 8172 uint32_t old_length =
(...skipping 11 matching lines...) Expand all
8113 case EXTERNAL_SHORT_ELEMENTS: 8184 case EXTERNAL_SHORT_ELEMENTS:
8114 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 8185 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
8115 case EXTERNAL_INT_ELEMENTS: 8186 case EXTERNAL_INT_ELEMENTS:
8116 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 8187 case EXTERNAL_UNSIGNED_INT_ELEMENTS:
8117 case EXTERNAL_FLOAT_ELEMENTS: 8188 case EXTERNAL_FLOAT_ELEMENTS:
8118 case EXTERNAL_DOUBLE_ELEMENTS: 8189 case EXTERNAL_DOUBLE_ELEMENTS:
8119 case EXTERNAL_PIXEL_ELEMENTS: 8190 case EXTERNAL_PIXEL_ELEMENTS:
8120 UNREACHABLE(); 8191 UNREACHABLE();
8121 break; 8192 break;
8122 } 8193 }
8194
8195 if (FLAG_trace_element_transitions) {
8196 PrintElementsTransition(stdout, elements_kind, old_elements,
8197 DICTIONARY_ELEMENTS, elements());
8198 }
8199
8123 return this; 8200 return this;
8124 } 8201 }
8125 8202
8126 8203
8127 MaybeObject* JSArray::Initialize(int capacity) { 8204 MaybeObject* JSArray::Initialize(int capacity) {
8128 Heap* heap = GetHeap(); 8205 Heap* heap = GetHeap();
8129 ASSERT(capacity >= 0); 8206 ASSERT(capacity >= 0);
8130 set_length(Smi::FromInt(0)); 8207 set_length(Smi::FromInt(0));
8131 FixedArray* new_elements; 8208 FixedArray* new_elements;
8132 if (capacity == 0) { 8209 if (capacity == 0) {
(...skipping 4205 matching lines...) Expand 10 before | Expand all | Expand 10 after
12338 if (break_point_objects()->IsUndefined()) return 0; 12415 if (break_point_objects()->IsUndefined()) return 0;
12339 // Single break point. 12416 // Single break point.
12340 if (!break_point_objects()->IsFixedArray()) return 1; 12417 if (!break_point_objects()->IsFixedArray()) return 1;
12341 // Multiple break points. 12418 // Multiple break points.
12342 return FixedArray::cast(break_point_objects())->length(); 12419 return FixedArray::cast(break_point_objects())->length();
12343 } 12420 }
12344 #endif // ENABLE_DEBUGGER_SUPPORT 12421 #endif // ENABLE_DEBUGGER_SUPPORT
12345 12422
12346 12423
12347 } } // namespace v8::internal 12424 } } // namespace v8::internal
OLDNEW
« src/frames.cc ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698