Revision: 23107
Author:   [email protected]
Date:     Wed Aug 13 14:09:50 2014 UTC
Log:      Move %IsOptimized runtime helper into test case.

[email protected]
TEST=cctest/test-run-deopt

Review URL: https://codereview.chromium.org/468153002
http://code.google.com/p/v8/source/detail?r=23107

Deleted:
 /branches/bleeding_edge/test/mjsunit/runtime-gen/isoptimized.js
Modified:
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/src/runtime.h
 /branches/bleeding_edge/test/cctest/compiler/test-run-deopt.cc
 /branches/bleeding_edge/tools/generate-runtime-tests.py

=======================================
--- /branches/bleeding_edge/test/mjsunit/runtime-gen/isoptimized.js Fri Aug 8 09:58:19 2014 UTC
+++ /dev/null
@@ -1,4 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
-// Flags: --allow-natives-syntax --harmony --harmony-proxies
-%IsOptimized();
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Wed Aug 13 11:14:35 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Wed Aug 13 14:09:50 2014 UTC
@@ -11207,15 +11207,6 @@
   DCHECK(save != NULL);
   return save;
 }
-
-
-RUNTIME_FUNCTION(Runtime_IsOptimized) {
-  SealHandleScope shs(isolate);
-  DCHECK(args.length() == 0);
-  JavaScriptFrameIterator it(isolate);
-  JavaScriptFrame* frame = it.frame();
-  return isolate->heap()->ToBoolean(frame->is_optimized());
-}


// Advances the iterator to the frame that matches the index and returns the
=======================================
--- /branches/bleeding_edge/src/runtime.h       Tue Aug 12 15:28:20 2014 UTC
+++ /branches/bleeding_edge/src/runtime.h       Wed Aug 13 14:09:50 2014 UTC
@@ -68,7 +68,6 @@
   F(OptimizeFunctionOnNextCall, -1, 1)                      \
   F(NeverOptimizeFunction, 1, 1)                            \
   F(GetOptimizationStatus, -1, 1)                           \
-  F(IsOptimized, 0, 1) /* TODO(turbofan): Only temporary */ \
   F(GetOptimizationCount, 1, 1)                             \
   F(UnblockConcurrentRecompilation, 0, 1)                   \
   F(CompileForOnStackReplacement, 1, 1)                     \
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-run-deopt.cc Wed Aug 6 11:49:02 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-run-deopt.cc Wed Aug 13 14:09:50 2014 UTC
@@ -4,11 +4,26 @@

 #include "src/v8.h"

+#include "test/cctest/cctest.h"
 #include "test/cctest/compiler/function-tester.h"

+using namespace v8;
 using namespace v8::internal;
 using namespace v8::internal::compiler;

+static void IsOptimized(const FunctionCallbackInfo<v8::Value>& args) {
+  JavaScriptFrameIterator it(CcTest::i_isolate());
+  JavaScriptFrame* frame = it.frame();
+  return args.GetReturnValue().Set(frame->is_optimized());
+}
+
+
+static void InstallIsOptimizedHelper(v8::Isolate* isolate) {
+  Local<v8::Context> context = isolate->GetCurrentContext();
+ Local<v8::FunctionTemplate> t = FunctionTemplate::New(isolate, IsOptimized);
+  context->Global()->Set(v8_str("IsOptimized"), t->GetFunction());
+}
+
 #if V8_TURBOFAN_TARGET

 TEST(TurboSimpleDeopt) {
@@ -18,11 +33,12 @@
   FunctionTester T(
       "(function f(a) {"
       "var b = 1;"
-      "if (!%IsOptimized()) return 0;"
+      "if (!IsOptimized()) return 0;"
       "%DeoptimizeFunction(f);"
-      "if (%IsOptimized()) return 0;"
+      "if (IsOptimized()) return 0;"
       "return a + b; })");

+  InstallIsOptimizedHelper(CcTest::isolate());
   T.CheckCall(T.Val(2), T.Val(1));
 }

@@ -35,11 +51,12 @@
       "(function f(a) {"
       "var b = 1;"
       "var c = 2;"
-      "if (!%IsOptimized()) return 0;"
+      "if (!IsOptimized()) return 0;"
       "var d = b + (%DeoptimizeFunction(f), c);"
-      "if (%IsOptimized()) return 0;"
+      "if (IsOptimized()) return 0;"
       "return d + a; })");

+  InstallIsOptimizedHelper(CcTest::isolate());
   T.CheckCall(T.Val(6), T.Val(3));
 }

=======================================
--- /branches/bleeding_edge/tools/generate-runtime-tests.py Tue Aug 12 15:28:20 2014 UTC +++ /branches/bleeding_edge/tools/generate-runtime-tests.py Wed Aug 13 14:09:50 2014 UTC
@@ -47,8 +47,8 @@
# that the parser doesn't bit-rot. Change the values as needed when you add, # remove or change runtime functions, but make sure we don't lose our ability
 # to parse them!
-EXPECTED_FUNCTION_COUNT = 429
-EXPECTED_FUZZABLE_COUNT = 332
+EXPECTED_FUNCTION_COUNT = 428
+EXPECTED_FUZZABLE_COUNT = 331
 EXPECTED_CCTEST_COUNT = 7
 EXPECTED_UNKNOWN_COUNT = 16
 EXPECTED_BUILTINS_COUNT = 808

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to