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

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

Issue 39973003: Merge bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: again Created 7 years, 1 month 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 | « src/ia32/codegen-ia32.cc ('k') | src/ia32/disasm-ia32.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { 195 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
196 input_->SetFrameSlot(i, Memory::uint32_at(tos + i)); 196 input_->SetFrameSlot(i, Memory::uint32_at(tos + i));
197 } 197 }
198 } 198 }
199 199
200 200
201 void Deoptimizer::SetPlatformCompiledStubRegisters( 201 void Deoptimizer::SetPlatformCompiledStubRegisters(
202 FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) { 202 FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
203 intptr_t handler = 203 intptr_t handler =
204 reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_); 204 reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
205 int params = descriptor->register_param_count_; 205 int params = descriptor->environment_length();
206 if (descriptor->stack_parameter_count_ != NULL) {
207 params++;
208 }
209 output_frame->SetRegister(eax.code(), params); 206 output_frame->SetRegister(eax.code(), params);
210 output_frame->SetRegister(ebx.code(), handler); 207 output_frame->SetRegister(ebx.code(), handler);
211 } 208 }
212 209
213 210
214 void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) { 211 void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) {
215 if (!CpuFeatures::IsSupported(SSE2)) return; 212 if (!CpuFeatures::IsSupported(SSE2)) return;
216 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { 213 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
217 double double_value = input_->GetDoubleRegister(i); 214 double double_value = input_->GetDoubleRegister(i);
218 output_frame->SetDoubleRegister(i, double_value); 215 output_frame->SetDoubleRegister(i, double_value);
(...skipping 24 matching lines...) Expand all
243 const int kNumberOfRegisters = Register::kNumRegisters; 240 const int kNumberOfRegisters = Register::kNumRegisters;
244 241
245 const int kDoubleRegsSize = kDoubleSize * 242 const int kDoubleRegsSize = kDoubleSize *
246 XMMRegister::kNumAllocatableRegisters; 243 XMMRegister::kNumAllocatableRegisters;
247 __ sub(esp, Immediate(kDoubleRegsSize)); 244 __ sub(esp, Immediate(kDoubleRegsSize));
248 if (CpuFeatures::IsSupported(SSE2)) { 245 if (CpuFeatures::IsSupported(SSE2)) {
249 CpuFeatureScope scope(masm(), SSE2); 246 CpuFeatureScope scope(masm(), SSE2);
250 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { 247 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
251 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); 248 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i);
252 int offset = i * kDoubleSize; 249 int offset = i * kDoubleSize;
253 __ movdbl(Operand(esp, offset), xmm_reg); 250 __ movsd(Operand(esp, offset), xmm_reg);
254 } 251 }
255 } 252 }
256 253
257 __ pushad(); 254 __ pushad();
258 255
259 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + 256 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize +
260 kDoubleRegsSize; 257 kDoubleRegsSize;
261 258
262 // Get the bailout id from the stack. 259 // Get the bailout id from the stack.
263 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); 260 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 __ pop(Operand(ebx, offset)); 292 __ pop(Operand(ebx, offset));
296 } 293 }
297 294
298 int double_regs_offset = FrameDescription::double_registers_offset(); 295 int double_regs_offset = FrameDescription::double_registers_offset();
299 if (CpuFeatures::IsSupported(SSE2)) { 296 if (CpuFeatures::IsSupported(SSE2)) {
300 CpuFeatureScope scope(masm(), SSE2); 297 CpuFeatureScope scope(masm(), SSE2);
301 // Fill in the double input registers. 298 // Fill in the double input registers.
302 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { 299 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
303 int dst_offset = i * kDoubleSize + double_regs_offset; 300 int dst_offset = i * kDoubleSize + double_regs_offset;
304 int src_offset = i * kDoubleSize; 301 int src_offset = i * kDoubleSize;
305 __ movdbl(xmm0, Operand(esp, src_offset)); 302 __ movsd(xmm0, Operand(esp, src_offset));
306 __ movdbl(Operand(ebx, dst_offset), xmm0); 303 __ movsd(Operand(ebx, dst_offset), xmm0);
307 } 304 }
308 } 305 }
309 306
310 // Clear FPU all exceptions. 307 // Clear FPU all exceptions.
311 // TODO(ulan): Find out why the TOP register is not zero here in some cases, 308 // TODO(ulan): Find out why the TOP register is not zero here in some cases,
312 // and check that the generated code never deoptimizes with unbalanced stack. 309 // and check that the generated code never deoptimizes with unbalanced stack.
313 __ fnclex(); 310 __ fnclex();
314 311
315 // Remove the bailout id, return address and the double registers. 312 // Remove the bailout id, return address and the double registers.
316 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); 313 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 __ bind(&outer_loop_header); 378 __ bind(&outer_loop_header);
382 __ cmp(eax, edx); 379 __ cmp(eax, edx);
383 __ j(below, &outer_push_loop); 380 __ j(below, &outer_push_loop);
384 381
385 // In case of a failed STUB, we have to restore the XMM registers. 382 // In case of a failed STUB, we have to restore the XMM registers.
386 if (CpuFeatures::IsSupported(SSE2)) { 383 if (CpuFeatures::IsSupported(SSE2)) {
387 CpuFeatureScope scope(masm(), SSE2); 384 CpuFeatureScope scope(masm(), SSE2);
388 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { 385 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) {
389 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); 386 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i);
390 int src_offset = i * kDoubleSize + double_regs_offset; 387 int src_offset = i * kDoubleSize + double_regs_offset;
391 __ movdbl(xmm_reg, Operand(ebx, src_offset)); 388 __ movsd(xmm_reg, Operand(ebx, src_offset));
392 } 389 }
393 } 390 }
394 391
395 // Push state, pc, and continuation from the last output frame. 392 // Push state, pc, and continuation from the last output frame.
396 __ push(Operand(ebx, FrameDescription::state_offset())); 393 __ push(Operand(ebx, FrameDescription::state_offset()));
397 __ push(Operand(ebx, FrameDescription::pc_offset())); 394 __ push(Operand(ebx, FrameDescription::pc_offset()));
398 __ push(Operand(ebx, FrameDescription::continuation_offset())); 395 __ push(Operand(ebx, FrameDescription::continuation_offset()));
399 396
400 397
401 // Push the registers from the last output frame. 398 // Push the registers from the last output frame.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 SetFrameSlot(offset, value); 432 SetFrameSlot(offset, value);
436 } 433 }
437 434
438 435
439 #undef __ 436 #undef __
440 437
441 438
442 } } // namespace v8::internal 439 } } // namespace v8::internal
443 440
444 #endif // V8_TARGET_ARCH_IA32 441 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698