Index: test/mjsunit/string-externalize.js |
diff --git a/test/mjsunit/string-externalize.js b/test/mjsunit/string-externalize.js |
index 39cc124914cdece4cbc9b30f0bed66a78cc46e82..dd861e8816366e4f4377aced1ad716c6c5ff5d53 100644 |
--- a/test/mjsunit/string-externalize.js |
+++ b/test/mjsunit/string-externalize.js |
@@ -25,10 +25,16 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --expose-externalize-string --expose-gc |
+// Flags: --expose-externalize-string --expose-gc --allow-natives-syntax |
var size = 1024; |
+function dont_inline() { return "A"; } |
+%NeverOptimizeFunction(dont_inline); |
+ |
+function dont_inline2() { return "\u1234"; } |
+%NeverOptimizeFunction(dont_inline2); |
+ |
function test() { |
var str = ""; |
@@ -39,12 +45,12 @@ function test() { |
assertTrue(isOneByteString(str)); |
var twoByteExternalWithOneByteData = |
- "AA" + (function() { return "A"; })(); |
+ "AA" + dont_inline(); |
externalizeString(twoByteExternalWithOneByteData, true /* force two-byte */); |
assertFalse(isOneByteString(twoByteExternalWithOneByteData)); |
var realTwoByteExternalString = |
- "\u1234\u1234\u1234\u1234" + (function() { return "\u1234"; })(); |
+ "\u1234\u1234\u1234\u1234" + dont_inline2(); |
externalizeString(realTwoByteExternalString); |
assertFalse(isOneByteString(realTwoByteExternalString)); |