| Index: runtime/vm/intermediate_language_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_ia32.cc (revision 42168)
|
| +++ runtime/vm/intermediate_language_ia32.cc (working copy)
|
| @@ -23,6 +23,8 @@
|
| namespace dart {
|
|
|
| DECLARE_FLAG(bool, emit_edge_counters);
|
| +DECLARE_FLAG(bool, enable_asserts);
|
| +DECLARE_FLAG(bool, enable_type_checks);
|
| DECLARE_FLAG(int, optimization_counter_threshold);
|
| DECLARE_FLAG(bool, propagate_ic_data);
|
| DECLARE_FLAG(bool, use_osr);
|
| @@ -32,7 +34,7 @@
|
| // on the stack and return the result in a fixed register EAX.
|
| LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) {
|
| const intptr_t kNumInputs = 0;
|
| - const intptr_t kNumTemps= 0;
|
| + const intptr_t kNumTemps = 0;
|
| LocationSummary* result = new(isolate) LocationSummary(
|
| isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
|
| result->set_out(0, Location::RegisterLocation(EAX));
|
| @@ -43,7 +45,7 @@
|
| LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate,
|
| bool opt) const {
|
| const intptr_t kNumInputs = 1;
|
| - const intptr_t kNumTemps= 0;
|
| + const intptr_t kNumTemps = 0;
|
| LocationSummary* locs = new(isolate) LocationSummary(
|
| isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
|
| locs->set_in(0, Location::AnyOrConstant(value()));
|
| @@ -248,11 +250,18 @@
|
| // Call the runtime if the object is not bool::true or bool::false.
|
| ASSERT(locs->always_calls());
|
| Label done;
|
| - __ CompareObject(reg, Bool::True());
|
| - __ j(EQUAL, &done, Assembler::kNearJump);
|
| - __ CompareObject(reg, Bool::False());
|
| - __ j(EQUAL, &done, Assembler::kNearJump);
|
|
|
| + if (FLAG_enable_type_checks) {
|
| + __ CompareObject(reg, Bool::True());
|
| + __ j(EQUAL, &done, Assembler::kNearJump);
|
| + __ CompareObject(reg, Bool::False());
|
| + __ j(EQUAL, &done, Assembler::kNearJump);
|
| + } else {
|
| + ASSERT(FLAG_enable_asserts);
|
| + __ CompareObject(reg, Object::null_instance());
|
| + __ j(NOT_EQUAL, &done, Assembler::kNearJump);
|
| + }
|
| +
|
| __ pushl(reg); // Push the source object.
|
| compiler->GenerateRuntimeCall(token_pos,
|
| deopt_id,
|
|
|