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

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

Issue 70183010: Fixes a couple problems with GC of unoptimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 Environment* current = deopt_env_; 54 Environment* current = deopt_env_;
55 55
56 // Emit all kMaterializeObject instructions describing objects to be 56 // Emit all kMaterializeObject instructions describing objects to be
57 // materialized on the deoptimization as a prefix to the deoptimization info. 57 // materialized on the deoptimization as a prefix to the deoptimization info.
58 EmitMaterializations(deopt_env_, builder); 58 EmitMaterializations(deopt_env_, builder);
59 59
60 // The real frame starts here. 60 // The real frame starts here.
61 builder->MarkFrameStart(); 61 builder->MarkFrameStart();
62 62
63 // Current PP, FP, and PC. 63 // Current PP, FP, and PC.
64 builder->AddPp(current->function(), slot_ix++); 64 builder->AddPp(current->code(), slot_ix++);
65 builder->AddCallerFp(slot_ix++); 65 builder->AddCallerFp(slot_ix++);
66 builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++); 66 builder->AddReturnAddress(current->code(), deopt_id(), slot_ix++);
67 67
68 // Callee's PC marker is not used anymore. Pass Function::null() to set to 0. 68 // Callee's PC marker is not used anymore. Pass Code::null() to set to 0.
69 builder->AddPcMarker(Function::Handle(), slot_ix++); 69 builder->AddPcMarker(Code::Handle(), slot_ix++);
70 70
71 // Emit all values that are needed for materialization as a part of the 71 // Emit all values that are needed for materialization as a part of the
72 // expression stack for the bottom-most frame. This guarantees that GC 72 // expression stack for the bottom-most frame. This guarantees that GC
73 // will be able to find them during materialization. 73 // will be able to find them during materialization.
74 slot_ix = builder->EmitMaterializationArguments(slot_ix); 74 slot_ix = builder->EmitMaterializationArguments(slot_ix);
75 75
76 // For the innermost environment, set outgoing arguments and the locals. 76 // For the innermost environment, set outgoing arguments and the locals.
77 for (intptr_t i = current->Length() - 1; 77 for (intptr_t i = current->Length() - 1;
78 i >= current->fixed_parameter_count(); 78 i >= current->fixed_parameter_count();
79 i--) { 79 i--) {
80 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); 80 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
81 } 81 }
82 82
83 Environment* previous = current; 83 Environment* previous = current;
84 current = current->outer(); 84 current = current->outer();
85 while (current != NULL) { 85 while (current != NULL) {
86 // PP, FP, and PC. 86 // PP, FP, and PC.
87 builder->AddPp(current->function(), slot_ix++); 87 builder->AddPp(current->code(), slot_ix++);
88 builder->AddCallerFp(slot_ix++); 88 builder->AddCallerFp(slot_ix++);
89 89
90 // For any outer environment the deopt id is that of the call instruction 90 // For any outer environment the deopt id is that of the call instruction
91 // which is recorded in the outer environment. 91 // which is recorded in the outer environment.
92 builder->AddReturnAddress(current->function(), 92 builder->AddReturnAddress(current->code(),
93 Isolate::ToDeoptAfter(current->deopt_id()), 93 Isolate::ToDeoptAfter(current->deopt_id()),
94 slot_ix++); 94 slot_ix++);
95 95
96 // PC marker. 96 // PC marker.
97 builder->AddPcMarker(previous->function(), slot_ix++); 97 builder->AddPcMarker(previous->code(), slot_ix++);
98 98
99 // The values of outgoing arguments can be changed from the inlined call so 99 // The values of outgoing arguments can be changed from the inlined call so
100 // we must read them from the previous environment. 100 // we must read them from the previous environment.
101 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { 101 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
102 builder->AddCopy(previous->ValueAt(i), 102 builder->AddCopy(previous->ValueAt(i),
103 previous->LocationAt(i), 103 previous->LocationAt(i),
104 slot_ix++); 104 slot_ix++);
105 } 105 }
106 106
107 // Set the locals, note that outgoing arguments are not in the environment. 107 // Set the locals, note that outgoing arguments are not in the environment.
(...skipping 11 matching lines...) Expand all
119 } 119 }
120 // The previous pointer is now the outermost environment. 120 // The previous pointer is now the outermost environment.
121 ASSERT(previous != NULL); 121 ASSERT(previous != NULL);
122 122
123 // For the outermost environment, set caller PC, caller PP, and caller FP. 123 // For the outermost environment, set caller PC, caller PP, and caller FP.
124 builder->AddCallerPp(slot_ix++); 124 builder->AddCallerPp(slot_ix++);
125 builder->AddCallerFp(slot_ix++); 125 builder->AddCallerFp(slot_ix++);
126 builder->AddCallerPc(slot_ix++); 126 builder->AddCallerPc(slot_ix++);
127 127
128 // PC marker. 128 // PC marker.
129 builder->AddPcMarker(previous->function(), slot_ix++); 129 builder->AddPcMarker(previous->code(), slot_ix++);
130 130
131 // For the outermost environment, set the incoming arguments. 131 // For the outermost environment, set the incoming arguments.
132 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { 132 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
133 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); 133 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++);
134 } 134 }
135 135
136 const DeoptInfo& deopt_info = 136 const DeoptInfo& deopt_info =
137 DeoptInfo::Handle(builder->CreateDeoptInfo(deopt_table)); 137 DeoptInfo::Handle(builder->CreateDeoptInfo(deopt_table));
138 return deopt_info.raw(); 138 return deopt_info.raw();
139 } 139 }
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 __ sll(T1, T3, 2); 1399 __ sll(T1, T3, 2);
1400 __ addu(T1, T2, T1); 1400 __ addu(T1, T2, T1);
1401 __ lw(T0, FieldAddress(T1, base + kWordSize)); 1401 __ lw(T0, FieldAddress(T1, base + kWordSize));
1402 __ lw(T1, FieldAddress(T0, Function::code_offset())); 1402 __ lw(T1, FieldAddress(T0, Function::code_offset()));
1403 if (FLAG_collect_code) { 1403 if (FLAG_collect_code) {
1404 // If we are collecting code, the code object may be null. 1404 // If we are collecting code, the code object may be null.
1405 Label is_compiled; 1405 Label is_compiled;
1406 __ BranchNotEqual(T1, reinterpret_cast<int32_t>(Object::null()), 1406 __ BranchNotEqual(T1, reinterpret_cast<int32_t>(Object::null()),
1407 &is_compiled); 1407 &is_compiled);
1408 __ BranchLink(&StubCode::CompileFunctionRuntimeCallLabel()); 1408 __ BranchLink(&StubCode::CompileFunctionRuntimeCallLabel());
1409 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1410 Isolate::kNoDeoptId,
1411 token_pos);
1412 RecordSafepoint(locs);
1409 __ lw(T1, FieldAddress(T0, Function::code_offset())); 1413 __ lw(T1, FieldAddress(T0, Function::code_offset()));
1410 __ Bind(&is_compiled); 1414 __ Bind(&is_compiled);
1411 } 1415 }
1412 __ lw(T0, FieldAddress(T1, Code::instructions_offset())); 1416 __ lw(T0, FieldAddress(T1, Code::instructions_offset()));
1413 __ LoadObject(S5, ic_data); 1417 __ LoadObject(S5, ic_data);
1414 __ LoadObject(S4, arguments_descriptor); 1418 __ LoadObject(S4, arguments_descriptor);
1415 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag); 1419 __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
1416 __ jalr(T0); 1420 __ jalr(T0);
1417 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); 1421 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos);
1418 RecordSafepoint(locs); 1422 RecordSafepoint(locs);
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 __ AddImmediate(SP, kDoubleSize); 1932 __ AddImmediate(SP, kDoubleSize);
1929 } 1933 }
1930 1934
1931 1935
1932 #undef __ 1936 #undef __
1933 1937
1934 1938
1935 } // namespace dart 1939 } // namespace dart
1936 1940
1937 #endif // defined TARGET_ARCH_MIPS 1941 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698