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

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

Issue 10825282: Put PushArgument into the environment instead of raw values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 30 matching lines...) Expand all
41 // We have a deoptimization environment, we have to tear down the 41 // We have a deoptimization environment, we have to tear down the
42 // optimized frame and recreate a non-optimized one. 42 // optimized frame and recreate a non-optimized one.
43 const intptr_t fixed_parameter_count = 43 const intptr_t fixed_parameter_count =
44 deoptimization_env_->fixed_parameter_count(); 44 deoptimization_env_->fixed_parameter_count();
45 45
46 // 1. Set the stack pointer to the top of the non-optimized frame. 46 // 1. Set the stack pointer to the top of the non-optimized frame.
47 const GrowableArray<Value*>& values = deoptimization_env_->values(); 47 const GrowableArray<Value*>& values = deoptimization_env_->values();
48 const intptr_t local_slot_count = values.length() - fixed_parameter_count; 48 const intptr_t local_slot_count = values.length() - fixed_parameter_count;
49 const intptr_t top_offset = 49 const intptr_t top_offset =
50 ParsedFunction::kFirstLocalSlotIndex - (local_slot_count - 1); 50 ParsedFunction::kFirstLocalSlotIndex - (local_slot_count - 1);
51
51 __ leaq(RSP, Address(RBP, top_offset * kWordSize)); 52 __ leaq(RSP, Address(RBP, top_offset * kWordSize));
52 53
53 // 2. Build and emit a parallel move representing the frame translation. 54 // 2. Build and emit a parallel move representing the frame translation.
55 intptr_t height = compiler->StackSize();
54 ParallelMoveInstr* move = new ParallelMoveInstr(); 56 ParallelMoveInstr* move = new ParallelMoveInstr();
55 for (intptr_t i = 0; i < values.length(); i++) { 57 for (intptr_t i = 0; i < values.length(); i++) {
56 Location destination = Location::StackSlot(i - fixed_parameter_count); 58 Location destination = Location::StackSlot(i - fixed_parameter_count);
57 Location source = deoptimization_env_->LocationAt(i); 59 Location source = deoptimization_env_->LocationAt(i);
58 if (source.IsInvalid()) { 60 if (source.IsInvalid()) {
59 ASSERT(values[i]->IsConstant()); 61 Value* value = values[i];
60 source = Location::Constant(values[i]->AsConstant()->value()); 62 if (value->IsConstant()) {
63 source = Location::Constant(value->AsConstant()->value());
64 } else {
65 ASSERT(value->IsUse() &&
66 value->AsUse()->definition()->IsPushArgument());
67 source = Location::StackSlot(height++);
68 }
61 } 69 }
62 move->AddMove(destination, source); 70 move->AddMove(destination, source);
63 } 71 }
64 compiler->parallel_move_resolver()->EmitNativeCode(move); 72 compiler->parallel_move_resolver()->EmitNativeCode(move);
65 } 73 }
66 74
67 if (compiler->IsLeaf()) { 75 if (compiler->IsLeaf()) {
68 __ Comment("Leaf method, lazy PC marker setup"); 76 __ Comment("Leaf method, lazy PC marker setup");
69 Label L; 77 Label L;
70 __ call(&L); 78 __ call(&L);
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { 1223 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
1216 __ Exchange(mem1, mem2); 1224 __ Exchange(mem1, mem2);
1217 } 1225 }
1218 1226
1219 1227
1220 #undef __ 1228 #undef __
1221 1229
1222 } // namespace dart 1230 } // namespace dart
1223 1231
1224 #endif // defined TARGET_ARCH_X64 1232 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698