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

Side by Side Diff: runtime/vm/simulator_dbc.cc

Issue 2244313002: DBC: Fleshing out the polymorphic instance call instruction (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Cleanup Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <setjmp.h> // NOLINT 5 #include <setjmp.h> // NOLINT
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #if defined(TARGET_ARCH_DBC) 9 #if defined(TARGET_ARCH_DBC)
10 10
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 SimulatorHelpers::IncrementUsageCounter(FrameFunction(FP)); 1521 SimulatorHelpers::IncrementUsageCounter(FrameFunction(FP));
1522 InstanceCall2(thread, icdata, call_base, call_top, 1522 InstanceCall2(thread, icdata, call_base, call_top,
1523 &argdesc, &pp, &pc, &FP, &SP, 1523 &argdesc, &pp, &pc, &FP, &SP,
1524 true /* optimized */); 1524 true /* optimized */);
1525 } 1525 }
1526 1526
1527 DISPATCH(); 1527 DISPATCH();
1528 } 1528 }
1529 1529
1530 { 1530 {
1531 BYTECODE(PushPolymorphicInstanceCall, A_D);
1532 const uint8_t argc = rA;
1533 const intptr_t cids_length = rD;
1534 RawObject** args = SP - argc + 1;
1535 const intptr_t receiver_cid = SimulatorHelpers::GetClassId(args[0]);
1536 for (intptr_t i = 0; i < 2*cids_length; i+=2) {
1537 const intptr_t icdata_cid = Bytecode::DecodeD(*(pc + i));
1538 if (receiver_cid == icdata_cid) {
1539 RawFunction* target =
1540 RAW_CAST(Function, LOAD_CONSTANT(Bytecode::DecodeD(*(pc + i + 1))));
1541 *++SP = target;
1542 pc++;
1543 break;
1544 }
1545 }
1546 pc += 2 * cids_length;
1547 DISPATCH();
1548 }
1549
1550 {
1531 BYTECODE(NativeBootstrapCall, 0); 1551 BYTECODE(NativeBootstrapCall, 0);
1532 RawFunction* function = FrameFunction(FP); 1552 RawFunction* function = FrameFunction(FP);
1533 RawObject** incoming_args = 1553 RawObject** incoming_args =
1534 (function->ptr()->num_optional_parameters_ == 0) 1554 (function->ptr()->num_optional_parameters_ == 0)
1535 ? FrameArguments(FP, function->ptr()->num_fixed_parameters_) 1555 ? FrameArguments(FP, function->ptr()->num_fixed_parameters_)
1536 : FP; 1556 : FP;
1537 1557
1538 SimulatorBootstrapNativeCall native_target = 1558 SimulatorBootstrapNativeCall native_target =
1539 reinterpret_cast<SimulatorBootstrapNativeCall>(SP[-1]); 1559 reinterpret_cast<SimulatorBootstrapNativeCall>(SP[-1]);
1540 intptr_t argc_tag = reinterpret_cast<intptr_t>(SP[-0]); 1560 intptr_t argc_tag = reinterpret_cast<intptr_t>(SP[-0]);
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
3028 pc_ = pc; 3048 pc_ = pc;
3029 special_[kExceptionSpecialIndex] = raw_exception; 3049 special_[kExceptionSpecialIndex] = raw_exception;
3030 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3050 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3031 buf->Longjmp(); 3051 buf->Longjmp();
3032 UNREACHABLE(); 3052 UNREACHABLE();
3033 } 3053 }
3034 3054
3035 } // namespace dart 3055 } // namespace dart
3036 3056
3037 #endif // defined TARGET_ARCH_DBC 3057 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698