This repository has been archived by the owner on Mar 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged: [arm] Fix custom addition in MacroAssembler::[Fast]Allocate
Revision: 87332fd BUG=chromium:663402 LOG=N NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true R=cbruni@chromium.org Review URL: https://codereview.chromium.org/2500843002 . Cr-Commit-Position: refs/branch-heads/5.5@{v8#42} Cr-Branched-From: 3cbd583-refs/heads/5.5.372@{#1} Cr-Branched-From: b3c8b0c-refs/heads/master@{#40015}
- Loading branch information
1 parent
14a4417
commit fb84109
Showing
2 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2016 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --allow-natives-syntax | ||
|
||
var g_eval = eval; | ||
function emit_f(size) { | ||
var body = "function f(x) {" + | ||
" if (x < 0) return x;" + | ||
" var a = [1];" + | ||
" if (x > 0) return ["; | ||
for (var i = 0; i < size; i++) { | ||
body += "0.1, "; | ||
} | ||
body += " ];" + | ||
" return a;" + | ||
"}"; | ||
g_eval(body); | ||
} | ||
|
||
// Length must be big enough to make the backing store's size not fit into | ||
// a single instruction's immediate field (2^12). | ||
var kLength = 701; | ||
emit_f(kLength); | ||
f(1); | ||
f(1); | ||
%OptimizeFunctionOnNextCall(f); | ||
var a = f(1); | ||
|
||
// Allocating something else should not disturb |a|. | ||
var b = new Object(); | ||
for (var i = 0; i < kLength; i++) { | ||
assertEquals(0.1, a[i]); | ||
} | ||
|
||
// Allocating more should not crash. | ||
for (var i = 0; i < 300; i++) { | ||
f(1); | ||
} |