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

Side by Side Diff: src/arm/deoptimizer-arm.cc

Issue 6484025: Revert r6759. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 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
« no previous file with comments | « no previous file | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 PrintF("[forced deoptimization: "); 117 PrintF("[forced deoptimization: ");
118 function->PrintName(); 118 function->PrintName();
119 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function)); 119 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function));
120 } 120 }
121 } 121 }
122 122
123 123
124 void Deoptimizer::PatchStackCheckCodeAt(Address pc_after, 124 void Deoptimizer::PatchStackCheckCodeAt(Address pc_after,
125 Code* check_code, 125 Code* check_code,
126 Code* replacement_code) { 126 Code* replacement_code) {
127 const int kInstrSize = Assembler::kInstrSize; 127 UNIMPLEMENTED();
128 // The call of the stack guard check has the following form:
129 // e1 5d 00 0c cmp sp, <limit>
130 // 2a 00 00 01 bcs ok
131 // e5 9f c? ?? ldr ip, [pc, <stack guard address>]
132 // e1 2f ff 3c blx ip
133 ASSERT(Memory::int32_at(pc_after - kInstrSize) ==
134 (al | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | ip.code()));
135 ASSERT(Assembler::IsLdrPcImmediateOffset(
136 Assembler::instr_at(pc_after - 2 * kInstrSize)));
137
138 // We patch the code to the following form:
139 // e1 5d 00 0c cmp sp, <limit>
140 // e1 a0 00 00 mov r0, r0 (NOP)
141 // e5 9f c? ?? ldr ip, [pc, <on-stack replacement address>]
142 // e1 2f ff 3c blx ip
143 // and overwrite the constant containing the
144 // address of the stack check stub.
145
146 // Replace conditional jump with NOP.
147 CodePatcher patcher(pc_after - 3 * kInstrSize, 1);
148 patcher.masm()->nop();
149
150 // Replace the stack check address in the constant pool
151 // with the entry address of the replacement code.
152 uint32_t stack_check_address_offset = Memory::uint16_at(pc_after -
153 2 * kInstrSize) & 0xfff;
154 Address stack_check_address_pointer = pc_after + stack_check_address_offset;
155 ASSERT(Memory::uint32_at(stack_check_address_pointer) ==
156 reinterpret_cast<uint32_t>(check_code->entry()));
157 Memory::uint32_at(stack_check_address_pointer) =
158 reinterpret_cast<uint32_t>(replacement_code->entry());
159 } 128 }
160 129
161 130
162 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after, 131 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after,
163 Code* check_code, 132 Code* check_code,
164 Code* replacement_code) { 133 Code* replacement_code) {
165 const int kInstrSize = Assembler::kInstrSize; 134 UNIMPLEMENTED();
166 ASSERT(Memory::uint32_at(pc_after - kInstrSize) == 0xe12fff3c);
167 ASSERT(Memory::uint8_at(pc_after - kInstrSize - 1) == 0xe5);
168 ASSERT(Memory::uint8_at(pc_after - kInstrSize - 2) == 0x9f);
169
170 // Replace NOP wi th conditional jump.
171 CodePatcher patcher(pc_after - 3 * kInstrSize, 1);
172 patcher.masm()->b(+4, cs);
173
174 // Replace the stack check address in the constant pool
175 // with the entry address of the replacement code.
176 uint32_t stack_check_address_offset = Memory::uint16_at(pc_after -
177 2 * kInstrSize) & 0xfff;
178 Address stack_check_address_pointer = pc_after + stack_check_address_offset;
179 ASSERT(Memory::uint32_at(stack_check_address_pointer) ==
180 reinterpret_cast<uint32_t>(replacement_code->entry()));
181 Memory::uint32_at(stack_check_address_pointer) =
182 reinterpret_cast<uint32_t>(check_code->entry());
183 } 135 }
184 136
185 137
186 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { 138 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) {
187 ByteArray* translations = data->TranslationByteArray(); 139 ByteArray* translations = data->TranslationByteArray();
188 int length = data->DeoptCount(); 140 int length = data->DeoptCount();
189 for (int i = 0; i < length; i++) { 141 for (int i = 0; i < length; i++) {
190 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { 142 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) {
191 TranslationIterator it(translations, data->TranslationIndex(i)->value()); 143 TranslationIterator it(translations, data->TranslationIndex(i)->value());
192 int value = it.Next(); 144 int value = it.Next();
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 __ push(ip); 641 __ push(ip);
690 __ b(&done); 642 __ b(&done);
691 ASSERT(masm()->pc_offset() - start == table_entry_size_); 643 ASSERT(masm()->pc_offset() - start == table_entry_size_);
692 } 644 }
693 __ bind(&done); 645 __ bind(&done);
694 } 646 }
695 647
696 #undef __ 648 #undef __
697 649
698 } } // namespace v8::internal 650 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698