Merge UnoptimizedCompileJobTest::CompileFailureToFinalize and UnoptimizedCompileJobTest::CompileFailureToAnalyse

They both do the same thing, and UnoptimizedCompileJobTest.CompileFailureToFinalize was
failing on arm due to stack size parameters.

BUG=v8:8041

No-Presubmit: true
No-Tree-Checks: true
No-Try: true

Change-Id: I2506aed026420c2634d5cd41b0dc268debb512eb
Reviewed-on: https://chromium-review.googlesource.com/1236814
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56099}
This commit is contained in:
Ross McIlroy 2018-09-20 17:24:41 +01:00
parent 6a59849217
commit 07a35d28f2

View File

@ -177,7 +177,7 @@ TEST_F(UnoptimizedCompileJobTest, CompileAndRun) {
ASSERT_TRUE(value == Smi::FromInt(160));
}
TEST_F(UnoptimizedCompileJobTest, CompileFailureToAnalyse) {
TEST_F(UnoptimizedCompileJobTest, CompileFailure) {
std::string raw_script("() { var a = ");
for (int i = 0; i < 10000; i++) {
// TODO(leszeks): Figure out a more "unit-test-y" way of forcing an analysis
@ -208,34 +208,6 @@ TEST_F(UnoptimizedCompileJobTest, CompileFailureToAnalyse) {
ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
}
TEST_F(UnoptimizedCompileJobTest, CompileFailureToFinalize) {
std::string raw_script("() { var a = ");
for (int i = 0; i < 5000; i++) {
// Alternate + and - to avoid n-ary operation nodes.
raw_script += "'x' + 'x' - ";
}
raw_script += " 'x'; }";
test::ScriptResource* script =
new test::ScriptResource(raw_script.c_str(), strlen(raw_script.c_str()));
Handle<SharedFunctionInfo> shared =
test::CreateSharedFunctionInfo(isolate(), script);
std::unique_ptr<UnoptimizedCompileJob> job(
NewUnoptimizedCompileJob(isolate(), shared, 50));
job->Compile(false);
ASSERT_FALSE(job->IsFailed());
ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kReadyToFinalize, job);
job->FinalizeOnMainThread(isolate(), shared);
ASSERT_TRUE(job->IsFailed());
ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kFailed, job);
ASSERT_TRUE(isolate()->has_pending_exception());
isolate()->clear_pending_exception();
job->ResetOnMainThread(isolate());
ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job);
}
class CompileTask : public Task {
public:
CompileTask(UnoptimizedCompileJob* job, base::Semaphore* semaphore)