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

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

Issue 9265004: Support inlining at call-sites with mismatched number of arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: finished implementation, extended tests, ported to x64&arm Created 8 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
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 Translation* translation) { 472 Translation* translation) {
473 if (environment == NULL) return; 473 if (environment == NULL) return;
474 474
475 // The translation includes one command per value in the environment. 475 // The translation includes one command per value in the environment.
476 int translation_size = environment->values()->length(); 476 int translation_size = environment->values()->length();
477 // The output frame height does not include the parameters. 477 // The output frame height does not include the parameters.
478 int height = translation_size - environment->parameter_count(); 478 int height = translation_size - environment->parameter_count();
479 479
480 WriteTranslation(environment->outer(), translation); 480 WriteTranslation(environment->outer(), translation);
481 int closure_id = DefineDeoptimizationLiteral(environment->closure()); 481 int closure_id = DefineDeoptimizationLiteral(environment->closure());
482 translation->BeginFrame(environment->ast_id(), closure_id, height); 482 if (environment->is_arguments_adaptor()) {
483 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size);
484 } else {
485 translation->BeginJSFrame(environment->ast_id(), closure_id, height);
486 }
483 for (int i = 0; i < translation_size; ++i) { 487 for (int i = 0; i < translation_size; ++i) {
484 LOperand* value = environment->values()->at(i); 488 LOperand* value = environment->values()->at(i);
485 // spilled_registers_ and spilled_double_registers_ are either 489 // spilled_registers_ and spilled_double_registers_ are either
486 // both NULL or both set. 490 // both NULL or both set.
487 if (environment->spilled_registers() != NULL && value != NULL) { 491 if (environment->spilled_registers() != NULL && value != NULL) {
488 if (value->IsRegister() && 492 if (value->IsRegister() &&
489 environment->spilled_registers()[value->index()] != NULL) { 493 environment->spilled_registers()[value->index()] != NULL) {
490 translation->MarkDuplicate(); 494 translation->MarkDuplicate();
491 AddToTranslation(translation, 495 AddToTranslation(translation,
492 environment->spilled_registers()[value->index()], 496 environment->spilled_registers()[value->index()],
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 // Layout of the environment: 609 // Layout of the environment:
606 // 0 ..................................................... size-1 610 // 0 ..................................................... size-1
607 // [parameters] [locals] [expression stack including arguments] 611 // [parameters] [locals] [expression stack including arguments]
608 612
609 // Layout of the translation: 613 // Layout of the translation:
610 // 0 ........................................................ size - 1 + 4 614 // 0 ........................................................ size - 1 + 4
611 // [expression stack including arguments] [locals] [4 words] [parameters] 615 // [expression stack including arguments] [locals] [4 words] [parameters]
612 // |>------------ translation_size ------------<| 616 // |>------------ translation_size ------------<|
613 617
614 int frame_count = 0; 618 int frame_count = 0;
619 int jsframe_count = 0;
615 for (LEnvironment* e = environment; e != NULL; e = e->outer()) { 620 for (LEnvironment* e = environment; e != NULL; e = e->outer()) {
616 ++frame_count; 621 ++frame_count;
622 if (!e->is_arguments_adaptor()) {
623 ++jsframe_count;
624 }
617 } 625 }
618 Translation translation(&translations_, frame_count); 626 Translation translation(&translations_, frame_count, jsframe_count);
619 WriteTranslation(environment, &translation); 627 WriteTranslation(environment, &translation);
620 int deoptimization_index = deoptimizations_.length(); 628 int deoptimization_index = deoptimizations_.length();
621 int pc_offset = masm()->pc_offset(); 629 int pc_offset = masm()->pc_offset();
622 environment->Register(deoptimization_index, 630 environment->Register(deoptimization_index,
623 translation.index(), 631 translation.index(),
624 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); 632 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1);
625 deoptimizations_.Add(environment); 633 deoptimizations_.Add(environment);
626 } 634 }
627 } 635 }
628 636
(...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4792 ASSERT(osr_pc_offset_ == -1); 4800 ASSERT(osr_pc_offset_ == -1);
4793 osr_pc_offset_ = masm()->pc_offset(); 4801 osr_pc_offset_ = masm()->pc_offset();
4794 } 4802 }
4795 4803
4796 4804
4797 4805
4798 4806
4799 #undef __ 4807 #undef __
4800 4808
4801 } } // namespace v8::internal 4809 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698