 Chromium Code Reviews
 Chromium Code Reviews Issue 8595008:
  Remove more superfluous write barriers.  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
    
  
    Issue 8595008:
  Remove more superfluous write barriers.  (Closed) 
  Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/| OLD | NEW | 
|---|---|
| 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 5437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5448 } | 5448 } | 
| 5449 // Do not use DescriptorArray::cast on incomplete object. | 5449 // Do not use DescriptorArray::cast on incomplete object. | 
| 5450 FixedArray* result = FixedArray::cast(array); | 5450 FixedArray* result = FixedArray::cast(array); | 
| 5451 | 5451 | 
| 5452 // Allocate the content array and set it in the descriptor array. | 5452 // Allocate the content array and set it in the descriptor array. | 
| 5453 { MaybeObject* maybe_array = | 5453 { MaybeObject* maybe_array = | 
| 5454 heap->AllocateFixedArray(number_of_descriptors << 1); | 5454 heap->AllocateFixedArray(number_of_descriptors << 1); | 
| 5455 if (!maybe_array->ToObject(&array)) return maybe_array; | 5455 if (!maybe_array->ToObject(&array)) return maybe_array; | 
| 5456 } | 5456 } | 
| 5457 result->set(kBitField3StorageIndex, Smi::FromInt(0)); | 5457 result->set(kBitField3StorageIndex, Smi::FromInt(0)); | 
| 5458 result->set(kContentArrayIndex, array); | 5458 result->set(kContentArrayIndex, array, SKIP_WRITE_BARRIER); | 
| 
Lasse Reichstein
2011/11/18 12:26:28
Do we know that result is in NewSpace? What if it'
 
Erik Corry
2011/11/18 13:42:24
I reverted this part of the change.
 | |
| 5459 result->set(kEnumerationIndexIndex, | 5459 result->set(kEnumerationIndexIndex, | 
| 5460 Smi::FromInt(PropertyDetails::kInitialIndex)); | 5460 Smi::FromInt(PropertyDetails::kInitialIndex)); | 
| 5461 return result; | 5461 return result; | 
| 5462 } | 5462 } | 
| 5463 | 5463 | 
| 5464 | 5464 | 
| 5465 void DescriptorArray::SetEnumCache(FixedArray* bridge_storage, | 5465 void DescriptorArray::SetEnumCache(FixedArray* bridge_storage, | 
| 5466 FixedArray* new_cache) { | 5466 FixedArray* new_cache) { | 
| 5467 ASSERT(bridge_storage->length() >= kEnumCacheBridgeLength); | 5467 ASSERT(bridge_storage->length() >= kEnumCacheBridgeLength); | 
| 5468 if (HasEnumCache()) { | 5468 if (HasEnumCache()) { | 
| (...skipping 4510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9979 return NumberOfLocalProperties(static_cast<PropertyAttributes>(DONT_ENUM)); | 9979 return NumberOfLocalProperties(static_cast<PropertyAttributes>(DONT_ENUM)); | 
| 9980 } | 9980 } | 
| 9981 | 9981 | 
| 9982 | 9982 | 
| 9983 void FixedArray::SwapPairs(FixedArray* numbers, int i, int j) { | 9983 void FixedArray::SwapPairs(FixedArray* numbers, int i, int j) { | 
| 9984 Object* temp = get(i); | 9984 Object* temp = get(i); | 
| 9985 set(i, get(j)); | 9985 set(i, get(j)); | 
| 9986 set(j, temp); | 9986 set(j, temp); | 
| 9987 if (this != numbers) { | 9987 if (this != numbers) { | 
| 9988 temp = numbers->get(i); | 9988 temp = numbers->get(i); | 
| 9989 numbers->set(i, numbers->get(j)); | 9989 numbers->set(i, Smi::cast(numbers->get(j))); | 
| 9990 numbers->set(j, temp); | 9990 numbers->set(j, Smi::cast(temp)); | 
| 9991 } | 9991 } | 
| 9992 } | 9992 } | 
| 9993 | 9993 | 
| 9994 | 9994 | 
| 9995 static void InsertionSortPairs(FixedArray* content, | 9995 static void InsertionSortPairs(FixedArray* content, | 
| 9996 FixedArray* numbers, | 9996 FixedArray* numbers, | 
| 9997 int len) { | 9997 int len) { | 
| 9998 for (int i = 1; i < len; i++) { | 9998 for (int i = 1; i < len; i++) { | 
| 9999 int j = i; | 9999 int j = i; | 
| 10000 while (j > 0 && | 10000 while (j > 0 && | 
| (...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12539 if (break_point_objects()->IsUndefined()) return 0; | 12539 if (break_point_objects()->IsUndefined()) return 0; | 
| 12540 // Single break point. | 12540 // Single break point. | 
| 12541 if (!break_point_objects()->IsFixedArray()) return 1; | 12541 if (!break_point_objects()->IsFixedArray()) return 1; | 
| 12542 // Multiple break points. | 12542 // Multiple break points. | 
| 12543 return FixedArray::cast(break_point_objects())->length(); | 12543 return FixedArray::cast(break_point_objects())->length(); | 
| 12544 } | 12544 } | 
| 12545 #endif // ENABLE_DEBUGGER_SUPPORT | 12545 #endif // ENABLE_DEBUGGER_SUPPORT | 
| 12546 | 12546 | 
| 12547 | 12547 | 
| 12548 } } // namespace v8::internal | 12548 } } // namespace v8::internal | 
| OLD | NEW |