Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1052)

Unified Diff: test/mjsunit/compiler/stubs/floor-stub.js

Issue 1225943002: Reland: Add unoptimized/optimized variants of MathFloor TF code stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nosnap bug Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/compiler/test-run-stubs.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/stubs/floor-stub.js
diff --git a/test/mjsunit/compiler/stubs/floor-stub.js b/test/mjsunit/compiler/stubs/floor-stub.js
index e3fc9b6003f6c1f8b59f565fe1a5b74f9f2c4d2a..08cbef72af1e769dc93109af8ab377a37a62ac2d 100644
--- a/test/mjsunit/compiler/stubs/floor-stub.js
+++ b/test/mjsunit/compiler/stubs/floor-stub.js
@@ -25,30 +25,35 @@
// (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: --allow-natives-syntax --expose-natives-as=builtins --noalways-opt
+// Flags: --allow-natives-syntax --expose-natives-as=builtins --noalways-opt --turbo-filter=*
const kExtraTypeFeedbackMinusZeroSentinel = 1;
+const kFirstJSFunctionTypeFeedbackIndex = 5;
const kFirstSlotExtraTypeFeedbackIndex = 5;
-(function(){
- var floorFunc = function() {
- Math.floor(NaN);
+(function() {
+ var stub1 = builtins.MathFloorStub("MathFloorStub", 1);
+ var tempForTypeVector = function(d) {
+ return Math.round(d);
}
- // Execute the function once to make sure it has a type feedback vector.
- floorFunc(5);
- var stub = builtins.MathFloorStub("MathFloorStub", 0);
+ tempForTypeVector(5);
+ var tv = %GetTypeFeedbackVector(tempForTypeVector);
+ var floorFunc1 = function(v, first) {
+ if (first) return;
+ return stub1(stub1, kFirstSlotExtraTypeFeedbackIndex - 1, tv, undefined, v);
+ };
+ %OptimizeFunctionOnNextCall(stub1);
+ floorFunc1(5, true);
+ %FixedArraySet(tv, kFirstSlotExtraTypeFeedbackIndex - 1, stub1);
assertTrue(kExtraTypeFeedbackMinusZeroSentinel !==
- %FixedArrayGet(%GetTypeFeedbackVector(floorFunc),
- kFirstSlotExtraTypeFeedbackIndex));
- assertEquals(5.0, stub(floorFunc, 4, 5.5));
+ %FixedArrayGet(tv, kFirstSlotExtraTypeFeedbackIndex));
+ assertEquals(5.0, floorFunc1(5.5));
assertTrue(kExtraTypeFeedbackMinusZeroSentinel !==
- %FixedArrayGet(%GetTypeFeedbackVector(floorFunc),
- kFirstSlotExtraTypeFeedbackIndex));
+ %FixedArrayGet(tv, kFirstSlotExtraTypeFeedbackIndex));
// Executing floor such that it returns -0 should set the proper sentinel in
// the feedback vector.
- assertEquals(-Infinity, 1/stub(floorFunc, 4, -0));
+ assertEquals(-Infinity, 1/floorFunc1(-0));
assertEquals(kExtraTypeFeedbackMinusZeroSentinel,
- %FixedArrayGet(%GetTypeFeedbackVector(floorFunc),
- kFirstSlotExtraTypeFeedbackIndex));
- %ClearFunctionTypeFeedback(floorFunc);
+ %FixedArrayGet(tv, kFirstSlotExtraTypeFeedbackIndex));
+ %ClearFunctionTypeFeedback(floorFunc1);
})();
« no previous file with comments | « test/cctest/compiler/test-run-stubs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698