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

Unified Diff: include/v8.h

Issue 1844413002: Use EmbedderHeapTracer instead of object grouping when trace_embedder_heap flag is set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove flag, presence of heap tracer is enough Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api-natives.cc » ('j') | src/heap/heap.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | src/api-natives.cc » ('j') | src/heap/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698