Index: include/v8-defaults.h |
diff --git a/test/cctest/test-cpu.cc b/include/v8-defaults.h |
similarity index 71% |
copy from test/cctest/test-cpu.cc |
copy to include/v8-defaults.h |
index 06966c68c86296e510edb8899f4d7deb0343f108..381a48210d1b9895fbda4e4c89eb0e51fa61b6d0 100644 |
--- a/test/cctest/test-cpu.cc |
+++ b/include/v8-defaults.h |
@@ -25,31 +25,30 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#include "v8.h" |
- |
-#include "cctest.h" |
-#include "cpu.h" |
+#ifndef V8_V8_DEFAULTS_H_ |
+#define V8_V8_DEFAULTS_H_ |
-using namespace v8::internal; |
+#include "v8.h" |
+/** |
+ * Default configuration support for the V8 JavaScript engine. |
+ */ |
+namespace v8 { |
-TEST(FeatureImplications) { |
- // Test for features implied by other features. |
- CPU cpu; |
+/** |
+ * Configures the constraints with reasonable default values based on the |
+ * capabilities of the current device the VM is running on. |
+ */ |
+bool V8_EXPORT ConfigureResourceConstraintsForCurrentPlatform( |
+ ResourceConstraints* constraints); |
- // ia32 and x64 features |
- CHECK(!cpu.has_sse() || cpu.has_mmx()); |
- CHECK(!cpu.has_sse2() || cpu.has_sse()); |
- CHECK(!cpu.has_sse3() || cpu.has_sse2()); |
- CHECK(!cpu.has_ssse3() || cpu.has_sse3()); |
- CHECK(!cpu.has_sse41() || cpu.has_sse3()); |
- CHECK(!cpu.has_sse42() || cpu.has_sse41()); |
- // arm features |
- CHECK(!cpu.has_vfp3_d32() || cpu.has_vfp3()); |
-} |
+/** |
+ * Convience function which performs SetResourceConstraints with the settings |
+ * returned by ConfigureResourceConstraintsForCurrentPlatform. |
+ */ |
+bool V8_EXPORT SetDefaultResourceConstraintsForCurrentPlatform(); |
+} // namespace v8 |
-TEST(NumberOfProcessorsOnline) { |
- CHECK_GT(CPU::NumberOfProcessorsOnline(), 0); |
-} |
+#endif // V8_V8_DEFAULTS_H_ |