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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h

Issue 2640963007: [wrapper-tracing] Remove flag and object grouping entry points (Closed)
Patch Set: Fix merge artifact Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const WrapperTypeInfo* wrapperTypeInfo, 87 const WrapperTypeInfo* wrapperTypeInfo,
88 ScriptWrappable* scriptWrappable) { 88 ScriptWrappable* scriptWrappable) {
89 ASSERT(wrapper->InternalFieldCount() >= 2); 89 ASSERT(wrapper->InternalFieldCount() >= 2);
90 ASSERT(scriptWrappable); 90 ASSERT(scriptWrappable);
91 ASSERT(wrapperTypeInfo); 91 ASSERT(wrapperTypeInfo);
92 int indices[] = {v8DOMWrapperObjectIndex, v8DOMWrapperTypeIndex}; 92 int indices[] = {v8DOMWrapperObjectIndex, v8DOMWrapperTypeIndex};
93 void* values[] = {scriptWrappable, 93 void* values[] = {scriptWrappable,
94 const_cast<WrapperTypeInfo*>(wrapperTypeInfo)}; 94 const_cast<WrapperTypeInfo*>(wrapperTypeInfo)};
95 wrapper->SetAlignedPointerInInternalFields(WTF_ARRAY_LENGTH(indices), indices, 95 wrapper->SetAlignedPointerInInternalFields(WTF_ARRAY_LENGTH(indices), indices,
96 values); 96 values);
97 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { 97 auto perIsolateData = V8PerIsolateData::from(isolate);
98 auto perIsolateData = V8PerIsolateData::from(isolate); 98 // We notify ScriptWrappableVisitor about the new wrapper association,
99 // We notify ScriptWrappableVisitor about the new wrapper association, 99 // so the visitor can make sure to trace the association (in case it is
100 // so the visitor can make sure to trace the association (in case it is 100 // currently tracing). Because of some optimizations, V8 will not
101 // currently tracing). Because of some optimizations, V8 will not 101 // necessarily detect wrappers created during its incremental marking.
102 // necessarily detect wrappers created during its incremental marking. 102 perIsolateData->scriptWrappableVisitor()->RegisterV8Reference(std::make_pair(
103 perIsolateData->scriptWrappableVisitor()->RegisterV8Reference( 103 const_cast<WrapperTypeInfo*>(wrapperTypeInfo), scriptWrappable));
104 std::make_pair(const_cast<WrapperTypeInfo*>(wrapperTypeInfo),
105 scriptWrappable));
106 }
107 } 104 }
108 105
109 inline void V8DOMWrapper::clearNativeInfo(v8::Isolate* isolate, 106 inline void V8DOMWrapper::clearNativeInfo(v8::Isolate* isolate,
110 v8::Local<v8::Object> wrapper) { 107 v8::Local<v8::Object> wrapper) {
111 int indices[] = {v8DOMWrapperObjectIndex, v8DOMWrapperTypeIndex}; 108 int indices[] = {v8DOMWrapperObjectIndex, v8DOMWrapperTypeIndex};
112 void* values[] = {nullptr, nullptr}; 109 void* values[] = {nullptr, nullptr};
113 wrapper->SetAlignedPointerInInternalFields(WTF_ARRAY_LENGTH(indices), indices, 110 wrapper->SetAlignedPointerInInternalFields(WTF_ARRAY_LENGTH(indices), indices,
114 values); 111 values);
115 } 112 }
116 113
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 196
200 bool m_didEnterContext; 197 bool m_didEnterContext;
201 v8::Local<v8::Context> m_context; 198 v8::Local<v8::Context> m_context;
202 v8::TryCatch m_tryCatch; 199 v8::TryCatch m_tryCatch;
203 bool m_convertExceptions; 200 bool m_convertExceptions;
204 }; 201 };
205 202
206 } // namespace blink 203 } // namespace blink
207 204
208 #endif // V8DOMWrapper_h 205 #endif // V8DOMWrapper_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698