Author: [EMAIL PROTECTED]
Date: Wed Nov 26 15:48:02 2008
New Revision: 851

Modified:
    trunk/ChangeLog
    trunk/src/api.cc
    trunk/src/jsregexp.cc
    trunk/src/third_party/jscre/pcre.h
    trunk/src/third_party/jscre/pcre_compile.cpp
    trunk/src/third_party/jscre/pcre_exec.cpp
    trunk/src/third_party/jscre/pcre_internal.h
    trunk/src/third_party/jscre/pcre_tables.cpp
    trunk/src/third_party/jscre/pcre_ucp_searchfuncs.cpp
    trunk/src/third_party/jscre/pcre_xclass.cpp

Log:
Added the v8::jscre namespace around the jscre functions to avoid link  
errors (duplicate symbols) when building Google Chrome.

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

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog     (original)
+++ trunk/ChangeLog     Wed Nov 26 15:48:02 2008
@@ -1,3 +1,9 @@
+2008-11-26: Version 0.4.4.1
+
+        Added the v8::jscre namespace around the jscre functions to avoid
+        link errors (duplicate symbols) when building Google Chrome.
+
+
  2008-11-17: Version 0.4.4

          Reduced code size by using shorter instruction encoding when

Modified: trunk/src/api.cc
==============================================================================
--- trunk/src/api.cc    (original)
+++ trunk/src/api.cc    Wed Nov 26 15:48:02 2008
@@ -2203,7 +2203,7 @@


  const char* v8::V8::GetVersion() {
-  return "0.4.4";
+  return "0.4.4.1";
  }



Modified: trunk/src/jsregexp.cc
==============================================================================
--- trunk/src/jsregexp.cc       (original)
+++ trunk/src/jsregexp.cc       Wed Nov 26 15:48:02 2008
@@ -316,23 +316,23 @@
                                  JSRegExp::Flags flags,
                                  unsigned* number_of_captures,
                                  const char** error_message,
-                                JscreRegExp** code) {
-  JSRegExpIgnoreCaseOption case_option = flags.is_ignore_case()
-    ? JSRegExpIgnoreCase
-    : JSRegExpDoNotIgnoreCase;
-  JSRegExpMultilineOption multiline_option = flags.is_multiline()
-    ? JSRegExpMultiline
-    : JSRegExpSingleLine;
+                                v8::jscre::JscreRegExp** code) {
+  v8::jscre::JSRegExpIgnoreCaseOption case_option = flags.is_ignore_case()
+    ? v8::jscre::JSRegExpIgnoreCase
+    : v8::jscre::JSRegExpDoNotIgnoreCase;
+  v8::jscre::JSRegExpMultilineOption multiline_option =  
flags.is_multiline()
+    ? v8::jscre::JSRegExpMultiline
+    : v8::jscre::JSRegExpSingleLine;
    *error_message = NULL;
    malloc_failure = Failure::Exception();
-  *code = jsRegExpCompile(pattern->GetTwoByteData(),
-                          pattern->length(),
-                          case_option,
-                          multiline_option,
-                          number_of_captures,
-                          error_message,
-                          &JSREMalloc,
-                          &JSREFree);
+  *code = v8::jscre::jsRegExpCompile(pattern->GetTwoByteData(),
+                                     pattern->length(),
+                                     case_option,
+                                     multiline_option,
+                                     number_of_captures,
+                                     error_message,
+                                     &JSREMalloc,
+                                     &JSREFree);
    if (*code == NULL && (malloc_failure->IsRetryAfterGC() ||
                         malloc_failure->IsOutOfMemoryFailure())) {
      return malloc_failure;
@@ -349,7 +349,7 @@
                               JSRegExp::Flags flags,
                               unsigned* number_of_captures,
                               const char** error_message,
-                             JscreRegExp** code) {
+                             v8::jscre::JscreRegExp** code) {
    CALL_HEAP_FUNCTION_VOID(DoCompile(*pattern,
                                      flags,
                                      number_of_captures,
@@ -366,7 +366,7 @@
    unsigned number_of_captures;
    const char* error_message = NULL;

-  JscreRegExp* code = NULL;
+  v8::jscre::JscreRegExp* code = NULL;
    FlattenString(pattern);

    CompileWithRetryAfterGC(two_byte_pattern,
@@ -411,23 +411,24 @@
    {
      AssertNoAllocation a;
      ByteArray* internal = JsreInternal(regexp);
-    const JscreRegExp* js_regexp =
-        reinterpret_cast<JscreRegExp*>(internal->GetDataStartAddress());
+    const v8::jscre::JscreRegExp* js_regexp =
+        reinterpret_cast<v8::jscre::JscreRegExp*>(
+            internal->GetDataStartAddress());

      LOG(RegExpExecEvent(regexp, previous_index, subject));

-    rc = jsRegExpExecute(js_regexp,
-                         two_byte_subject,
-                         subject->length(),
-                         previous_index,
-                         offsets_vector,
-                         offsets_vector_length);
+    rc = v8::jscre::jsRegExpExecute(js_regexp,
+                                    two_byte_subject,
+                                    subject->length(),
+                                    previous_index,
+                                    offsets_vector,
+                                    offsets_vector_length);
    }

    // The KJS JavaScript engine returns null (ie, a failed match) when
    // JSRE's internal match limit is exceeded.  We duplicate that behavior  
here.
-  if (rc == JSRegExpErrorNoMatch
-      || rc == JSRegExpErrorHitLimit) {
+  if (rc == v8::jscre::JSRegExpErrorNoMatch
+      || rc == v8::jscre::JSRegExpErrorHitLimit) {
      return Factory::null_value();
    }


Modified: trunk/src/third_party/jscre/pcre.h
==============================================================================
--- trunk/src/third_party/jscre/pcre.h  (original)
+++ trunk/src/third_party/jscre/pcre.h  Wed Nov 26 15:48:02 2008
@@ -49,6 +49,8 @@
  // we allow DEBUG to be set and undef it manually.
  #undef DEBUG

+namespace v8 { namespace jscre {
+
  typedef uint16_t UChar;

  struct JSRegExp;
@@ -76,5 +78,7 @@
      int* offsetsVector, int offsetsVectorLength);

  void jsRegExpFree(JSRegExp*);
+
+} }  // namespace v8::jscre

  #endif

Modified: trunk/src/third_party/jscre/pcre_compile.cpp
==============================================================================
--- trunk/src/third_party/jscre/pcre_compile.cpp        (original)
+++ trunk/src/third_party/jscre/pcre_compile.cpp        Wed Nov 26 15:48:02 2008
@@ -65,6 +65,8 @@

  #define BRASTACK_SIZE 200

+namespace v8 { namespace jscre {
+
  /* Table for handling escaped characters in the range '0'-'z'. Positive  
returns
  are simple data values; negative values are for special things like \d and  
so
  on. Zero means further processing is needed (for things like \x), or the  
escape
@@ -2671,3 +2673,5 @@
  {
      (*free_function)(reinterpret_cast<void*>(re));
  }
+
+} }  // namespace v8::jscre

Modified: trunk/src/third_party/jscre/pcre_exec.cpp
==============================================================================
--- trunk/src/third_party/jscre/pcre_exec.cpp   (original)
+++ trunk/src/third_party/jscre/pcre_exec.cpp   Wed Nov 26 15:48:02 2008
@@ -61,6 +61,8 @@
  #undef min
  #undef max

+namespace v8 { namespace jscre {
+
  #ifndef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
  typedef int ReturnLocation;
  #else
@@ -2079,3 +2081,5 @@
      DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n"));
      return JSRegExpErrorNoMatch;
  }
+
+} }  // namespace v8::jscre

Modified: trunk/src/third_party/jscre/pcre_internal.h
==============================================================================
--- trunk/src/third_party/jscre/pcre_internal.h (original)
+++ trunk/src/third_party/jscre/pcre_internal.h Wed Nov 26 15:48:02 2008
@@ -103,6 +103,8 @@
  #define DPRINTF(p) /*nothing*/
  #endif

+namespace v8 { namespace jscre {
+
  /* PCRE keeps offsets in its compiled code as 2-byte quantities (always  
stored
  in big-endian order) by default. These are used, for example, to link from  
the
  start of a subpattern to its alternatives and its end. The use of 2 bytes  
per
@@ -416,6 +418,7 @@
  extern int kjs_pcre_ucp_othercase(unsigned);
  extern bool kjs_pcre_xclass(int, const unsigned char*);

+} }  // namespace v8::jscre
  #endif

  #endif

Modified: trunk/src/third_party/jscre/pcre_tables.cpp
==============================================================================
--- trunk/src/third_party/jscre/pcre_tables.cpp (original)
+++ trunk/src/third_party/jscre/pcre_tables.cpp Wed Nov 26 15:48:02 2008
@@ -42,6 +42,8 @@

  #include "pcre_internal.h"

+namespace v8 { namespace jscre {
+
  /*************************************************
  *           Tables for UTF-8 support             *
  *************************************************/
@@ -69,3 +71,5 @@
    3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };

  #include "pcre_chartables.c"
+
+} }  // namespace v8::jscre

Modified: trunk/src/third_party/jscre/pcre_ucp_searchfuncs.cpp
==============================================================================
--- trunk/src/third_party/jscre/pcre_ucp_searchfuncs.cpp        (original)
+++ trunk/src/third_party/jscre/pcre_ucp_searchfuncs.cpp        Wed Nov 26  
15:48:02 2008
@@ -46,6 +46,8 @@
  #include "ucpinternal.h"       /* Internal table details */
  #include "ucptable.cpp"        /* The table itself */

+namespace v8 { namespace jscre {
+
  /*************************************************
  *       Search table and return other case       *
  *************************************************/
@@ -96,3 +98,5 @@
          offset |= f1_caseneg;
      return !offset ? -1 : c + offset;
  }
+
+} }  // namespace v8::jscre

Modified: trunk/src/third_party/jscre/pcre_xclass.cpp
==============================================================================
--- trunk/src/third_party/jscre/pcre_xclass.cpp (original)
+++ trunk/src/third_party/jscre/pcre_xclass.cpp Wed Nov 26 15:48:02 2008
@@ -42,6 +42,8 @@

  #include "pcre_internal.h"

+namespace v8 { namespace jscre {
+
  /*************************************************
  *       Match character against an XCLASS        *
  *************************************************/
@@ -112,3 +114,5 @@

      return negated;   /* char did not match */
  }
+
+} }  // namespace v8::jscre

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to