Revision: 5196
http://jython.svn.sourceforge.net/jython/?rev=5196&view=rev
Author: zyasoft
Date: 2008-08-18 07:17:46 +0000 (Mon, 18 Aug 2008)
Log Message:
-----------
Strings are UTF-8 encoded in the runtime constant pool, meaning that
naively (and that is a reasonable strategy here), we need up to 4
bytes per codepoint. So allocate string constants up to 16000 bytes
and combine as necessary. This resolves one Pygments problem (and the
one we can directly do anything about, the other is isolated
surrogates in unistring.Cs).
Modified Paths:
--------------
branches/asm/src/org/python/compiler/Code.java
Modified: branches/asm/src/org/python/compiler/Code.java
===================================================================
--- branches/asm/src/org/python/compiler/Code.java 2008-08-18 02:39:57 UTC (rev 5195)
+++ branches/asm/src/org/python/compiler/Code.java 2008-08-18 07:17:46 UTC (rev 5196)
@@ -504,7 +504,8 @@
if (cst instanceof String) {
String value = (String) cst;
final int len = value.length();
- final int maxlen = 32767;
+ // 65535 / 4 (max utf-8 expansion for non BMP characters)
+ final int maxlen = 16000;
if (len > maxlen) {
new_("java/lang/StringBuilder");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|