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

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

Issue 7282033: Change return type of FrameDescription::GetFrameSize to avoid unneeded type casts. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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 | « src/ia32/deoptimizer-ia32.cc ('k') | 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 USE(node_id); 309 USE(node_id);
310 ASSERT(node_id == ast_id); 310 ASSERT(node_id == ast_id);
311 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator.Next())); 311 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator.Next()));
312 USE(function); 312 USE(function);
313 ASSERT(function == function_); 313 ASSERT(function == function_);
314 unsigned height = iterator.Next(); 314 unsigned height = iterator.Next();
315 unsigned height_in_bytes = height * kPointerSize; 315 unsigned height_in_bytes = height * kPointerSize;
316 USE(height_in_bytes); 316 USE(height_in_bytes);
317 317
318 unsigned fixed_size = ComputeFixedSize(function_); 318 unsigned fixed_size = ComputeFixedSize(function_);
319 unsigned input_frame_size = static_cast<unsigned>(input_->GetFrameSize()); 319 unsigned input_frame_size = input_->GetFrameSize();
320 ASSERT(fixed_size + height_in_bytes == input_frame_size); 320 ASSERT(fixed_size + height_in_bytes == input_frame_size);
321 321
322 unsigned stack_slot_size = optimized_code_->stack_slots() * kPointerSize; 322 unsigned stack_slot_size = optimized_code_->stack_slots() * kPointerSize;
323 unsigned outgoing_height = data->ArgumentsStackHeight(bailout_id)->value(); 323 unsigned outgoing_height = data->ArgumentsStackHeight(bailout_id)->value();
324 unsigned outgoing_size = outgoing_height * kPointerSize; 324 unsigned outgoing_size = outgoing_height * kPointerSize;
325 unsigned output_frame_size = fixed_size + stack_slot_size + outgoing_size; 325 unsigned output_frame_size = fixed_size + stack_slot_size + outgoing_size;
326 ASSERT(outgoing_size == 0); // OSR does not happen in the middle of a call. 326 ASSERT(outgoing_size == 0); // OSR does not happen in the middle of a call.
327 327
328 if (FLAG_trace_osr) { 328 if (FLAG_trace_osr) {
329 PrintF("[on-stack replacement: begin 0x%08" V8PRIxPTR " ", 329 PrintF("[on-stack replacement: begin 0x%08" V8PRIxPTR " ",
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 unsigned height_in_bytes = height * kPointerSize; 444 unsigned height_in_bytes = height * kPointerSize;
445 if (FLAG_trace_deopt) { 445 if (FLAG_trace_deopt) {
446 PrintF(" translating "); 446 PrintF(" translating ");
447 function->PrintName(); 447 function->PrintName();
448 PrintF(" => node=%d, height=%d\n", node_id, height_in_bytes); 448 PrintF(" => node=%d, height=%d\n", node_id, height_in_bytes);
449 } 449 }
450 450
451 // The 'fixed' part of the frame consists of the incoming parameters and 451 // The 'fixed' part of the frame consists of the incoming parameters and
452 // the part described by JavaScriptFrameConstants. 452 // the part described by JavaScriptFrameConstants.
453 unsigned fixed_frame_size = ComputeFixedSize(function); 453 unsigned fixed_frame_size = ComputeFixedSize(function);
454 unsigned input_frame_size = static_cast<unsigned>(input_->GetFrameSize()); 454 unsigned input_frame_size = input_->GetFrameSize();
455 unsigned output_frame_size = height_in_bytes + fixed_frame_size; 455 unsigned output_frame_size = height_in_bytes + fixed_frame_size;
456 456
457 // Allocate and store the output frame description. 457 // Allocate and store the output frame description.
458 FrameDescription* output_frame = 458 FrameDescription* output_frame =
459 new(output_frame_size) FrameDescription(output_frame_size, function); 459 new(output_frame_size) FrameDescription(output_frame_size, function);
460 #ifdef DEBUG 460 #ifdef DEBUG
461 output_frame->SetKind(Code::FUNCTION); 461 output_frame->SetKind(Code::FUNCTION);
462 #endif 462 #endif
463 463
464 bool is_bottommost = (0 == frame_index); 464 bool is_bottommost = (0 == frame_index);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 for (int i = 0; i < Register::kNumRegisters; i++) { 609 for (int i = 0; i < Register::kNumRegisters; i++) {
610 input_->SetRegister(i, i * 4); 610 input_->SetRegister(i, i * 4);
611 } 611 }
612 input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp())); 612 input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp()));
613 input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp())); 613 input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp()));
614 for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) { 614 for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) {
615 input_->SetDoubleRegister(i, 0.0); 615 input_->SetDoubleRegister(i, 0.0);
616 } 616 }
617 617
618 // Fill the frame content from the actual data on the frame. 618 // Fill the frame content from the actual data on the frame.
619 for (intptr_t i = 0; i < input_->GetFrameSize(); i += kPointerSize) { 619 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
620 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); 620 input_->SetFrameSlot(i, Memory::uint64_at(tos + i));
621 } 621 }
622 } 622 }
623 623
624 624
625 #define __ masm()-> 625 #define __ masm()->
626 626
627 void Deoptimizer::EntryGenerator::Generate() { 627 void Deoptimizer::EntryGenerator::Generate() {
628 GeneratePrologue(); 628 GeneratePrologue();
629 629
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 } 832 }
833 __ bind(&done); 833 __ bind(&done);
834 } 834 }
835 835
836 #undef __ 836 #undef __
837 837
838 838
839 } } // namespace v8::internal 839 } } // namespace v8::internal
840 840
841 #endif // V8_TARGET_ARCH_X64 841 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698