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

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

Issue 7860045: Stack allocating block scoped variables. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on tip of tree. Created 9 years 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/compiler.h » ('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 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 629
630 MemOperand FullCodeGenerator::StackOperand(Variable* var) { 630 MemOperand FullCodeGenerator::StackOperand(Variable* var) {
631 ASSERT(var->IsStackAllocated()); 631 ASSERT(var->IsStackAllocated());
632 // Offset is negative because higher indexes are at lower addresses. 632 // Offset is negative because higher indexes are at lower addresses.
633 int offset = -var->index() * kPointerSize; 633 int offset = -var->index() * kPointerSize;
634 // Adjust by a (parameter or local) base offset. 634 // Adjust by a (parameter or local) base offset.
635 if (var->IsParameter()) { 635 if (var->IsParameter()) {
636 offset += (info_->scope()->num_parameters() + 1) * kPointerSize; 636 offset += (info_->scope()->num_parameters() + 1) * kPointerSize;
637 } else { 637 } else {
638 offset += JavaScriptFrameConstants::kLocal0Offset; 638 offset += JavaScriptFrameConstants::kLocal0Offset;
639 // Test if the variable is from a nested block scope.
640 if (info_->scope() != var->scope()) {
641 // Skip handlers and stack locals from enclosing block scopes.
642 offset -= var->scope()->stack_slots_depth() * kPointerSize;
643 }
639 } 644 }
640 return MemOperand(fp, offset); 645 return MemOperand(fp, offset);
641 } 646 }
642 647
643 648
644 MemOperand FullCodeGenerator::VarOperand(Variable* var, Register scratch) { 649 MemOperand FullCodeGenerator::VarOperand(Variable* var, Register scratch) {
645 ASSERT(var->IsContextSlot() || var->IsStackAllocated()); 650 ASSERT(var->IsContextSlot() || var->IsStackAllocated());
646 if (var->IsContextSlot()) { 651 if (var->IsContextSlot()) {
647 int context_chain_length = scope()->ContextChainLength(var->scope()); 652 int context_chain_length = scope()->ContextChainLength(var->scope());
648 __ LoadContext(scratch, context_chain_length); 653 __ LoadContext(scratch, context_chain_length);
(...skipping 3726 matching lines...) Expand 10 before | Expand all | Expand 10 after
4375 *context_length = 0; 4380 *context_length = 0;
4376 return previous_; 4381 return previous_;
4377 } 4382 }
4378 4383
4379 4384
4380 #undef __ 4385 #undef __
4381 4386
4382 } } // namespace v8::internal 4387 } } // namespace v8::internal
4383 4388
4384 #endif // V8_TARGET_ARCH_ARM 4389 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698