Commit 07a35d28 authored by Ross McIlroy's avatar Ross McIlroy

Merge UnoptimizedCompileJobTest::CompileFailureToFinalize and ...

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/1236814Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56099}
parent 6a598492
...@@ -177,7 +177,7 @@ TEST_F(UnoptimizedCompileJobTest, CompileAndRun) { ...@@ -177,7 +177,7 @@ TEST_F(UnoptimizedCompileJobTest, CompileAndRun) {
ASSERT_TRUE(value == Smi::FromInt(160)); ASSERT_TRUE(value == Smi::FromInt(160));
} }
TEST_F(UnoptimizedCompileJobTest, CompileFailureToAnalyse) { TEST_F(UnoptimizedCompileJobTest, CompileFailure) {
std::string raw_script("() { var a = "); std::string raw_script("() { var a = ");
for (int i = 0; i < 10000; i++) { for (int i = 0; i < 10000; i++) {
// TODO(leszeks): Figure out a more "unit-test-y" way of forcing an analysis // TODO(leszeks): Figure out a more "unit-test-y" way of forcing an analysis
...@@ -208,34 +208,6 @@ TEST_F(UnoptimizedCompileJobTest, CompileFailureToAnalyse) { ...@@ -208,34 +208,6 @@ TEST_F(UnoptimizedCompileJobTest, CompileFailureToAnalyse) {
ASSERT_JOB_STATUS(CompilerDispatcherJob::Status::kInitial, job); 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 { class CompileTask : public Task {
public: public:
CompileTask(UnoptimizedCompileJob* job, base::Semaphore* semaphore) CompileTask(UnoptimizedCompileJob* job, base::Semaphore* semaphore)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment