- code pre-aging does not work with serializing.
- compilation info needs to remember that we compile for serializing.
- test case leaks memory.
R=vogelheim@chromium.org
Review URL: https://codereview.chromium.org/
379563002
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22281
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
info.SetCachedData(cached_data, cached_data_mode);
info.SetExtension(extension);
info.SetContext(context);
+ if (FLAG_serialize_toplevel && cached_data_mode == PRODUCE_CACHED_DATA) {
+ info.PrepareForSerializing();
+ }
if (FLAG_use_strict) info.SetStrictMode(STRICT);
result = CompileToplevel(&info);
ASSERT(!is_lazy());
flags_ |= IsEval::encode(true);
}
+
void MarkAsGlobal() {
ASSERT(!is_lazy());
flags_ |= IsGlobal::encode(true);
}
+
void set_parameter_count(int parameter_count) {
ASSERT(IsStub());
parameter_count_ = parameter_count;
void set_this_has_uses(bool has_no_uses) {
this_has_uses_ = has_no_uses;
}
+
bool this_has_uses() {
return this_has_uses_;
}
+
void SetStrictMode(StrictMode strict_mode) {
ASSERT(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode);
flags_ = StrictModeField::update(flags_, strict_mode);
}
+
void MarkAsNative() {
flags_ |= IsNative::encode(true);
}
return IsDebug::decode(flags_);
}
+ void PrepareForSerializing() {
+ ASSERT(!is_lazy());
+ flags_ |= PrepareForSerializing::encode(true);
+ }
+
+ bool will_serialize() const { return PrepareForSerializing::decode(flags_); }
+
bool IsCodePreAgingActive() const {
- return FLAG_optimize_for_size && FLAG_age_code && !is_debug();
+ return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() &&
+ !is_debug();
}
void SetParseRestriction(ParseRestriction restriction) {
class RequiresFrame: public BitField<bool, 13, 1> {};
// If the function cannot build a frame (for unspecified reasons)
class MustNotHaveEagerFrame: public BitField<bool, 14, 1> {};
+ // If we plan to serialize the compiled code.
+ class PrepareForSerializing : public BitField<bool, 15, 1> {};
unsigned flags_;
CodeGenerator::MakeCodePrologue(info, "full");
const int kInitialBufferSize = 4 * KB;
MacroAssembler masm(info->isolate(), NULL, kInitialBufferSize);
- if (FLAG_serialize_toplevel &&
- info->cached_data_mode() == PRODUCE_CACHED_DATA && info->is_global()) {
- masm.enable_serializer();
- }
+ if (info->will_serialize()) masm.enable_serializer();
#ifdef ENABLE_GDB_JIT_INTERFACE
masm.positions_recorder()->StartGDBJITLineInfoRecording();
# BUG(3287). (test-cpu-profiler/SampleWhenFrameIsNotSetup)
'test-cpu-profiler/*': [PASS, FLAKY],
- # TODO(yangguo): Temporarily disable code serializer test
- 'test-compiler/SerializeToplevel': [SKIP],
-
############################################################################
# Slow tests.
'test-api/Threading1': [PASS, ['mode == debug', SLOW]],
Handle<Object> result =
Execution::Call(isolate, fun, global, 0, NULL).ToHandleChecked();
CHECK_EQ(2, Handle<Smi>::cast(result)->value());
+
+ delete cache;
}