Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 m_wrapperOrTypeInfo = 0; | 69 m_wrapperOrTypeInfo = 0; |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 v8::Persistent<v8::Object> persistent(isolate, wrapper); | 72 v8::Persistent<v8::Object> persistent(isolate, wrapper); |
| 73 configuration.configureWrapper(&persistent, isolate); | 73 configuration.configureWrapper(&persistent, isolate); |
| 74 persistent.MakeWeak(this, &makeWeakCallback); | 74 persistent.MakeWeak(this, &makeWeakCallback); |
| 75 m_wrapperOrTypeInfo = reinterpret_cast<uintptr_t>(persistent.ClearAndLea k()) | 1; | 75 m_wrapperOrTypeInfo = reinterpret_cast<uintptr_t>(persistent.ClearAndLea k()) | 1; |
| 76 ASSERT(containsWrapper()); | 76 ASSERT(containsWrapper()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 v8::Local<v8::Object> newLocalWrapper(v8::Isolate* isolate) const | |
| 80 { | |
| 81 return unsafePersistent().newLocal(isolate); | |
|
abarth-chromium
2013/07/17 23:06:44
This part I'm not sure about. /me needs to learn
| |
| 82 } | |
| 83 | |
| 79 const WrapperTypeInfo* typeInfo() | 84 const WrapperTypeInfo* typeInfo() |
| 80 { | 85 { |
| 81 if (containsTypeInfo()) | 86 if (containsTypeInfo()) |
| 82 return reinterpret_cast<const WrapperTypeInfo*>(m_wrapperOrTypeInfo) ; | 87 return reinterpret_cast<const WrapperTypeInfo*>(m_wrapperOrTypeInfo) ; |
| 83 | 88 |
| 84 if (containsWrapper()) { | 89 if (containsWrapper()) { |
| 85 return toWrapperTypeInfo(unsafePersistent().handle()); | 90 return toWrapperTypeInfo(unsafePersistent().handle()); |
| 86 } | 91 } |
| 87 | 92 |
| 88 return 0; | 93 return 0; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed | 197 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed |
| 193 // inside key->deref(), which causes Node destructions. We should | 198 // inside key->deref(), which causes Node destructions. We should |
| 194 // make Node destructions incremental. | 199 // make Node destructions incremental. |
| 195 info->derefObject(object); | 200 info->derefObject(object); |
| 196 } | 201 } |
| 197 }; | 202 }; |
| 198 | 203 |
| 199 } // namespace WebCore | 204 } // namespace WebCore |
| 200 | 205 |
| 201 #endif // ScriptWrappable_h | 206 #endif // ScriptWrappable_h |
| OLD | NEW |