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

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

Issue 1756403002: VM: Add smi fast path operations for precompiled code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 4 years, 9 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/raw_object.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/stack_frame.h" 5 #include "vm/stack_frame.h"
6 6
7 #include "platform/memory_sanitizer.h" 7 #include "platform/memory_sanitizer.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/deopt_instructions.h" 9 #include "vm/deopt_instructions.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 map = code.GetStackmap(pc() - entry, &maps, &map); 105 map = code.GetStackmap(pc() - entry, &maps, &map);
106 if (!map.IsNull()) { 106 if (!map.IsNull()) {
107 RawObject** first = reinterpret_cast<RawObject**>(sp()); 107 RawObject** first = reinterpret_cast<RawObject**>(sp());
108 RawObject** last = reinterpret_cast<RawObject**>( 108 RawObject** last = reinterpret_cast<RawObject**>(
109 fp() + (kFirstLocalSlotFromFp * kWordSize)); 109 fp() + (kFirstLocalSlotFromFp * kWordSize));
110 110
111 // A stack map is present in the code object, use the stack map to 111 // A stack map is present in the code object, use the stack map to
112 // visit frame slots which are marked as having objects. 112 // visit frame slots which are marked as having objects.
113 // 113 //
114 // The layout of the frame is (lower addresses to the right): 114 // The layout of the frame is (lower addresses to the right):
115 // | spill slots | outgoing arguments | saved registers | 115 // | spill slots | outgoing arguments | saved registers | slow-path args |
116 // |XXXXXXXXXXXXX|--------------------|XXXXXXXXXXXXXXXXX| 116 // |XXXXXXXXXXXXX|--------------------|XXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXX|
117 // 117 //
118 // The spill slots and any saved registers are described in the stack 118 // The spill slots and any saved registers are described in the stack
119 // map. The outgoing arguments are assumed to be tagged; the number 119 // map. The outgoing arguments are assumed to be tagged; the number
120 // of outgoing arguments is not explicitly tracked. 120 // of outgoing arguments is not explicitly tracked.
121 //
122 // TODO(kmillikin): This does not handle slow path calls with
123 // arguments, where the arguments are pushed after the live registers.
124 // Enable such calls.
125 intptr_t length = map.Length(); 121 intptr_t length = map.Length();
126 // Spill slots are at the 'bottom' of the frame. 122 // Spill slots are at the 'bottom' of the frame.
127 intptr_t spill_slot_count = length - map.RegisterBitCount(); 123 intptr_t spill_slot_count = length - map.SlowPathBitCount();
128 for (intptr_t bit = 0; bit < spill_slot_count; ++bit) { 124 for (intptr_t bit = 0; bit < spill_slot_count; ++bit) {
129 if (map.IsObject(bit)) { 125 if (map.IsObject(bit)) {
130 visitor->VisitPointer(last); 126 visitor->VisitPointer(last);
131 } 127 }
132 --last; 128 --last;
133 } 129 }
134 130
135 // The live registers at the 'top' of the frame comprise the rest of the 131 // The live registers at the 'top' of the frame comprise the rest of the
136 // stack map. 132 // stack map.
137 for (intptr_t bit = length - 1; bit >= spill_slot_count; --bit) { 133 for (intptr_t bit = length - 1; bit >= spill_slot_count; --bit) {
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { 490 if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
495 return (index - num_materializations_); 491 return (index - num_materializations_);
496 } 492 }
497 } 493 }
498 UNREACHABLE(); 494 UNREACHABLE();
499 return 0; 495 return 0;
500 } 496 }
501 497
502 498
503 } // namespace dart 499 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698