| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" | 7 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" |
| 8 #include "src/flags.h" | 8 #include "src/flags.h" |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 typedef TestWithContext CompilerDispatcherJobTest; | 16 typedef TestWithContext CompilerDispatcherJobTest; |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class ScriptResource : public v8::String::ExternalOneByteStringResource { | 20 class ScriptResource : public v8::String::ExternalOneByteStringResource { |
| 21 public: | 21 public: |
| 22 ScriptResource(const char* data, size_t length) | 22 ScriptResource(const char* data, size_t length) |
| 23 : data_(data), length_(length) {} | 23 : data_(data), length_(length) {} |
| 24 ~ScriptResource() override = default; |
| 24 | 25 |
| 25 const char* data() const { return data_; } | 26 const char* data() const override { return data_; } |
| 26 size_t length() const { return length_; } | 27 size_t length() const override { return length_; } |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 const char* data_; | 30 const char* data_; |
| 30 size_t length_; | 31 size_t length_; |
| 31 | 32 |
| 32 DISALLOW_COPY_AND_ASSIGN(ScriptResource); | 33 DISALLOW_COPY_AND_ASSIGN(ScriptResource); |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 Handle<JSFunction> CreateFunction( | 36 Handle<JSFunction> CreateFunction( |
| 36 Isolate* isolate, ExternalOneByteString::Resource* maybe_resource) { | 37 Isolate* isolate, ExternalOneByteString::Resource* maybe_resource) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 85 |
| 85 ASSERT_TRUE(job->status() == CompileJobStatus::kInitial); | 86 ASSERT_TRUE(job->status() == CompileJobStatus::kInitial); |
| 86 job->PrepareToParseOnMainThread(); | 87 job->PrepareToParseOnMainThread(); |
| 87 ASSERT_TRUE(job->status() == CompileJobStatus::kReadyToParse); | 88 ASSERT_TRUE(job->status() == CompileJobStatus::kReadyToParse); |
| 88 job->Parse(); | 89 job->Parse(); |
| 89 ASSERT_TRUE(job->status() == CompileJobStatus::kParsed); | 90 ASSERT_TRUE(job->status() == CompileJobStatus::kParsed); |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace internal | 93 } // namespace internal |
| 93 } // namespace v8 | 94 } // namespace v8 |
| OLD | NEW |