Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 0efc8f6384816d67e7a3cd1ae6e2468bfa7dafa5..a614b09b42ffcd4828a8436a803ef7158f461fc6 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -5397,7 +5397,7 @@ class EmbedderHeapTracer { |
| */ |
| virtual void TraceWrappableFrom( |
| Isolate* isolate, |
| - const std::vector<std::pair<void*, void*> >& internal_fields) = 0; |
| + const std::vector<std::pair<Value*, Value*> >& internal_fields) = 0; |
|
jochen (gone - plz use gerrit)
2016/04/08 02:19:56
why this change? I don't think we should expose Da
Marcel Hlopko
2016/04/08 08:08:09
The motivation was to be consistent with SetIntern
|
| /** |
| * V8 will call this method at the end of the gc cycle. Allocation is *not* |
| * allowed in the ClearTracingMarks. |
| @@ -7353,7 +7353,8 @@ class Internals { |
| static const int kNodeIsPartiallyDependentShift = 4; |
| static const int kNodeIsActiveShift = 4; |
| - static const int kJSObjectType = 0xb6; |
| + static const int kJSObjectType = 0xb7; |
| + static const int kJSApiObjectType = 0xb6; |
| static const int kFirstNonstringType = 0x80; |
| static const int kOddballType = 0x83; |
| static const int kForeignType = 0x87; |
| @@ -7985,7 +7986,9 @@ Local<Value> Object::GetInternalField(int index) { |
| O* obj = *reinterpret_cast<O**>(this); |
| // Fast path: If the object is a plain JSObject, which is the common case, we |
| // know where to find the internal fields and can return the value directly. |
| - if (I::GetInstanceType(obj) == I::kJSObjectType) { |
| + auto instance_type = I::GetInstanceType(obj); |
| + if (instance_type == I::kJSObjectType || |
| + instance_type == I::kJSApiObjectType) { |
| int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index); |
| O* value = I::ReadField<O*>(obj, offset); |
| O** result = HandleScope::CreateHandle(reinterpret_cast<HO*>(obj), value); |
| @@ -8003,7 +8006,9 @@ void* Object::GetAlignedPointerFromInternalField(int index) { |
| O* obj = *reinterpret_cast<O**>(this); |
| // Fast path: If the object is a plain JSObject, which is the common case, we |
| // know where to find the internal fields and can return the value directly. |
| - if (V8_LIKELY(I::GetInstanceType(obj) == I::kJSObjectType)) { |
| + auto instance_type = I::GetInstanceType(obj); |
| + if (V8_LIKELY(instance_type == I::kJSObjectType || |
| + instance_type == I::kJSApiObjectType)) { |
| int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index); |
| return I::ReadField<void*>(obj, offset); |
| } |