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

Side by Side Diff: src/objects-inl.h

Issue 172233003: Clean up weak objects in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4544 matching lines...) Expand 10 before | Expand all | Expand 10 after
4555 Code* result = reinterpret_cast<Code*>(code); 4555 Code* result = reinterpret_cast<Code*>(code);
4556 return result; 4556 return result;
4557 } 4557 }
4558 4558
4559 4559
4560 Object* Code::GetObjectFromEntryAddress(Address location_of_address) { 4560 Object* Code::GetObjectFromEntryAddress(Address location_of_address) {
4561 return HeapObject:: 4561 return HeapObject::
4562 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize); 4562 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize);
4563 } 4563 }
4564 4564
4565 bool Code::IsWeakObjectInOptimizedCode(Object* object) {
4566 ASSERT(is_optimized_code());
4567 if (object->IsMap()) {
4568 return Map::cast(object)->CanTransition() &&
4569 FLAG_collect_maps &&
4570 FLAG_weak_embedded_maps_in_optimized_code;
4571 }
4572 if (object->IsJSObject() ||
4573 (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) {
4574 return FLAG_weak_embedded_objects_in_optimized_code;
4575 }
4576 return false;
4577 }
4565 4578
4566 Object* Map::prototype() { 4579 Object* Map::prototype() {
4567 return READ_FIELD(this, kPrototypeOffset); 4580 return READ_FIELD(this, kPrototypeOffset);
4568 } 4581 }
4569 4582
4570 4583
4571 void Map::set_prototype(Object* value, WriteBarrierMode mode) { 4584 void Map::set_prototype(Object* value, WriteBarrierMode mode) {
4572 ASSERT(value->IsNull() || value->IsJSReceiver()); 4585 ASSERT(value->IsNull() || value->IsJSReceiver());
4573 WRITE_FIELD(this, kPrototypeOffset, value); 4586 WRITE_FIELD(this, kPrototypeOffset, value);
4574 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, value, mode); 4587 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, value, mode);
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after
6750 #undef READ_UINT32_FIELD 6763 #undef READ_UINT32_FIELD
6751 #undef WRITE_UINT32_FIELD 6764 #undef WRITE_UINT32_FIELD
6752 #undef READ_SHORT_FIELD 6765 #undef READ_SHORT_FIELD
6753 #undef WRITE_SHORT_FIELD 6766 #undef WRITE_SHORT_FIELD
6754 #undef READ_BYTE_FIELD 6767 #undef READ_BYTE_FIELD
6755 #undef WRITE_BYTE_FIELD 6768 #undef WRITE_BYTE_FIELD
6756 6769
6757 } } // namespace v8::internal 6770 } } // namespace v8::internal
6758 6771
6759 #endif // V8_OBJECTS_INL_H_ 6772 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.h ('K') | « src/objects-debug.cc ('k') | src/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698