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

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

Issue 10832126: Store pointer instead of reference to LocalVariable in ast and flow graph. (Closed) Base URL: http://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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 LocationSummary* LoadLocalComp::MakeLocationSummary() const { 122 LocationSummary* LoadLocalComp::MakeLocationSummary() const {
123 return LocationSummary::Make(0, 123 return LocationSummary::Make(0,
124 Location::RequiresRegister(), 124 Location::RequiresRegister(),
125 LocationSummary::kNoCall); 125 LocationSummary::kNoCall);
126 } 126 }
127 127
128 128
129 void LoadLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) { 129 void LoadLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
130 Register result = locs()->out().reg(); 130 Register result = locs()->out().reg();
131 __ movl(result, Address(EBP, local().index() * kWordSize)); 131 __ movl(result, Address(EBP, local()->index() * kWordSize));
132 } 132 }
133 133
134 134
135 LocationSummary* StoreLocalComp::MakeLocationSummary() const { 135 LocationSummary* StoreLocalComp::MakeLocationSummary() const {
136 return LocationSummary::Make(1, 136 return LocationSummary::Make(1,
137 Location::SameAsFirstInput(), 137 Location::SameAsFirstInput(),
138 LocationSummary::kNoCall); 138 LocationSummary::kNoCall);
139 } 139 }
140 140
141 141
142 void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) { 142 void StoreLocalComp::EmitNativeCode(FlowGraphCompiler* compiler) {
143 Register value = locs()->in(0).reg(); 143 Register value = locs()->in(0).reg();
144 Register result = locs()->out().reg(); 144 Register result = locs()->out().reg();
145 ASSERT(result == value); // Assert that register assignment is correct. 145 ASSERT(result == value); // Assert that register assignment is correct.
146 __ movl(Address(EBP, local().index() * kWordSize), value); 146 __ movl(Address(EBP, local()->index() * kWordSize), value);
147 } 147 }
148 148
149 149
150 LocationSummary* ConstantVal::MakeLocationSummary() const { 150 LocationSummary* ConstantVal::MakeLocationSummary() const {
151 return LocationSummary::Make(0, 151 return LocationSummary::Make(0,
152 Location::RequiresRegister(), 152 Location::RequiresRegister(),
153 LocationSummary::kNoCall); 153 LocationSummary::kNoCall);
154 } 154 }
155 155
156 156
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 // exception and stack trace variables. 1461 // exception and stack trace variables.
1462 void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) { 1462 void CatchEntryComp::EmitNativeCode(FlowGraphCompiler* compiler) {
1463 // Restore RSP from RBP as we are coming from a throw and the code for 1463 // Restore RSP from RBP as we are coming from a throw and the code for
1464 // popping arguments has not been run. 1464 // popping arguments has not been run.
1465 const intptr_t locals_space_size = compiler->StackSize() * kWordSize; 1465 const intptr_t locals_space_size = compiler->StackSize() * kWordSize;
1466 ASSERT(locals_space_size >= 0); 1466 ASSERT(locals_space_size >= 0);
1467 const intptr_t offset_size = 1467 const intptr_t offset_size =
1468 -locals_space_size + FlowGraphCompiler::kLocalsOffsetFromFP; 1468 -locals_space_size + FlowGraphCompiler::kLocalsOffsetFromFP;
1469 __ leal(ESP, Address(EBP, offset_size)); 1469 __ leal(ESP, Address(EBP, offset_size));
1470 1470
1471 ASSERT(!exception_var().is_captured()); 1471 ASSERT(!exception_var()->is_captured());
1472 ASSERT(!stacktrace_var().is_captured()); 1472 ASSERT(!stacktrace_var()->is_captured());
1473 __ movl(Address(EBP, exception_var().index() * kWordSize), 1473 __ movl(Address(EBP, exception_var()->index() * kWordSize),
1474 kExceptionObjectReg); 1474 kExceptionObjectReg);
1475 __ movl(Address(EBP, stacktrace_var().index() * kWordSize), 1475 __ movl(Address(EBP, stacktrace_var()->index() * kWordSize),
1476 kStackTraceObjectReg); 1476 kStackTraceObjectReg);
1477 } 1477 }
1478 1478
1479 1479
1480 LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const { 1480 LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const {
1481 const intptr_t kNumInputs = 0; 1481 const intptr_t kNumInputs = 0;
1482 const intptr_t kNumTemps = 0; 1482 const intptr_t kNumTemps = 0;
1483 // TODO(vegorov): spilling is required only on an infrequently executed path. 1483 // TODO(vegorov): spilling is required only on an infrequently executed path.
1484 LocationSummary* summary = 1484 LocationSummary* summary =
1485 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1485 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 ASSERT(locs()->out().reg() == EAX); 2196 ASSERT(locs()->out().reg() == EAX);
2197 __ CompareObject(locs()->out().reg(), compiler->bool_true()); 2197 __ CompareObject(locs()->out().reg(), compiler->bool_true());
2198 EmitBranchOnCondition(compiler, branch_condition); 2198 EmitBranchOnCondition(compiler, branch_condition);
2199 } 2199 }
2200 2200
2201 } // namespace dart 2201 } // namespace dart
2202 2202
2203 #undef __ 2203 #undef __
2204 2204
2205 #endif // defined TARGET_ARCH_X64 2205 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698