Commit 455cfe59 authored by lrn@chromium.org's avatar lrn@chromium.org

Make presubmit lint the "include" dir.

Make include dir content pass lint.

Review URL: http://codereview.chromium.org/4421002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5767 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 62302a53
...@@ -142,7 +142,7 @@ class EXPORT Debug { ...@@ -142,7 +142,7 @@ class EXPORT Debug {
virtual ~Message() {} virtual ~Message() {}
}; };
/** /**
* An event details object passed to the debug event listener. * An event details object passed to the debug event listener.
...@@ -300,7 +300,7 @@ class EXPORT Debug { ...@@ -300,7 +300,7 @@ class EXPORT Debug {
* get access to information otherwise not available during normal JavaScript * get access to information otherwise not available during normal JavaScript
* execution e.g. details on stack frames. Receiver of the function call will * execution e.g. details on stack frames. Receiver of the function call will
* be the debugger context global object, however this is a subject to change. * be the debugger context global object, however this is a subject to change.
* The following example show a JavaScript function which when passed to * The following example show a JavaScript function which when passed to
* v8::Debug::Call will return the current line of JavaScript execution. * v8::Debug::Call will return the current line of JavaScript execution.
* *
* \code * \code
......
...@@ -111,7 +111,6 @@ class Arguments; ...@@ -111,7 +111,6 @@ class Arguments;
class Object; class Object;
class Heap; class Heap;
class Top; class Top;
} }
...@@ -1039,7 +1038,7 @@ class String : public Primitive { ...@@ -1039,7 +1038,7 @@ class String : public Primitive {
*/ */
V8EXPORT bool IsExternalAscii() const; V8EXPORT bool IsExternalAscii() const;
class V8EXPORT ExternalStringResourceBase { class V8EXPORT ExternalStringResourceBase { // NOLINT
public: public:
virtual ~ExternalStringResourceBase() {} virtual ~ExternalStringResourceBase() {}
...@@ -3244,8 +3243,8 @@ class V8EXPORT Locker { ...@@ -3244,8 +3243,8 @@ class V8EXPORT Locker {
/** /**
* An interface for exporting data from V8, using "push" model. * An interface for exporting data from V8, using "push" model.
*/ */
class V8EXPORT OutputStream { class V8EXPORT OutputStream { // NOLINT
public: public:
enum OutputEncoding { enum OutputEncoding {
kAscii = 0 // 7-bit ASCII. kAscii = 0 // 7-bit ASCII.
}; };
...@@ -3275,6 +3274,8 @@ public: ...@@ -3275,6 +3274,8 @@ public:
namespace internal { namespace internal {
const int kPointerSize = sizeof(void*); // NOLINT
const int kIntSize = sizeof(int); // NOLINT
// Tag information for HeapObject. // Tag information for HeapObject.
const int kHeapObjectTag = 1; const int kHeapObjectTag = 1;
...@@ -3310,19 +3311,19 @@ template <> struct SmiConstants<8> { ...@@ -3310,19 +3311,19 @@ template <> struct SmiConstants<8> {
} }
}; };
const int kSmiShiftSize = SmiConstants<sizeof(void*)>::kSmiShiftSize; const int kSmiShiftSize = SmiConstants<kPointerSize>::kSmiShiftSize;
const int kSmiValueSize = SmiConstants<sizeof(void*)>::kSmiValueSize; const int kSmiValueSize = SmiConstants<kPointerSize>::kSmiValueSize;
template <size_t ptr_size> struct InternalConstants; template <size_t ptr_size> struct InternalConstants;
// Internal constants for 32-bit systems. // Internal constants for 32-bit systems.
template <> struct InternalConstants<4> { template <> struct InternalConstants<4> {
static const int kStringResourceOffset = 3 * sizeof(void*); static const int kStringResourceOffset = 3 * kPointerSize;
}; };
// Internal constants for 64-bit systems. // Internal constants for 64-bit systems.
template <> struct InternalConstants<8> { template <> struct InternalConstants<8> {
static const int kStringResourceOffset = 3 * sizeof(void*); static const int kStringResourceOffset = 3 * kPointerSize;
}; };
/** /**
...@@ -3336,12 +3337,12 @@ class Internals { ...@@ -3336,12 +3337,12 @@ class Internals {
// These values match non-compiler-dependent values defined within // These values match non-compiler-dependent values defined within
// the implementation of v8. // the implementation of v8.
static const int kHeapObjectMapOffset = 0; static const int kHeapObjectMapOffset = 0;
static const int kMapInstanceTypeOffset = sizeof(void*) + sizeof(int); static const int kMapInstanceTypeOffset = kPointerSize + kIntSize;
static const int kStringResourceOffset = static const int kStringResourceOffset =
InternalConstants<sizeof(void*)>::kStringResourceOffset; InternalConstants<kPointerSize>::kStringResourceOffset;
static const int kProxyProxyOffset = sizeof(void*); static const int kProxyProxyOffset = kPointerSize;
static const int kJSObjectHeaderSize = 3 * sizeof(void*); static const int kJSObjectHeaderSize = 3 * kPointerSize;
static const int kFullStringRepresentationMask = 0x07; static const int kFullStringRepresentationMask = 0x07;
static const int kExternalTwoByteRepresentationTag = 0x02; static const int kExternalTwoByteRepresentationTag = 0x02;
...@@ -3359,7 +3360,7 @@ class Internals { ...@@ -3359,7 +3360,7 @@ class Internals {
} }
static inline int SmiValue(internal::Object* value) { static inline int SmiValue(internal::Object* value) {
return SmiConstants<sizeof(void*)>::SmiToInt(value); return SmiConstants<kPointerSize>::SmiToInt(value);
} }
static inline int GetInstanceType(internal::Object* obj) { static inline int GetInstanceType(internal::Object* obj) {
...@@ -3388,10 +3389,9 @@ class Internals { ...@@ -3388,10 +3389,9 @@ class Internals {
uint8_t* addr = reinterpret_cast<uint8_t*>(ptr) + offset - kHeapObjectTag; uint8_t* addr = reinterpret_cast<uint8_t*>(ptr) + offset - kHeapObjectTag;
return *reinterpret_cast<T*>(addr); return *reinterpret_cast<T*>(addr);
} }
}; };
} } // namespace internal
template <class T> template <class T>
...@@ -3551,7 +3551,7 @@ Local<Value> Object::UncheckedGetInternalField(int index) { ...@@ -3551,7 +3551,7 @@ Local<Value> Object::UncheckedGetInternalField(int index) {
// If the object is a plain JSObject, which is the common case, // If the object is a plain JSObject, which is the common case,
// we know where to find the internal fields and can return the // we know where to find the internal fields and can return the
// value directly. // value directly.
int offset = I::kJSObjectHeaderSize + (sizeof(void*) * index); int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
O* value = I::ReadField<O*>(obj, offset); O* value = I::ReadField<O*>(obj, offset);
O** result = HandleScope::CreateHandle(value); O** result = HandleScope::CreateHandle(value);
return Local<Value>(reinterpret_cast<Value*>(result)); return Local<Value>(reinterpret_cast<Value*>(result));
...@@ -3587,7 +3587,7 @@ void* Object::GetPointerFromInternalField(int index) { ...@@ -3587,7 +3587,7 @@ void* Object::GetPointerFromInternalField(int index) {
// If the object is a plain JSObject, which is the common case, // If the object is a plain JSObject, which is the common case,
// we know where to find the internal fields and can return the // we know where to find the internal fields and can return the
// value directly. // value directly.
int offset = I::kJSObjectHeaderSize + (sizeof(void*) * index); int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
O* value = I::ReadField<O*>(obj, offset); O* value = I::ReadField<O*>(obj, offset);
return I::GetExternalPointer(value); return I::GetExternalPointer(value);
} }
......
...@@ -193,10 +193,9 @@ const uint32_t kMaxUInt32 = 0xFFFFFFFFu; ...@@ -193,10 +193,9 @@ const uint32_t kMaxUInt32 = 0xFFFFFFFFu;
const int kCharSize = sizeof(char); // NOLINT const int kCharSize = sizeof(char); // NOLINT
const int kShortSize = sizeof(short); // NOLINT const int kShortSize = sizeof(short); // NOLINT
const int kIntSize = sizeof(int); // NOLINT
const int kDoubleSize = sizeof(double); // NOLINT const int kDoubleSize = sizeof(double); // NOLINT
const int kPointerSize = sizeof(void*); // NOLINT
const int kIntptrSize = sizeof(intptr_t); // NOLINT const int kIntptrSize = sizeof(intptr_t); // NOLINT
// kIntSize and kPointerSize are defined in include/v8.h.
#if V8_HOST_ARCH_64_BIT #if V8_HOST_ARCH_64_BIT
const int kPointerSizeLog2 = 3; const int kPointerSizeLog2 = 3;
......
...@@ -195,7 +195,7 @@ class CppLintProcessor(SourceFileProcessor): ...@@ -195,7 +195,7 @@ class CppLintProcessor(SourceFileProcessor):
or (name in CppLintProcessor.IGNORE_LINT)) or (name in CppLintProcessor.IGNORE_LINT))
def GetPathsToSearch(self): def GetPathsToSearch(self):
return ['src', 'public', 'samples', join('test', 'cctest')] return ['src', 'include', 'samples', join('test', 'cctest')]
def ProcessFiles(self, files, path): def ProcessFiles(self, files, path):
good_files_cache = FileContentsCache('.cpplint-cache') good_files_cache = FileContentsCache('.cpplint-cache')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment