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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 Translation* translation) { 387 Translation* translation) {
388 if (environment == NULL) return; 388 if (environment == NULL) return;
389 389
390 // The translation includes one command per value in the environment. 390 // The translation includes one command per value in the environment.
391 int translation_size = environment->values()->length(); 391 int translation_size = environment->values()->length();
392 // The output frame height does not include the parameters. 392 // The output frame height does not include the parameters.
393 int height = translation_size - environment->parameter_count(); 393 int height = translation_size - environment->parameter_count();
394 394
395 WriteTranslation(environment->outer(), translation); 395 WriteTranslation(environment->outer(), translation);
396 int closure_id = DefineDeoptimizationLiteral(environment->closure()); 396 int closure_id = DefineDeoptimizationLiteral(environment->closure());
397 translation->BeginFrame(environment->ast_id(), closure_id, height); 397 if (environment->is_arguments_adaptor()) {
398 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size);
399 } else {
400 translation->BeginJSFrame(environment->ast_id(), closure_id, height);
401 }
398 for (int i = 0; i < translation_size; ++i) { 402 for (int i = 0; i < translation_size; ++i) {
399 LOperand* value = environment->values()->at(i); 403 LOperand* value = environment->values()->at(i);
400 // spilled_registers_ and spilled_double_registers_ are either 404 // spilled_registers_ and spilled_double_registers_ are either
401 // both NULL or both set. 405 // both NULL or both set.
402 if (environment->spilled_registers() != NULL && value != NULL) { 406 if (environment->spilled_registers() != NULL && value != NULL) {
403 if (value->IsRegister() && 407 if (value->IsRegister() &&
404 environment->spilled_registers()[value->index()] != NULL) { 408 environment->spilled_registers()[value->index()] != NULL) {
405 translation->MarkDuplicate(); 409 translation->MarkDuplicate();
406 AddToTranslation(translation, 410 AddToTranslation(translation,
407 environment->spilled_registers()[value->index()], 411 environment->spilled_registers()[value->index()],
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 // Layout of the environment: 540 // Layout of the environment:
537 // 0 ..................................................... size-1 541 // 0 ..................................................... size-1
538 // [parameters] [locals] [expression stack including arguments] 542 // [parameters] [locals] [expression stack including arguments]
539 543
540 // Layout of the translation: 544 // Layout of the translation:
541 // 0 ........................................................ size - 1 + 4 545 // 0 ........................................................ size - 1 + 4
542 // [expression stack including arguments] [locals] [4 words] [parameters] 546 // [expression stack including arguments] [locals] [4 words] [parameters]
543 // |>------------ translation_size ------------<| 547 // |>------------ translation_size ------------<|
544 548
545 int frame_count = 0; 549 int frame_count = 0;
550 int jsframe_count = 0;
546 for (LEnvironment* e = environment; e != NULL; e = e->outer()) { 551 for (LEnvironment* e = environment; e != NULL; e = e->outer()) {
547 ++frame_count; 552 ++frame_count;
553 if (!e->is_arguments_adaptor()) {
554 ++jsframe_count;
555 }
548 } 556 }
549 Translation translation(&translations_, frame_count); 557 Translation translation(&translations_, frame_count, jsframe_count);
550 WriteTranslation(environment, &translation); 558 WriteTranslation(environment, &translation);
551 int deoptimization_index = deoptimizations_.length(); 559 int deoptimization_index = deoptimizations_.length();
552 int pc_offset = masm()->pc_offset(); 560 int pc_offset = masm()->pc_offset();
553 environment->Register(deoptimization_index, 561 environment->Register(deoptimization_index,
554 translation.index(), 562 translation.index(),
555 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); 563 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1);
556 deoptimizations_.Add(environment); 564 deoptimizations_.Add(environment);
557 } 565 }
558 } 566 }
559 567
(...skipping 4113 matching lines...) Expand 10 before | Expand all | Expand 10 after
4673 this, pointers, Safepoint::kLazyDeopt); 4681 this, pointers, Safepoint::kLazyDeopt);
4674 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4682 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4675 } 4683 }
4676 4684
4677 4685
4678 #undef __ 4686 #undef __
4679 4687
4680 } } // namespace v8::internal 4688 } } // namespace v8::internal
4681 4689
4682 #endif // V8_TARGET_ARCH_IA32 4690 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/ia32/frames-ia32.h ('K') | « src/ia32/frames-ia32.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698