OLD | NEW |
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 4573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4584 FLAG_weak_embedded_maps_in_optimized_code; | 4584 FLAG_weak_embedded_maps_in_optimized_code; |
4585 } | 4585 } |
4586 if (object->IsJSObject() || | 4586 if (object->IsJSObject() || |
4587 (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { | 4587 (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { |
4588 return FLAG_weak_embedded_objects_in_optimized_code; | 4588 return FLAG_weak_embedded_objects_in_optimized_code; |
4589 } | 4589 } |
4590 return false; | 4590 return false; |
4591 } | 4591 } |
4592 | 4592 |
4593 | 4593 |
| 4594 class Code::FindAndReplacePattern { |
| 4595 public: |
| 4596 FindAndReplacePattern() : count_(0) { } |
| 4597 void Add(Handle<Map> map_to_find, Handle<Object> obj_to_replace) { |
| 4598 ASSERT(count_ < kMaxCount); |
| 4599 find_[count_] = map_to_find; |
| 4600 replace_[count_] = obj_to_replace; |
| 4601 ++count_; |
| 4602 } |
| 4603 private: |
| 4604 static const int kMaxCount = 4; |
| 4605 int count_; |
| 4606 Handle<Map> find_[kMaxCount]; |
| 4607 Handle<Object> replace_[kMaxCount]; |
| 4608 friend class Code; |
| 4609 }; |
| 4610 |
| 4611 |
4594 Object* Map::prototype() { | 4612 Object* Map::prototype() { |
4595 return READ_FIELD(this, kPrototypeOffset); | 4613 return READ_FIELD(this, kPrototypeOffset); |
4596 } | 4614 } |
4597 | 4615 |
4598 | 4616 |
4599 void Map::set_prototype(Object* value, WriteBarrierMode mode) { | 4617 void Map::set_prototype(Object* value, WriteBarrierMode mode) { |
4600 ASSERT(value->IsNull() || value->IsJSReceiver()); | 4618 ASSERT(value->IsNull() || value->IsJSReceiver()); |
4601 WRITE_FIELD(this, kPrototypeOffset, value); | 4619 WRITE_FIELD(this, kPrototypeOffset, value); |
4602 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, value, mode); | 4620 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kPrototypeOffset, value, mode); |
4603 } | 4621 } |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6758 #undef READ_UINT32_FIELD | 6776 #undef READ_UINT32_FIELD |
6759 #undef WRITE_UINT32_FIELD | 6777 #undef WRITE_UINT32_FIELD |
6760 #undef READ_SHORT_FIELD | 6778 #undef READ_SHORT_FIELD |
6761 #undef WRITE_SHORT_FIELD | 6779 #undef WRITE_SHORT_FIELD |
6762 #undef READ_BYTE_FIELD | 6780 #undef READ_BYTE_FIELD |
6763 #undef WRITE_BYTE_FIELD | 6781 #undef WRITE_BYTE_FIELD |
6764 | 6782 |
6765 } } // namespace v8::internal | 6783 } } // namespace v8::internal |
6766 | 6784 |
6767 #endif // V8_OBJECTS_INL_H_ | 6785 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |