| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 // NaN, +0, and -0 should return the false object | 1150 // NaN, +0, and -0 should return the false object |
| 1151 #if __BYTE_ORDER == __LITTLE_ENDIAN | 1151 #if __BYTE_ORDER == __LITTLE_ENDIAN |
| 1152 union IeeeDoubleLittleEndianArchType u; | 1152 union IeeeDoubleLittleEndianArchType u; |
| 1153 #elif __BYTE_ORDER == __BIG_ENDIAN | 1153 #elif __BYTE_ORDER == __BIG_ENDIAN |
| 1154 union IeeeDoubleBigEndianArchType u; | 1154 union IeeeDoubleBigEndianArchType u; |
| 1155 #endif | 1155 #endif |
| 1156 u.d = value(); | 1156 u.d = value(); |
| 1157 if (u.bits.exp == 2047) { | 1157 if (u.bits.exp == 2047) { |
| 1158 // Detect NaN for IEEE double precision floating point. | 1158 // Detect NaN for IEEE double precision floating point. |
| 1159 if ((u.bits.man_low | u.bits.man_high) != 0) | 1159 if ((u.bits.man_low | u.bits.man_high) != 0) |
| 1160 return HEAP->false_value(); | 1160 return GetHeap()->false_value(); |
| 1161 } | 1161 } |
| 1162 if (u.bits.exp == 0) { | 1162 if (u.bits.exp == 0) { |
| 1163 // Detect +0, and -0 for IEEE double precision floating point. | 1163 // Detect +0, and -0 for IEEE double precision floating point. |
| 1164 if ((u.bits.man_low | u.bits.man_high) == 0) | 1164 if ((u.bits.man_low | u.bits.man_high) == 0) |
| 1165 return HEAP->false_value(); | 1165 return GetHeap()->false_value(); |
| 1166 } | 1166 } |
| 1167 return HEAP->true_value(); | 1167 return GetHeap()->true_value(); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 | 1170 |
| 1171 void HeapNumber::HeapNumberPrint() { | 1171 void HeapNumber::HeapNumberPrint() { |
| 1172 PrintF("%.16g", Number()); | 1172 PrintF("%.16g", Number()); |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 | 1175 |
| 1176 void HeapNumber::HeapNumberPrint(StringStream* accumulator) { | 1176 void HeapNumber::HeapNumberPrint(StringStream* accumulator) { |
| 1177 // The Windows version of vsnprintf can allocate when printing a %g string | 1177 // The Windows version of vsnprintf can allocate when printing a %g string |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 if (obj->IsFailure()) return obj; | 2312 if (obj->IsFailure()) return obj; |
| 2313 Map* new_map = Map::cast(obj); | 2313 Map* new_map = Map::cast(obj); |
| 2314 | 2314 |
| 2315 // We have now successfully allocated all the necessary objects. | 2315 // We have now successfully allocated all the necessary objects. |
| 2316 // Changes can now be made with the guarantee that all of them take effect. | 2316 // Changes can now be made with the guarantee that all of them take effect. |
| 2317 | 2317 |
| 2318 // Resize the object in the heap if necessary. | 2318 // Resize the object in the heap if necessary. |
| 2319 int new_instance_size = new_map->instance_size(); | 2319 int new_instance_size = new_map->instance_size(); |
| 2320 int instance_size_delta = map()->instance_size() - new_instance_size; | 2320 int instance_size_delta = map()->instance_size() - new_instance_size; |
| 2321 ASSERT(instance_size_delta >= 0); | 2321 ASSERT(instance_size_delta >= 0); |
| 2322 HEAP->CreateFillerObjectAt(this->address() + new_instance_size, | 2322 heap->CreateFillerObjectAt(this->address() + new_instance_size, |
| 2323 instance_size_delta); | 2323 instance_size_delta); |
| 2324 | 2324 |
| 2325 set_map(new_map); | 2325 set_map(new_map); |
| 2326 map()->set_instance_descriptors(heap->empty_descriptor_array()); | 2326 map()->set_instance_descriptors(heap->empty_descriptor_array()); |
| 2327 | 2327 |
| 2328 set_properties(dictionary); | 2328 set_properties(dictionary); |
| 2329 | 2329 |
| 2330 heap->isolate()->counters()->props_to_dictionary()->Increment(); | 2330 heap->isolate()->counters()->props_to_dictionary()->Increment(); |
| 2331 | 2331 |
| 2332 #ifdef DEBUG | 2332 #ifdef DEBUG |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3250 } | 3250 } |
| 3251 | 3251 |
| 3252 | 3252 |
| 3253 Object* Map::CopyNormalized(PropertyNormalizationMode mode, | 3253 Object* Map::CopyNormalized(PropertyNormalizationMode mode, |
| 3254 NormalizedMapSharingMode sharing) { | 3254 NormalizedMapSharingMode sharing) { |
| 3255 int new_instance_size = instance_size(); | 3255 int new_instance_size = instance_size(); |
| 3256 if (mode == CLEAR_INOBJECT_PROPERTIES) { | 3256 if (mode == CLEAR_INOBJECT_PROPERTIES) { |
| 3257 new_instance_size -= inobject_properties() * kPointerSize; | 3257 new_instance_size -= inobject_properties() * kPointerSize; |
| 3258 } | 3258 } |
| 3259 | 3259 |
| 3260 Object* result = HEAP->AllocateMap(instance_type(), new_instance_size); | 3260 Object* result = GetHeap()->AllocateMap(instance_type(), new_instance_size); |
| 3261 if (result->IsFailure()) return result; | 3261 if (result->IsFailure()) return result; |
| 3262 | 3262 |
| 3263 if (mode != CLEAR_INOBJECT_PROPERTIES) { | 3263 if (mode != CLEAR_INOBJECT_PROPERTIES) { |
| 3264 Map::cast(result)->set_inobject_properties(inobject_properties()); | 3264 Map::cast(result)->set_inobject_properties(inobject_properties()); |
| 3265 } | 3265 } |
| 3266 | 3266 |
| 3267 Map::cast(result)->set_prototype(prototype()); | 3267 Map::cast(result)->set_prototype(prototype()); |
| 3268 Map::cast(result)->set_constructor(constructor()); | 3268 Map::cast(result)->set_constructor(constructor()); |
| 3269 | 3269 |
| 3270 Map::cast(result)->set_bit_field(bit_field()); | 3270 Map::cast(result)->set_bit_field(bit_field()); |
| (...skipping 5953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9224 if (break_point_objects()->IsUndefined()) return 0; | 9224 if (break_point_objects()->IsUndefined()) return 0; |
| 9225 // Single beak point. | 9225 // Single beak point. |
| 9226 if (!break_point_objects()->IsFixedArray()) return 1; | 9226 if (!break_point_objects()->IsFixedArray()) return 1; |
| 9227 // Multiple break points. | 9227 // Multiple break points. |
| 9228 return FixedArray::cast(break_point_objects())->length(); | 9228 return FixedArray::cast(break_point_objects())->length(); |
| 9229 } | 9229 } |
| 9230 #endif | 9230 #endif |
| 9231 | 9231 |
| 9232 | 9232 |
| 9233 } } // namespace v8::internal | 9233 } } // namespace v8::internal |
| OLD | NEW |