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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6243004: Add GenerateSafePointTable, CallCode and EmitGoto to lithium codegen on x64... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 332
333 // Deferred code is the last part of the instruction sequence. Mark 333 // Deferred code is the last part of the instruction sequence. Mark
334 // the generated code as done unless we bailed out. 334 // the generated code as done unless we bailed out.
335 if (!is_aborted()) status_ = DONE; 335 if (!is_aborted()) status_ = DONE;
336 return !is_aborted(); 336 return !is_aborted();
337 } 337 }
338 338
339 339
340 bool LCodeGen::GenerateSafepointTable() { 340 bool LCodeGen::GenerateSafepointTable() {
341 Abort("Unimplemented: %s", "GeneratePrologue"); 341 ASSERT(is_done());
342 return false; 342 safepoints_.Emit(masm(), StackSlotCount());
343 return !is_aborted();
343 } 344 }
344 345
345 346
346 Register LCodeGen::ToRegister(int index) const { 347 Register LCodeGen::ToRegister(int index) const {
347 return Register::FromAllocationIndex(index); 348 return Register::FromAllocationIndex(index);
348 } 349 }
349 350
350 351
351 XMMRegister LCodeGen::ToDoubleRegister(int index) const { 352 XMMRegister LCodeGen::ToDoubleRegister(int index) const {
352 return XMMRegister::FromAllocationIndex(index); 353 return XMMRegister::FromAllocationIndex(index);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 translation->StoreLiteral(src_index); 486 translation->StoreLiteral(src_index);
486 } else { 487 } else {
487 UNREACHABLE(); 488 UNREACHABLE();
488 } 489 }
489 } 490 }
490 491
491 492
492 void LCodeGen::CallCode(Handle<Code> code, 493 void LCodeGen::CallCode(Handle<Code> code,
493 RelocInfo::Mode mode, 494 RelocInfo::Mode mode,
494 LInstruction* instr) { 495 LInstruction* instr) {
495 Abort("Unimplemented: %s", "CallCode"); 496 if (instr != NULL) {
497 LPointerMap* pointers = instr->pointer_map();
498 RecordPosition(pointers->position());
499 __ call(code, mode);
500 RegisterLazyDeoptimization(instr);
501 } else {
502 LPointerMap no_pointers(0);
503 RecordPosition(no_pointers.position());
504 __ call(code, mode);
505 RecordSafepoint(&no_pointers, Safepoint::kNoDeoptimizationIndex);
506 }
507
508 // Signal that we don't inline smi code before these stubs in the
509 // optimizing code generator.
510 if (code->kind() == Code::TYPE_RECORDING_BINARY_OP_IC ||
511 code->kind() == Code::COMPARE_IC) {
512 __ nop();
513 }
496 } 514 }
497 515
498 516
499 void LCodeGen::CallRuntime(Runtime::Function* function, 517 void LCodeGen::CallRuntime(Runtime::Function* function,
500 int num_arguments, 518 int num_arguments,
501 LInstruction* instr) { 519 LInstruction* instr) {
502 Abort("Unimplemented: %s", "CallRuntime"); 520 Abort("Unimplemented: %s", "CallRuntime");
503 } 521 }
504 522
505 523
506 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) { 524 void LCodeGen::RegisterLazyDeoptimization(LInstruction* instr) {
507 // Create the environment to bailout to. If the call has side effects 525 // Create the environment to bailout to. If the call has side effects
508 // execution has to continue after the call otherwise execution can continue 526 // execution has to continue after the call otherwise execution can continue
509 // from a previous bailout point repeating the call. 527 // from a previous bailout point repeating the call.
510 LEnvironment* deoptimization_environment; 528 LEnvironment* deoptimization_environment;
511 if (instr->HasDeoptimizationEnvironment()) { 529 if (instr->HasDeoptimizationEnvironment()) {
512 deoptimization_environment = instr->deoptimization_environment(); 530 deoptimization_environment = instr->deoptimization_environment();
513 } else { 531 } else {
514 deoptimization_environment = instr->environment(); 532 deoptimization_environment = instr->environment();
515 } 533 }
516 534
517 RegisterEnvironmentForDeoptimization(deoptimization_environment); 535 RegisterEnvironmentForDeoptimization(deoptimization_environment);
518 RecordSafepoint(instr->pointer_map(), 536 RecordSafepoint(instr->pointer_map(),
519 deoptimization_environment->deoptimization_index()); 537 deoptimization_environment->deoptimization_index());
520 } 538 }
521 539
522 540
523 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) { 541 void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment) {
524 Abort("Unimplemented: %s", "RegisterEnvironmentForDeoptimization"); 542 // TODO(ricow).
543 // This method is intentionally left unimplemented and simply returns
544 // until we have the deoptimization support in.
545 return;
525 } 546 }
526 547
527 548
528 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { 549 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
529 Abort("Unimplemented: %s", "Deoptimiz"); 550 Abort("Unimplemented: %s", "Deoptimiz");
530 } 551 }
531 552
532 553
533 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { 554 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
534 int length = deoptimizations_.length(); 555 int length = deoptimizations_.length();
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 Abort("Unimplemented: %s", "EmitBranch"); 873 Abort("Unimplemented: %s", "EmitBranch");
853 } 874 }
854 875
855 876
856 void LCodeGen::DoBranch(LBranch* instr) { 877 void LCodeGen::DoBranch(LBranch* instr) {
857 Abort("Unimplemented: %s", "DoBranch"); 878 Abort("Unimplemented: %s", "DoBranch");
858 } 879 }
859 880
860 881
861 void LCodeGen::EmitGoto(int block, LDeferredCode* deferred_stack_check) { 882 void LCodeGen::EmitGoto(int block, LDeferredCode* deferred_stack_check) {
862 Abort("Unimplemented: %s", "EmitGoto"); 883 block = chunk_->LookupDestination(block);
884 int next_block = GetNextEmittedBlock(current_block_);
885 if (block != next_block) {
886 // Perform stack overflow check if this goto needs it before jumping.
887 if (deferred_stack_check != NULL) {
888 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
889 __ j(above_equal, chunk_->GetAssemblyLabel(block));
890 __ jmp(deferred_stack_check->entry());
891 deferred_stack_check->SetExit(chunk_->GetAssemblyLabel(block));
892 } else {
893 __ jmp(chunk_->GetAssemblyLabel(block));
894 }
895 }
863 } 896 }
864 897
865 898
866 void LCodeGen::DoDeferredStackCheck(LGoto* instr) { 899 void LCodeGen::DoDeferredStackCheck(LGoto* instr) {
867 Abort("Unimplemented: %s", "DoDeferredStackCheck"); 900 Abort("Unimplemented: %s", "DoDeferredStackCheck");
868 } 901 }
869 902
870 903
871 void LCodeGen::DoGoto(LGoto* instr) { 904 void LCodeGen::DoGoto(LGoto* instr) {
872 class DeferredStackCheck: public LDeferredCode { 905 class DeferredStackCheck: public LDeferredCode {
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 1499
1467 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 1500 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
1468 Abort("Unimplemented: %s", "DoOsrEntry"); 1501 Abort("Unimplemented: %s", "DoOsrEntry");
1469 } 1502 }
1470 1503
1471 #undef __ 1504 #undef __
1472 1505
1473 } } // namespace v8::internal 1506 } } // namespace v8::internal
1474 1507
1475 #endif // V8_TARGET_ARCH_X64 1508 #endif // V8_TARGET_ARCH_X64
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