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

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

Issue 5667: In the code generator, avoid loading the arguments object to the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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 | src/codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 } 569 }
570 } 570 }
571 } 571 }
572 572
573 // Store the arguments object. 573 // Store the arguments object.
574 // This must happen after context initialization because 574 // This must happen after context initialization because
575 // the arguments array may be stored in the context! 575 // the arguments array may be stored in the context!
576 if (scope->arguments() != NULL) { 576 if (scope->arguments() != NULL) {
577 ASSERT(scope->arguments_shadow() != NULL); 577 ASSERT(scope->arguments_shadow() != NULL);
578 Comment cmnt(masm_, "[ allocate arguments object"); 578 Comment cmnt(masm_, "[ allocate arguments object");
579 { 579 { Reference shadow_ref(this, scope->arguments_shadow());
580 Reference target(this, scope->arguments()); 580 { Reference arguments_ref(this, scope->arguments());
581 __ ldr(r0, FunctionOperand()); 581
582 __ push(r0); 582 __ ldr(r0, FunctionOperand());
583 __ CallRuntime(Runtime::kNewArguments, 1); 583 __ push(r0);
584 __ push(r0); 584 __ CallRuntime(Runtime::kNewArguments, 1);
585 SetValue(&target); 585 __ push(r0);
586 SetValue(&arguments_ref);
587 }
588 SetValue(&shadow_ref);
586 } 589 }
587 // The value of arguments must also be stored in .arguments. 590 __ pop(r0); // Value is no longer needed.
588 // TODO(1241813): This code can probably be improved by fusing it with
589 // the code that stores the arguments object above.
590 {
591 Reference target(this, scope->arguments_shadow());
592 Load(scope->arguments());
593 SetValue(&target);
594 }
595 } 591 }
596 592
597 // Generate code to 'execute' declarations and initialize 593 // Generate code to 'execute' declarations and initialize
598 // functions (source elements). In case of an illegal 594 // functions (source elements). In case of an illegal
599 // redeclaration we need to handle that instead of processing the 595 // redeclaration we need to handle that instead of processing the
600 // declarations. 596 // declarations.
601 if (scope->HasIllegalRedeclaration()) { 597 if (scope->HasIllegalRedeclaration()) {
602 Comment cmnt(masm_, "[ illegal redeclarations"); 598 Comment cmnt(masm_, "[ illegal redeclarations");
603 scope->VisitIllegalRedeclaration(this); 599 scope->VisitIllegalRedeclaration(this);
604 } else { 600 } else {
(...skipping 3917 matching lines...) Expand 10 before | Expand all | Expand 10 after
4522 bool is_eval) { 4518 bool is_eval) {
4523 Handle<Code> code = ArmCodeGenerator::MakeCode(fun, script, is_eval); 4519 Handle<Code> code = ArmCodeGenerator::MakeCode(fun, script, is_eval);
4524 if (!code.is_null()) { 4520 if (!code.is_null()) {
4525 Counters::total_compiled_code_size.Increment(code->instruction_size()); 4521 Counters::total_compiled_code_size.Increment(code->instruction_size());
4526 } 4522 }
4527 return code; 4523 return code;
4528 } 4524 }
4529 4525
4530 4526
4531 } } // namespace v8::internal 4527 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698