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

Side by Side Diff: src/x64/lithium-codegen-x64.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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 Translation* translation) { 361 Translation* translation) {
362 if (environment == NULL) return; 362 if (environment == NULL) return;
363 363
364 // The translation includes one command per value in the environment. 364 // The translation includes one command per value in the environment.
365 int translation_size = environment->values()->length(); 365 int translation_size = environment->values()->length();
366 // The output frame height does not include the parameters. 366 // The output frame height does not include the parameters.
367 int height = translation_size - environment->parameter_count(); 367 int height = translation_size - environment->parameter_count();
368 368
369 WriteTranslation(environment->outer(), translation); 369 WriteTranslation(environment->outer(), translation);
370 int closure_id = DefineDeoptimizationLiteral(environment->closure()); 370 int closure_id = DefineDeoptimizationLiteral(environment->closure());
371 translation->BeginFrame(environment->ast_id(), closure_id, height); 371 if (environment->is_arguments_adaptor()) {
372 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size);
373 } else {
374 translation->BeginJSFrame(environment->ast_id(), closure_id, height);
375 }
372 for (int i = 0; i < translation_size; ++i) { 376 for (int i = 0; i < translation_size; ++i) {
373 LOperand* value = environment->values()->at(i); 377 LOperand* value = environment->values()->at(i);
374 // spilled_registers_ and spilled_double_registers_ are either 378 // spilled_registers_ and spilled_double_registers_ are either
375 // both NULL or both set. 379 // both NULL or both set.
376 if (environment->spilled_registers() != NULL && value != NULL) { 380 if (environment->spilled_registers() != NULL && value != NULL) {
377 if (value->IsRegister() && 381 if (value->IsRegister() &&
378 environment->spilled_registers()[value->index()] != NULL) { 382 environment->spilled_registers()[value->index()] != NULL) {
379 translation->MarkDuplicate(); 383 translation->MarkDuplicate();
380 AddToTranslation(translation, 384 AddToTranslation(translation,
381 environment->spilled_registers()[value->index()], 385 environment->spilled_registers()[value->index()],
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 // Layout of the environment: 501 // Layout of the environment:
498 // 0 ..................................................... size-1 502 // 0 ..................................................... size-1
499 // [parameters] [locals] [expression stack including arguments] 503 // [parameters] [locals] [expression stack including arguments]
500 504
501 // Layout of the translation: 505 // Layout of the translation:
502 // 0 ........................................................ size - 1 + 4 506 // 0 ........................................................ size - 1 + 4
503 // [expression stack including arguments] [locals] [4 words] [parameters] 507 // [expression stack including arguments] [locals] [4 words] [parameters]
504 // |>------------ translation_size ------------<| 508 // |>------------ translation_size ------------<|
505 509
506 int frame_count = 0; 510 int frame_count = 0;
511 int jsframe_count = 0;
507 for (LEnvironment* e = environment; e != NULL; e = e->outer()) { 512 for (LEnvironment* e = environment; e != NULL; e = e->outer()) {
508 ++frame_count; 513 ++frame_count;
514 if (!e->is_arguments_adaptor()) {
515 ++jsframe_count;
516 }
509 } 517 }
510 Translation translation(&translations_, frame_count); 518 Translation translation(&translations_, frame_count, jsframe_count);
511 WriteTranslation(environment, &translation); 519 WriteTranslation(environment, &translation);
512 int deoptimization_index = deoptimizations_.length(); 520 int deoptimization_index = deoptimizations_.length();
513 int pc_offset = masm()->pc_offset(); 521 int pc_offset = masm()->pc_offset();
514 environment->Register(deoptimization_index, 522 environment->Register(deoptimization_index,
515 translation.index(), 523 translation.index(),
516 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1); 524 (mode == Safepoint::kLazyDeopt) ? pc_offset : -1);
517 deoptimizations_.Add(environment); 525 deoptimizations_.Add(environment);
518 } 526 }
519 } 527 }
520 528
(...skipping 3876 matching lines...) Expand 10 before | Expand all | Expand 10 after
4397 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4405 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4398 ASSERT(osr_pc_offset_ == -1); 4406 ASSERT(osr_pc_offset_ == -1);
4399 osr_pc_offset_ = masm()->pc_offset(); 4407 osr_pc_offset_ = masm()->pc_offset();
4400 } 4408 }
4401 4409
4402 #undef __ 4410 #undef __
4403 4411
4404 } } // namespace v8::internal 4412 } } // namespace v8::internal
4405 4413
4406 #endif // V8_TARGET_ARCH_X64 4414 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ia32/frames-ia32.h ('K') | « src/x64/frames-x64.h ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698