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

Unified Diff: runtime/vm/object.cc

Issue 2960413002: Omit JIT compiler from precompiled runtime on ARM, ARM64 and IA32. (Closed)
Patch Set: Moved trace_irregexp flag to flag_list.h Created 3 years, 5 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 | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 52c92e2face95c1fb801fa3d09b2d09cd3cd95a8..dcc5f428be578aa8f0adc44ef513160ec12944e7 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -11841,6 +11841,10 @@ void Namespace::AddMetadata(const Object& owner, TokenPosition token_pos) {
RawObject* Namespace::GetMetadata() const {
+#if defined(DART_PRECOMPILED_RUNTIME)
+ COMPILE_ASSERT(!FLAG_enable_mirrors);
+ return Object::empty_array().raw();
+#else
Field& field = Field::Handle(metadata_field());
if (field.IsNull()) {
// There is no metadata for this object.
@@ -11856,6 +11860,7 @@ RawObject* Namespace::GetMetadata() const {
}
}
return metadata.raw();
+#endif // defined(DART_PRECOMPILED_RUNTIME)
}
@@ -12980,111 +12985,6 @@ const char* ExceptionHandlers::ToCString() const {
}
-intptr_t DeoptInfo::FrameSize(const TypedData& packed) {
- NoSafepointScope no_safepoint;
- typedef ReadStream::Raw<sizeof(intptr_t), intptr_t> Reader;
- ReadStream read_stream(reinterpret_cast<uint8_t*>(packed.DataAddr(0)),
- packed.LengthInBytes());
- return Reader::Read(&read_stream);
-}
-
-
-intptr_t DeoptInfo::NumMaterializations(
- const GrowableArray<DeoptInstr*>& unpacked) {
- intptr_t num = 0;
- while (unpacked[num]->kind() == DeoptInstr::kMaterializeObject) {
- num++;
- }
- return num;
-}
-
-
-void DeoptInfo::UnpackInto(const Array& table,
- const TypedData& packed,
- GrowableArray<DeoptInstr*>* unpacked,
- intptr_t length) {
- NoSafepointScope no_safepoint;
- typedef ReadStream::Raw<sizeof(intptr_t), intptr_t> Reader;
- ReadStream read_stream(reinterpret_cast<uint8_t*>(packed.DataAddr(0)),
- packed.LengthInBytes());
- const intptr_t frame_size = Reader::Read(&read_stream); // Skip frame size.
- USE(frame_size);
-
- const intptr_t suffix_length = Reader::Read(&read_stream);
- if (suffix_length != 0) {
- ASSERT(suffix_length > 1);
- const intptr_t info_number = Reader::Read(&read_stream);
-
- TypedData& suffix = TypedData::Handle();
- Smi& offset = Smi::Handle();
- Smi& reason_and_flags = Smi::Handle();
- DeoptTable::GetEntry(table, info_number, &offset, &suffix,
- &reason_and_flags);
- UnpackInto(table, suffix, unpacked, suffix_length);
- }
-
- while ((read_stream.PendingBytes() > 0) && (unpacked->length() < length)) {
- const intptr_t instruction = Reader::Read(&read_stream);
- const intptr_t from_index = Reader::Read(&read_stream);
- unpacked->Add(DeoptInstr::Create(instruction, from_index));
- }
-}
-
-
-void DeoptInfo::Unpack(const Array& table,
- const TypedData& packed,
- GrowableArray<DeoptInstr*>* unpacked) {
- ASSERT(unpacked->is_empty());
-
- // Pass kMaxInt32 as the length to unpack all instructions from the
- // packed stream.
- UnpackInto(table, packed, unpacked, kMaxInt32);
-
- unpacked->Reverse();
-}
-
-
-const char* DeoptInfo::ToCString(const Array& deopt_table,
- const TypedData& packed) {
-#define FORMAT "[%s]"
- GrowableArray<DeoptInstr*> deopt_instrs;
- Unpack(deopt_table, packed, &deopt_instrs);
-
- // Compute the buffer size required.
- intptr_t len = 1; // Trailing '\0'.
- for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
- len += OS::SNPrint(NULL, 0, FORMAT, deopt_instrs[i]->ToCString());
- }
-
- // Allocate the buffer.
- char* buffer = Thread::Current()->zone()->Alloc<char>(len);
-
- // Layout the fields in the buffer.
- intptr_t index = 0;
- for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
- index += OS::SNPrint((buffer + index), (len - index), FORMAT,
- deopt_instrs[i]->ToCString());
- }
-
- return buffer;
-#undef FORMAT
-}
-
-
-// Returns a bool so it can be asserted.
-bool DeoptInfo::VerifyDecompression(const GrowableArray<DeoptInstr*>& original,
- const Array& deopt_table,
- const TypedData& packed) {
- GrowableArray<DeoptInstr*> unpacked;
- Unpack(deopt_table, packed, &unpacked);
- ASSERT(unpacked.length() == original.length());
- for (intptr_t i = 0; i < unpacked.length(); ++i) {
- ASSERT(unpacked[i]->Equals(*original[i]));
- }
- return true;
-}
-
-
void SingleTargetCache::set_target(const Code& value) const {
StorePointer(&raw_ptr()->target_, value.raw());
}
@@ -14354,6 +14254,10 @@ bool Code::HasBreakpoint() const {
RawTypedData* Code::GetDeoptInfoAtPc(uword pc,
ICData::DeoptReasonId* deopt_reason,
uint32_t* deopt_flags) const {
+#if defined(DART_PRECOMPILED_RUNTIME)
+ ASSERT(Dart::vm_snapshot_kind() == Snapshot::kFullAOT);
+ return TypedData::null();
+#else
ASSERT(is_optimized());
const Instructions& instrs = Instructions::Handle(instructions());
uword code_entry = instrs.PayloadStart();
@@ -14378,6 +14282,7 @@ RawTypedData* Code::GetDeoptInfoAtPc(uword pc,
}
*deopt_reason = ICData::kDeoptUnknown;
return TypedData::null();
+#endif // defined(DART_PRECOMPILED_RUNTIME)
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698