From de07db147f183dbe559ebb5bc26e505444c1856c Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Mon, 1 Jul 2013 12:57:15 +0000 Subject: [PATCH] Ensure CheckInitialized is present independent of define. This makes sure that the same symbols are present, independent of which defines have been used while building V8. Otherwise only embedders with compatible defines would be able to link against that binary. R=danno@chromium.org BUG=chromium:255779 Review URL: https://codereview.chromium.org/18305004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15417 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 7 ++++--- src/api.cc | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/v8.h b/include/v8.h index cefc87a134..3afb83572a 100644 --- a/include/v8.h +++ b/include/v8.h @@ -5401,11 +5401,12 @@ class Internals { static const int kUndefinedOddballKind = 5; static const int kNullOddballKind = 3; + static void CheckInitializedImpl(v8::Isolate* isolate); + V8_INLINE(static void CheckInitialized(v8::Isolate* isolate)) { #ifdef V8_ENABLE_CHECKS - static void CheckInitialized(v8::Isolate* isolate); -#else - static void CheckInitialized(v8::Isolate* isolate) { } + CheckInitializedImpl(isolate); #endif + } V8_INLINE(static bool HasHeapObjectTag(internal::Object* value)) { return ((reinterpret_cast(value) & kHeapObjectTagMask) == diff --git a/src/api.cc b/src/api.cc index 1bd8c2769a..4a24f4bc88 100644 --- a/src/api.cc +++ b/src/api.cc @@ -2934,14 +2934,12 @@ Local Value::ToInteger() const { } -#ifdef V8_ENABLE_CHECKS -void i::Internals::CheckInitialized(v8::Isolate* external_isolate) { +void i::Internals::CheckInitializedImpl(v8::Isolate* external_isolate) { i::Isolate* isolate = reinterpret_cast(external_isolate); ApiCheck(isolate != NULL && isolate->IsInitialized() && !i::V8::IsDead(), "v8::internal::Internals::CheckInitialized()", "Isolate is not initialized or V8 has died"); } -#endif void External::CheckCast(v8::Value* that) {