Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: include/v8-defaults.h

Issue 24269003: Add methods to enable configuration of ResourceConstraints based on limits derived at runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: /s/uintptr_t/uint64_t Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | include/v8-testing.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « include/v8.h ('k') | include/v8-testing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698