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 5069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5080 | 5080 |
5081 | 5081 |
5082 class VisitorAdapter : public i::ObjectVisitor { | 5082 class VisitorAdapter : public i::ObjectVisitor { |
5083 public: | 5083 public: |
5084 explicit VisitorAdapter(PersistentHandleVisitor* visitor) | 5084 explicit VisitorAdapter(PersistentHandleVisitor* visitor) |
5085 : visitor_(visitor) {} | 5085 : visitor_(visitor) {} |
5086 virtual void VisitPointers(i::Object** start, i::Object** end) { | 5086 virtual void VisitPointers(i::Object** start, i::Object** end) { |
5087 UNREACHABLE(); | 5087 UNREACHABLE(); |
5088 } | 5088 } |
5089 virtual void VisitEmbedderReference(i::Object** p, uint16_t class_id) { | 5089 virtual void VisitEmbedderReference(i::Object** p, uint16_t class_id) { |
5090 #ifdef V8_USE_OLD_STYLE_PERSISTENT_HANDLE_VISITORS | |
5091 visitor_->VisitPersistentHandle(ToApi<Value>(i::Handle<i::Object>(p)), | |
5092 class_id); | |
5093 #else | |
5094 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); | 5090 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); |
5095 visitor_->VisitPersistentHandle( | 5091 visitor_->VisitPersistentHandle( |
5096 reinterpret_cast<Persistent<Value>*>(&value), class_id); | 5092 reinterpret_cast<Persistent<Value>*>(&value), class_id); |
5097 #endif | |
5098 } | 5093 } |
5099 private: | 5094 private: |
5100 PersistentHandleVisitor* visitor_; | 5095 PersistentHandleVisitor* visitor_; |
5101 }; | 5096 }; |
5102 | 5097 |
5103 | 5098 |
5104 void v8::V8::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) { | 5099 void v8::V8::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) { |
5105 i::Isolate* isolate = i::Isolate::Current(); | 5100 i::Isolate* isolate = i::Isolate::Current(); |
5106 IsDeadCheck(isolate, "v8::V8::VisitHandlesWithClassId"); | 5101 IsDeadCheck(isolate, "v8::V8::VisitHandlesWithClassId"); |
5107 | 5102 |
(...skipping 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7854 | 7849 |
7855 v->VisitPointers(blocks_.first(), first_block_limit_); | 7850 v->VisitPointers(blocks_.first(), first_block_limit_); |
7856 | 7851 |
7857 for (int i = 1; i < blocks_.length(); i++) { | 7852 for (int i = 1; i < blocks_.length(); i++) { |
7858 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7853 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7859 } | 7854 } |
7860 } | 7855 } |
7861 | 7856 |
7862 | 7857 |
7863 } } // namespace v8::internal | 7858 } } // namespace v8::internal |
OLD | NEW |