Index: src/extensions/i18n/i18n-extension.cc |
diff --git a/test/mjsunit/compiler/regress-shared-deopt.js b/src/extensions/i18n/i18n-extension.cc |
similarity index 73% |
copy from test/mjsunit/compiler/regress-shared-deopt.js |
copy to src/extensions/i18n/i18n-extension.cc |
index 669e0e2f1de385214c3033b01924cc55d15e55e7..b5f28631e1f9b966ccb1ecc59f68b93498518dd1 100644 |
--- a/test/mjsunit/compiler/regress-shared-deopt.js |
+++ b/src/extensions/i18n/i18n-extension.cc |
@@ -24,42 +24,28 @@ |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+// limitations under the License. |
-// Flags: --allow-natives-syntax |
+#include "i18n-extension.h" |
-var soft = false; |
+#include "natives.h" |
-// disable optimization of this global |
-soft = true; |
-soft = false; |
-soft = true; |
-soft = false; |
+using v8::internal::I18NNatives; |
-function test() { |
- var f4 = makeF(4); |
- var f5 = makeF(5); |
+namespace v8_i18n { |
- function makeF(i) { |
- return function f(x) { |
- if (x == 0) return i; |
- if (i == 4) if (soft) print("wahoo" + i); |
- return f4(x - 1); |
- } |
- } |
+Extension::Extension() |
+ : v8::Extension("v8/i18n", |
+ reinterpret_cast<const char*>( |
+ I18NNatives::GetScriptsSource().start()), |
+ 0, |
+ 0, |
+ I18NNatives::GetScriptsSource().length()) {} |
- f4(9); |
- f4(11); |
- %OptimizeFunctionOnNextCall(f4); |
- f4(12); |
- f5(9); |
- f5(11); |
- %OptimizeFunctionOnNextCall(f5); |
- f5(12); |
- |
- soft = true; |
- f4(1); |
- f5(9); |
+void Extension::Register() { |
+ static Extension i18n_extension; |
+ static v8::DeclareExtension extension_declaration(&i18n_extension); |
} |
-test(); |
+} // namespace v8_i18n |