OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 const Bytecode::Opcode eq_op = | 511 const Bytecode::Opcode eq_op = |
512 needs_number_check() ? Bytecode::kIfEqStrictNum : Bytecode::kIfEqStrict; | 512 needs_number_check() ? Bytecode::kIfEqStrictNum : Bytecode::kIfEqStrict; |
513 const Bytecode::Opcode ne_op = | 513 const Bytecode::Opcode ne_op = |
514 needs_number_check() ? Bytecode::kIfNeStrictNum : Bytecode::kIfNeStrict; | 514 needs_number_check() ? Bytecode::kIfNeStrictNum : Bytecode::kIfNeStrict; |
515 __ Emit(Bytecode::Encode((comparison == Token::kEQ_STRICT) ? eq_op : ne_op, | 515 __ Emit(Bytecode::Encode((comparison == Token::kEQ_STRICT) ? eq_op : ne_op, |
516 locs()->in(0).reg(), locs()->in(1).reg())); | 516 locs()->in(0).reg(), locs()->in(1).reg())); |
517 } | 517 } |
518 | 518 |
519 if (needs_number_check() && token_pos().IsReal()) { | 519 if (needs_number_check() && token_pos().IsReal()) { |
520 compiler->RecordSafepoint(locs()); | 520 compiler->RecordSafepoint(locs()); |
521 compiler->AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 521 compiler->AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, deopt_id_, |
522 Thread::kNoDeoptId, token_pos()); | 522 token_pos()); |
523 } | 523 } |
524 | 524 |
525 return condition; | 525 return condition; |
526 } | 526 } |
527 | 527 |
528 | 528 |
529 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 529 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
530 BranchInstr* branch) { | 530 BranchInstr* branch) { |
531 ASSERT((kind() == Token::kEQ_STRICT) || (kind() == Token::kNE_STRICT)); | 531 ASSERT((kind() == Token::kEQ_STRICT) || (kind() == Token::kNE_STRICT)); |
532 | 532 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 const intptr_t kArgumentCount = 1; | 916 const intptr_t kArgumentCount = 1; |
917 const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( | 917 const Array& arguments_descriptor = Array::Handle(ArgumentsDescriptor::New( |
918 kTypeArgsLen, kArgumentCount, Object::null_array())); | 918 kTypeArgsLen, kArgumentCount, Object::null_array())); |
919 __ PushConstant(CallFunction()); | 919 __ PushConstant(CallFunction()); |
920 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); | 920 const intptr_t argdesc_kidx = __ AddConstant(arguments_descriptor); |
921 __ StaticCall(kArgumentCount, argdesc_kidx); | 921 __ StaticCall(kArgumentCount, argdesc_kidx); |
922 // Note: can't use RecordAfterCall here because | 922 // Note: can't use RecordAfterCall here because |
923 // StringInterpolateInstr::ArgumentCount() is 0. However | 923 // StringInterpolateInstr::ArgumentCount() is 0. However |
924 // internally it does a call with 1 argument which needs to | 924 // internally it does a call with 1 argument which needs to |
925 // be reflected in the lazy deoptimization environment. | 925 // be reflected in the lazy deoptimization environment. |
| 926 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), |
| 927 token_pos()); |
926 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, | 928 compiler->RecordAfterCallHelper(token_pos(), deopt_id(), kArgumentCount, |
927 FlowGraphCompiler::kHasResult, locs()); | 929 FlowGraphCompiler::kHasResult, locs()); |
928 if (compiler->is_optimizing()) { | 930 if (compiler->is_optimizing()) { |
929 __ PopLocal(locs()->out(0).reg()); | 931 __ PopLocal(locs()->out(0).reg()); |
930 } | 932 } |
931 } | 933 } |
932 | 934 |
933 | 935 |
934 EMIT_NATIVE_CODE(NativeCall, | 936 EMIT_NATIVE_CODE(NativeCall, |
935 0, | 937 0, |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), | 1285 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id(), |
1284 token_pos()); | 1286 token_pos()); |
1285 if (compiler->is_optimizing()) { | 1287 if (compiler->is_optimizing()) { |
1286 __ PopLocal(locs()->out(0).reg()); | 1288 __ PopLocal(locs()->out(0).reg()); |
1287 } | 1289 } |
1288 } | 1290 } |
1289 | 1291 |
1290 | 1292 |
1291 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1293 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1292 __ DebugStep(); | 1294 __ DebugStep(); |
1293 compiler->AddCurrentDescriptor(stub_kind_, Thread::kNoDeoptId, token_pos()); | 1295 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); |
1294 } | 1296 } |
1295 | 1297 |
1296 | 1298 |
1297 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1299 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1298 if (!compiler->CanFallThroughTo(normal_entry())) { | 1300 if (!compiler->CanFallThroughTo(normal_entry())) { |
1299 __ Jump(compiler->GetJumpLabel(normal_entry())); | 1301 __ Jump(compiler->GetJumpLabel(normal_entry())); |
1300 } | 1302 } |
1301 } | 1303 } |
1302 | 1304 |
1303 | 1305 |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 } | 2078 } |
2077 __ IfULe(length, index); | 2079 __ IfULe(length, index); |
2078 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, | 2080 compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckArrayBound, |
2079 (generalized_ ? ICData::kGeneralized : 0) | | 2081 (generalized_ ? ICData::kGeneralized : 0) | |
2080 (licm_hoisted_ ? ICData::kHoisted : 0)); | 2082 (licm_hoisted_ ? ICData::kHoisted : 0)); |
2081 } | 2083 } |
2082 | 2084 |
2083 } // namespace dart | 2085 } // namespace dart |
2084 | 2086 |
2085 #endif // defined TARGET_ARCH_DBC | 2087 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |