mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Fix ia32/x64 gcc build.
(The simulators are broken at runtime.) Change-Id: I10089cad44fca57145cfdd598342279f07c6d7fd Reviewed-on: https://dart-review.googlesource.com/75205 Reviewed-by: Régis Crelier <regis@google.com> Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
c1ea77a3a0
commit
0c80630577
|
@ -690,11 +690,13 @@ if (is_win) {
|
||||||
# See http://lwn.net/Articles/192624/ .
|
# See http://lwn.net/Articles/192624/ .
|
||||||
"-Wl,-O1",
|
"-Wl,-O1",
|
||||||
"-Wl,--gc-sections",
|
"-Wl,--gc-sections",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (is_clang) {
|
||||||
# Identical code folding to reduce size.
|
# Identical code folding to reduce size.
|
||||||
# Warning: This changes C/C++ semantics of function pointer comparison.
|
# Warning: This changes C/C++ semantics of function pointer comparison.
|
||||||
"-Wl,--icf=all",
|
common_optimize_on_ldflags += [ "-Wl,--icf=all" ]
|
||||||
]
|
}
|
||||||
|
|
||||||
if (!using_sanitizer) {
|
if (!using_sanitizer) {
|
||||||
# Functions interposed by the sanitizers can make ld think
|
# Functions interposed by the sanitizers can make ld think
|
||||||
|
|
|
@ -158,6 +158,7 @@ config("dart_config") {
|
||||||
"-Wvla",
|
"-Wvla",
|
||||||
"-Wno-conversion-null",
|
"-Wno-conversion-null",
|
||||||
"-Woverloaded-virtual",
|
"-Woverloaded-virtual",
|
||||||
|
"-Wno-comments", # Conflicts with clang-format.
|
||||||
"-g3",
|
"-g3",
|
||||||
"-ggdb3",
|
"-ggdb3",
|
||||||
"-fno-rtti",
|
"-fno-rtti",
|
||||||
|
|
|
@ -119,7 +119,25 @@ class CallbackOptionProcessor : public OptionProcessor {
|
||||||
static OptionProcessor_##name option_##name;
|
static OptionProcessor_##name option_##name;
|
||||||
|
|
||||||
#define DEFINE_BOOL_OPTION(name, variable) \
|
#define DEFINE_BOOL_OPTION(name, variable) \
|
||||||
DEFINE_BOOL_OPTION_CB(name, { variable = true; })
|
class OptionProcessor_##name : public OptionProcessor { \
|
||||||
|
public: \
|
||||||
|
virtual bool Process(const char* option, CommandLineOptions* vm_options) { \
|
||||||
|
const char* value = OptionProcessor::ProcessOption(option, "--" #name); \
|
||||||
|
if (value == NULL) { \
|
||||||
|
return false; \
|
||||||
|
} \
|
||||||
|
if (*value == '=') { \
|
||||||
|
Log::PrintErr("Non-empty value for option " #name "\n"); \
|
||||||
|
return false; \
|
||||||
|
} \
|
||||||
|
if (*value != '\0') { \
|
||||||
|
return false; \
|
||||||
|
} \
|
||||||
|
variable = true; \
|
||||||
|
return true; \
|
||||||
|
} \
|
||||||
|
}; \
|
||||||
|
static OptionProcessor_##name option_##name;
|
||||||
|
|
||||||
#define DEFINE_BOOL_OPTION_SHORT(short_name, long_name, variable) \
|
#define DEFINE_BOOL_OPTION_SHORT(short_name, long_name, variable) \
|
||||||
class OptionProcessor_##long_name : public OptionProcessor { \
|
class OptionProcessor_##long_name : public OptionProcessor { \
|
||||||
|
|
|
@ -1141,7 +1141,6 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
||||||
(representation() == kUnboxedFloat64x2)) {
|
(representation() == kUnboxedFloat64x2)) {
|
||||||
const VRegister result = locs()->out(0).fpu_reg();
|
const VRegister result = locs()->out(0).fpu_reg();
|
||||||
switch (class_id()) {
|
switch (class_id()) {
|
||||||
ASSERT(aligned());
|
|
||||||
case kTypedDataFloat32ArrayCid:
|
case kTypedDataFloat32ArrayCid:
|
||||||
// Load single precision float.
|
// Load single precision float.
|
||||||
if (aligned()) {
|
if (aligned()) {
|
||||||
|
|
|
@ -1190,6 +1190,7 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraphOfDynamicInvocationForwarder() {
|
||||||
first_parameter_offset = ReaderOffset() + data_program_offset_;
|
first_parameter_offset = ReaderOffset() + data_program_offset_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
USE(first_parameter_offset);
|
||||||
// Current position: About to read list of positionals.
|
// Current position: About to read list of positionals.
|
||||||
|
|
||||||
// Should never build a dynamic invocation forwarder for equality
|
// Should never build a dynamic invocation forwarder for equality
|
||||||
|
|
|
@ -283,6 +283,9 @@ class ExceptionHandlerFinder : public StackResource {
|
||||||
case CatchEntryMove::SourceKind::kUint32Slot:
|
case CatchEntryMove::SourceKind::kUint32Slot:
|
||||||
value = Integer::New(*SlotAt<uint32_t>(fp, move.src_slot()));
|
value = Integer::New(*SlotAt<uint32_t>(fp, move.src_slot()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
*TaggedSlotAt(fp, move.dest_slot()) = value;
|
*TaggedSlotAt(fp, move.dest_slot()) = value;
|
||||||
|
@ -296,7 +299,7 @@ class ExceptionHandlerFinder : public StackResource {
|
||||||
NoSafepointScope no_safepoint;
|
NoSafepointScope no_safepoint;
|
||||||
ReadStream stream(static_cast<uint8_t*>(td.DataAddr(0)), td.Length());
|
ReadStream stream(static_cast<uint8_t*>(td.DataAddr(0)), td.Length());
|
||||||
|
|
||||||
intptr_t prefix_length, suffix_length, suffix_offset;
|
intptr_t prefix_length = 0, suffix_length = 0, suffix_offset = 0;
|
||||||
while (stream.PendingBytes() > 0) {
|
while (stream.PendingBytes() > 0) {
|
||||||
intptr_t target_pc_offset = Reader::Read(&stream);
|
intptr_t target_pc_offset = Reader::Read(&stream);
|
||||||
prefix_length = Reader::Read(&stream);
|
prefix_length = Reader::Read(&stream);
|
||||||
|
|
|
@ -890,7 +890,7 @@ DART_NOINLINE bool Interpreter::InvokeCompiled(Thread* thread,
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
#endif
|
#endif
|
||||||
ASSERT(Function::HasCode(function));
|
ASSERT(Function::HasCode(function));
|
||||||
RawCode* code = function->ptr()->code_;
|
RawCode* volatile code = function->ptr()->code_;
|
||||||
ASSERT(code != StubCode::LazyCompile_entry()->code());
|
ASSERT(code != StubCode::LazyCompile_entry()->code());
|
||||||
// TODO(regis): Once we share the same stack, try to invoke directly.
|
// TODO(regis): Once we share the same stack, try to invoke directly.
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
|
@ -902,9 +902,9 @@ DART_NOINLINE bool Interpreter::InvokeCompiled(Thread* thread,
|
||||||
// On success, returns a RawInstance. On failure, a RawError.
|
// On success, returns a RawInstance. On failure, a RawError.
|
||||||
typedef RawObject* (*invokestub)(RawCode * code, RawArray * argdesc,
|
typedef RawObject* (*invokestub)(RawCode * code, RawArray * argdesc,
|
||||||
RawObject * *arg0, Thread * thread);
|
RawObject * *arg0, Thread * thread);
|
||||||
invokestub entrypoint = reinterpret_cast<invokestub>(
|
invokestub volatile entrypoint = reinterpret_cast<invokestub>(
|
||||||
StubCode::InvokeDartCodeFromBytecode_entry()->EntryPoint());
|
StubCode::InvokeDartCodeFromBytecode_entry()->EntryPoint());
|
||||||
RawObject* result;
|
RawObject* volatile result;
|
||||||
Exit(thread, *FP, call_top + 1, *pc);
|
Exit(thread, *FP, call_top + 1, *pc);
|
||||||
{
|
{
|
||||||
InterpreterSetjmpBuffer buffer(this);
|
InterpreterSetjmpBuffer buffer(this);
|
||||||
|
@ -969,11 +969,13 @@ DART_NOINLINE bool Interpreter::ProcessInvocation(bool* invoked,
|
||||||
RawField* field = reinterpret_cast<RawField*>(function->ptr()->data_);
|
RawField* field = reinterpret_cast<RawField*>(function->ptr()->data_);
|
||||||
intptr_t offset_in_words = Smi::Value(field->ptr()->value_.offset_);
|
intptr_t offset_in_words = Smi::Value(field->ptr()->value_.offset_);
|
||||||
RawAbstractType* field_type = field->ptr()->type_;
|
RawAbstractType* field_type = field->ptr()->type_;
|
||||||
const classid_t cid =
|
classid_t cid;
|
||||||
field_type->GetClassId() == kTypeCid
|
if (field_type->GetClassId() == kTypeCid) {
|
||||||
? Smi::Value(reinterpret_cast<RawSmi*>(
|
cid = Smi::Value(reinterpret_cast<RawSmi*>(
|
||||||
Type::RawCast(field_type)->ptr()->type_class_id_))
|
Type::RawCast(field_type)->ptr()->type_class_id_));
|
||||||
: kIllegalCid; // Not really illegal, but not a Type to skip.
|
} else {
|
||||||
|
cid = kIllegalCid; // Not really illegal, but not a Type to skip.
|
||||||
|
}
|
||||||
// Perform type test of value if field type is not one of dynamic, object,
|
// Perform type test of value if field type is not one of dynamic, object,
|
||||||
// or void, and if the value is not null.
|
// or void, and if the value is not null.
|
||||||
RawObject* null_value = Object::null();
|
RawObject* null_value = Object::null();
|
||||||
|
|
|
@ -1592,8 +1592,8 @@ DART_FORCE_INLINE void Simulator::DecodeType01(Instr* instr) {
|
||||||
// Registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
|
// Registers rd, rn, rm, ra are encoded as rn, rm, rs, rd.
|
||||||
// Format(instr, "mls'cond's 'rn, 'rm, 'rs, 'rd");
|
// Format(instr, "mls'cond's 'rn, 'rm, 'rs, 'rd");
|
||||||
rd_val = get_register(rd);
|
rd_val = get_register(rd);
|
||||||
// fall through
|
|
||||||
}
|
}
|
||||||
|
/* Falls through */
|
||||||
case 0: {
|
case 0: {
|
||||||
// Registers rd, rn, rm are encoded as rn, rm, rs.
|
// Registers rd, rn, rm are encoded as rn, rm, rs.
|
||||||
// Format(instr, "mul'cond's 'rn, 'rm, 'rs");
|
// Format(instr, "mul'cond's 'rn, 'rm, 'rs");
|
||||||
|
@ -1650,6 +1650,7 @@ DART_FORCE_INLINE void Simulator::DecodeType01(Instr* instr) {
|
||||||
// umaal is only in ARMv6 and above.
|
// umaal is only in ARMv6 and above.
|
||||||
UnimplementedInstruction(instr);
|
UnimplementedInstruction(instr);
|
||||||
}
|
}
|
||||||
|
/* Falls through */
|
||||||
case 5:
|
case 5:
|
||||||
// Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
|
// Registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
|
||||||
// Format(instr, "umlal'cond's 'rd, 'rn, 'rm, 'rs");
|
// Format(instr, "umlal'cond's 'rd, 'rn, 'rm, 'rs");
|
||||||
|
|
Loading…
Reference in a new issue