Chromium Code Reviews| Index: runtime/vm/simulator_dbc.cc |
| diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc |
| index ffe4e9285c7f38ef50cbac33b65e2daccf027b2b..ca16cd533b8ce5930ec7278145a38067ccd3f00c 100644 |
| --- a/runtime/vm/simulator_dbc.cc |
| +++ b/runtime/vm/simulator_dbc.cc |
| @@ -754,6 +754,21 @@ static DART_NOINLINE bool InvokeNativeWrapper( |
| #define DECLARE_A_X int32_t rD; USE(rD) |
| #define DECODE_A_X rD = (static_cast<int32_t>(op) >> Bytecode::kDShift); |
| +// If the following instruction is a call, extract the icdata from the |
| +// instruction and increment. |
| +#define SMI_FASTPATH_ICDATA_INC \ |
| + if ((FLAG_optimization_counter_threshold >= 0) && \ |
| + Bytecode::IsCallOpcode(*pc)) { \ |
|
Vyacheslav Egorov (Google)
2016/05/31 14:55:44
I think we should mandate that the next bytecode m
zra
2016/05/31 16:33:12
I'll make it mandatory in release builds, but opti
Vyacheslav Egorov (Google)
2016/05/31 16:53:07
I am concerned that we will be unit testing the im
|
| + const uint16_t kidx = Bytecode::DecodeD(*pc); \ |
| + const RawICData* icdata = RAW_CAST(ICData, LOAD_CONSTANT(kidx)); \ |
| + RawObject** data = icdata->ptr()->ic_data_->ptr()->data(); \ |
| + const intptr_t count_offset = ICData::CountIndexFor(2); \ |
| + const intptr_t raw_smi_old = \ |
| + reinterpret_cast<intptr_t>(data[count_offset]); \ |
| + const intptr_t raw_smi_new = raw_smi_old + Smi::RawValue(1); \ |
| + *reinterpret_cast<intptr_t*>(&data[count_offset]) = raw_smi_new; \ |
| + } \ |
| + |
| // Declare bytecode handler for a smi operation (e.g. AddTOS) with the |
| // given result type and the given behavior specified as a function |
| // that takes left and right operands and result slot and returns |
| @@ -764,6 +779,7 @@ static DART_NOINLINE bool InvokeNativeWrapper( |
| const intptr_t rhs = reinterpret_cast<intptr_t>(SP[-0]); \ |
| ResultT* slot = reinterpret_cast<ResultT*>(SP - 1); \ |
| if (LIKELY(AreBothSmis(lhs, rhs) && !Func(lhs, rhs, slot))) { \ |
| + SMI_FASTPATH_ICDATA_INC; \ |
| /* Fast path succeeded. Skip the generic call that follows. */ \ |
| pc++; \ |
| /* We dropped 2 arguments and push result */ \ |