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 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 Object** zap = reinterpret_cast<Object**>(new_end); | 2181 Object** zap = reinterpret_cast<Object**>(new_end); |
2182 zap++; // Header of filler must be at least one word so skip that. | 2182 zap++; // Header of filler must be at least one word so skip that. |
2183 for (int i = 1; i < to_trim; i++) { | 2183 for (int i = 1; i < to_trim; i++) { |
2184 *zap++ = Smi::FromInt(0); | 2184 *zap++ = Smi::FromInt(0); |
2185 } | 2185 } |
2186 } | 2186 } |
2187 | 2187 |
2188 | 2188 |
2189 template<RightTrimMode trim_mode> | 2189 template<RightTrimMode trim_mode> |
2190 static void RightTrimFixedArray(Heap* heap, FixedArray* elms, int to_trim) { | 2190 static void RightTrimFixedArray(Heap* heap, FixedArray* elms, int to_trim) { |
2191 ASSERT(elms->map() != HEAP->fixed_cow_array_map()); | 2191 ASSERT(elms->map() != heap->fixed_cow_array_map()); |
2192 // For now this trick is only applied to fixed arrays in new and paged space. | 2192 // For now this trick is only applied to fixed arrays in new and paged space. |
2193 ASSERT(!HEAP->lo_space()->Contains(elms)); | 2193 ASSERT(!heap->lo_space()->Contains(elms)); |
2194 | 2194 |
2195 const int len = elms->length(); | 2195 const int len = elms->length(); |
2196 | 2196 |
2197 ASSERT(to_trim < len); | 2197 ASSERT(to_trim < len); |
2198 | 2198 |
2199 Address new_end = elms->address() + FixedArray::SizeFor(len - to_trim); | 2199 Address new_end = elms->address() + FixedArray::SizeFor(len - to_trim); |
2200 | 2200 |
2201 if (trim_mode != FROM_GC || Heap::ShouldZapGarbage()) { | 2201 if (trim_mode != FROM_GC || Heap::ShouldZapGarbage()) { |
2202 ZapEndOfFixedArray(new_end, to_trim); | 2202 ZapEndOfFixedArray(new_end, to_trim); |
2203 } | 2203 } |
(...skipping 5769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7973 return copy; | 7973 return copy; |
7974 } | 7974 } |
7975 | 7975 |
7976 | 7976 |
7977 Object* AccessorPair::GetComponent(AccessorComponent component) { | 7977 Object* AccessorPair::GetComponent(AccessorComponent component) { |
7978 Object* accessor = get(component); | 7978 Object* accessor = get(component); |
7979 return accessor->IsTheHole() ? GetHeap()->undefined_value() : accessor; | 7979 return accessor->IsTheHole() ? GetHeap()->undefined_value() : accessor; |
7980 } | 7980 } |
7981 | 7981 |
7982 | 7982 |
7983 MaybeObject* DeoptimizationInputData::Allocate(int deopt_entry_count, | 7983 MaybeObject* DeoptimizationInputData::Allocate(Isolate* isolate, |
| 7984 int deopt_entry_count, |
7984 PretenureFlag pretenure) { | 7985 PretenureFlag pretenure) { |
7985 ASSERT(deopt_entry_count > 0); | 7986 ASSERT(deopt_entry_count > 0); |
7986 return HEAP->AllocateFixedArray(LengthFor(deopt_entry_count), | 7987 return isolate->heap()->AllocateFixedArray(LengthFor(deopt_entry_count), |
7987 pretenure); | 7988 pretenure); |
7988 } | 7989 } |
7989 | 7990 |
7990 | 7991 |
7991 MaybeObject* DeoptimizationOutputData::Allocate(int number_of_deopt_points, | 7992 MaybeObject* DeoptimizationOutputData::Allocate(Isolate* isolate, |
| 7993 int number_of_deopt_points, |
7992 PretenureFlag pretenure) { | 7994 PretenureFlag pretenure) { |
7993 if (number_of_deopt_points == 0) return HEAP->empty_fixed_array(); | 7995 if (number_of_deopt_points == 0) return isolate->heap()->empty_fixed_array(); |
7994 return HEAP->AllocateFixedArray(LengthOfFixedArray(number_of_deopt_points), | 7996 return isolate->heap()->AllocateFixedArray( |
7995 pretenure); | 7997 LengthOfFixedArray(number_of_deopt_points), pretenure); |
7996 } | 7998 } |
7997 | 7999 |
7998 | 8000 |
7999 #ifdef DEBUG | 8001 #ifdef DEBUG |
8000 bool DescriptorArray::IsEqualTo(DescriptorArray* other) { | 8002 bool DescriptorArray::IsEqualTo(DescriptorArray* other) { |
8001 if (IsEmpty()) return other->IsEmpty(); | 8003 if (IsEmpty()) return other->IsEmpty(); |
8002 if (other->IsEmpty()) return false; | 8004 if (other->IsEmpty()) return false; |
8003 if (length() != other->length()) return false; | 8005 if (length() != other->length()) return false; |
8004 for (int i = 0; i < length(); ++i) { | 8006 for (int i = 0; i < length(); ++i) { |
8005 if (get(i) != other->get(i)) return false; | 8007 if (get(i) != other->get(i)) return false; |
(...skipping 8072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16078 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16080 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16079 static const char* error_messages_[] = { | 16081 static const char* error_messages_[] = { |
16080 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16082 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16081 }; | 16083 }; |
16082 #undef ERROR_MESSAGES_TEXTS | 16084 #undef ERROR_MESSAGES_TEXTS |
16083 return error_messages_[reason]; | 16085 return error_messages_[reason]; |
16084 } | 16086 } |
16085 | 16087 |
16086 | 16088 |
16087 } } // namespace v8::internal | 16089 } } // namespace v8::internal |
OLD | NEW |