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

Unified Diff: include/v8.h

Issue 5005001: Split globals.h into two parts, where only one depends on V8. (Closed)
Patch Set: Addressed review comments. Created 10 years, 1 month 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/allocation.h » ('j') | no next file with comments »
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 f6c3c8b30199580d907ebf31661d30659458e97c..9baa17db1d5a00191ce884c325978c89de438f93 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3282,8 +3282,8 @@ class V8EXPORT OutputStream { // NOLINT
namespace internal {
-const int kPointerSize = sizeof(void*); // NOLINT
-const int kIntSize = sizeof(int); // NOLINT
+static const int kApiPointerSize = sizeof(void*); // NOLINT
+static const int kApiIntSize = sizeof(int); // NOLINT
// Tag information for HeapObject.
const int kHeapObjectTag = 1;
@@ -3319,19 +3319,19 @@ template <> struct SmiConstants<8> {
}
};
-const int kSmiShiftSize = SmiConstants<kPointerSize>::kSmiShiftSize;
-const int kSmiValueSize = SmiConstants<kPointerSize>::kSmiValueSize;
+const int kSmiShiftSize = SmiConstants<kApiPointerSize>::kSmiShiftSize;
+const int kSmiValueSize = SmiConstants<kApiPointerSize>::kSmiValueSize;
template <size_t ptr_size> struct InternalConstants;
// Internal constants for 32-bit systems.
template <> struct InternalConstants<4> {
- static const int kStringResourceOffset = 3 * kPointerSize;
+ static const int kStringResourceOffset = 3 * kApiPointerSize;
};
// Internal constants for 64-bit systems.
template <> struct InternalConstants<8> {
- static const int kStringResourceOffset = 3 * kPointerSize;
+ static const int kStringResourceOffset = 3 * kApiPointerSize;
};
/**
@@ -3345,12 +3345,12 @@ class Internals {
// These values match non-compiler-dependent values defined within
// the implementation of v8.
static const int kHeapObjectMapOffset = 0;
- static const int kMapInstanceTypeOffset = kPointerSize + kIntSize;
+ static const int kMapInstanceTypeOffset = kApiPointerSize + kApiIntSize;
static const int kStringResourceOffset =
- InternalConstants<kPointerSize>::kStringResourceOffset;
+ InternalConstants<kApiPointerSize>::kStringResourceOffset;
- static const int kProxyProxyOffset = kPointerSize;
- static const int kJSObjectHeaderSize = 3 * kPointerSize;
+ static const int kProxyProxyOffset = kApiPointerSize;
+ static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFullStringRepresentationMask = 0x07;
static const int kExternalTwoByteRepresentationTag = 0x02;
@@ -3368,7 +3368,7 @@ class Internals {
}
static inline int SmiValue(internal::Object* value) {
- return SmiConstants<kPointerSize>::SmiToInt(value);
+ return SmiConstants<kApiPointerSize>::SmiToInt(value);
}
static inline int GetInstanceType(internal::Object* obj) {
@@ -3559,7 +3559,7 @@ Local<Value> Object::UncheckedGetInternalField(int index) {
// 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.
- int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
+ int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
O* value = I::ReadField<O*>(obj, offset);
O** result = HandleScope::CreateHandle(value);
return Local<Value>(reinterpret_cast<Value*>(result));
@@ -3595,7 +3595,7 @@ void* Object::GetPointerFromInternalField(int index) {
// 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.
- int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
+ int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
O* value = I::ReadField<O*>(obj, offset);
return I::GetExternalPointer(value);
}
« no previous file with comments | « no previous file | src/allocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698