<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - NewRegexp should not prevent inlining"
href="https://bugs.webkit.org/show_bug.cgi?id=154808#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - NewRegexp should not prevent inlining"
href="https://bugs.webkit.org/show_bug.cgi?id=154808">bug 154808</a>
from <span class="vcard"><a class="email" href="mailto:ticaiolima@gmail.com" title="Caio Lima <ticaiolima@gmail.com>"> <span class="fn">Caio Lima</span></a>
</span></b>
<pre>Created <span class=""><a href="attachment.cgi?id=286537&action=diff" name="attach_286537" title="Proposed Patch">attachment 286537</a> <a href="attachment.cgi?id=286537&action=edit" title="Proposed Patch">[details]</a></span>
Proposed Patch
This version that I propose. I am investigating if there is a possibility of callee CodeBock be GCed because if it happens, RegExp are potentially candidates to be collected and Mache Code Block are going to point o invalid RegExp.
The current test that I am using right now is:
```
function toInline(a) {
var re = /cc+/;
print("test ccc: "+re.test("ccc"));
print("test abc: "+re.test("abc"));
return 0;
}
function f(a) {
toInline(a)
var re = /(ab)+/;
print("test ba: " + re.test("ba"));
return 0;
}
noInline(f);
for (let i = 0; i < 100000; i++) {
f(2);
}
gc();
print("GC Passed");
let a = Array(10000000);
for (let i = 0; i < 10000000; i++) {
a[i] = {value: i};
}
print("Objects Allocated");
for (let i = 0; i < 100; i++) {
f(4);
}
```
However it is possible write more test codes with correct asserts.
This testing is working properly but I think it is worth more investigation.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>