Reviewers: danno, Hannes Payer,
Description:
Add -Os flag to optimize for space (will be used by pre-aging CL), and
remove
the --is_memory_constrained ResourceConstraint.
BUG=292928
Please review this at https://codereview.chromium.org/24018009/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+5, -33 lines):
M include/v8.h
M src/api.cc
M src/flag-definitions.h
M src/isolate.h
M src/isolate.cc
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
79f4478ea6f626ff297314b4ed227d5dc088abed..457f71d9d8d1ee6299a702edb4e02d14b3d45683
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3745,20 +3745,11 @@ class V8_EXPORT ResourceConstraints {
uint32_t* stack_limit() const { return stack_limit_; }
// Sets an address beyond which the VM's stack may not grow.
void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
- Maybe<bool> is_memory_constrained() const { return
is_memory_constrained_; }
- // If set to true, V8 will limit it's memory usage, at the potential
cost of
- // lower performance. Note, this option is a tentative addition to the
API
- // and may be removed or modified without warning.
- void set_memory_constrained(bool value) {
- is_memory_constrained_ = Maybe<bool>(value);
- }
-
private:
int max_young_space_size_;
int max_old_space_size_;
int max_executable_size_;
uint32_t* stack_limit_;
- Maybe<bool> is_memory_constrained_;
};
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
0a38fa9f32b2b3e3932a178d756c80b44b1a0c1e..fcea10a56b62f8831c719ab8006fdadcdb7f00a6
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -602,8 +602,7 @@ ResourceConstraints::ResourceConstraints()
: max_young_space_size_(0),
max_old_space_size_(0),
max_executable_size_(0),
- stack_limit_(NULL),
- is_memory_constrained_() { }
+ stack_limit_(NULL) { }
bool SetResourceConstraints(ResourceConstraints* constraints) {
@@ -624,11 +623,6 @@ bool SetResourceConstraints(ResourceConstraints*
constraints) {
uintptr_t limit =
reinterpret_cast<uintptr_t>(constraints->stack_limit());
isolate->stack_guard()->SetStackLimit(limit);
}
- if (constraints->is_memory_constrained().has_value &&
- !i::FLAG_force_memory_constrained.has_value) {
- isolate->set_is_memory_constrained(
- constraints->is_memory_constrained().value);
- }
return true;
}
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
e734c7d3c6429bce47455261a1bb36cec37dcafd..fcc3f721b0724778c798b44fa2a0cf8694eee1ce
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -222,6 +222,10 @@ DEFINE_implication(track_heap_object_fields,
track_fields)
DEFINE_implication(track_computed_fields, track_fields)
DEFINE_bool(smi_binop, true, "support smi representation in binary
operations")
+// Flags for optimization types.
+DEFINE_bool(Os, false, "Optimize for size. Enables optimizations which
reduce "
+ "generated code size.")
+
// Flags for data representation optimizations
DEFINE_bool(unbox_double_arrays, true, "automatically unbox arrays of
doubles")
DEFINE_bool(string_slices, true, "use string slices")
@@ -594,9 +598,6 @@ DEFINE_int(hash_seed,
0,
"Fixed seed to use to hash property keys (0 means random)"
"(with snapshots this option cannot override the baked-in
seed)")
-DEFINE_maybe_bool(force_memory_constrained,
- "force (if true) or prevent (if false) the runtime from
treating "
- "the device as being memory constrained.")
// v8.cc
DEFINE_bool(preemption, false,
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index
479fe2fb6396bc81ac15aebaffb9cb9eae69f16c..ac74604792e47dbd10f9539622246b547807b9de
100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1776,10 +1776,6 @@ Isolate::Isolate()
// TODO(bmeurer) Initialized lazily because it depends on flags; can
// be fixed once the default isolate cleanup is done.
random_number_generator_(NULL),
- // TODO(rmcilroy) Currently setting this based on
- // FLAG_force_memory_constrained in Isolate::Init; move to here when
- // isolate cleanup is done
- is_memory_constrained_(false),
has_fatal_error_(false),
use_crankshaft_(true),
initialized_from_snapshot_(false),
@@ -2138,8 +2134,6 @@ bool Isolate::Init(Deserializer* des) {
TRACE_ISOLATE(init);
stress_deopt_count_ = FLAG_deopt_every_n_times;
- if (FLAG_force_memory_constrained.has_value)
- is_memory_constrained_ = FLAG_force_memory_constrained.value;
has_fatal_error_ = false;
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index
b826ec596abaa1225b66f4b8ff926e5726b6ddbe..ab2393f521db6d1d5abbbd35eb8cd9efe74af858
100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -1131,13 +1131,6 @@ class Isolate {
// Given an address occupied by a live code object, return that object.
Object* FindCodeObject(Address a);
- bool is_memory_constrained() const {
- return is_memory_constrained_;
- }
- void set_is_memory_constrained(bool value) {
- is_memory_constrained_ = value;
- }
-
private:
Isolate();
@@ -1310,7 +1303,6 @@ class Isolate {
unibrow::Mapping<unibrow::Ecma262Canonicalize>
interp_canonicalize_mapping_;
CodeStubInterfaceDescriptor* code_stub_interface_descriptors_;
RandomNumberGenerator* random_number_generator_;
- bool is_memory_constrained_;
// True if fatal error has been signaled for this isolate.
bool has_fatal_error_;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.