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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 7134042: Link function contexts directly to the previous context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Avoid calling previous on the global context. Created 9 years, 6 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 | « src/arm/code-stubs-arm.cc ('k') | src/contexts.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 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 while (abort_instructions++ < kExpectedAbortInstructions) { 2531 while (abort_instructions++ < kExpectedAbortInstructions) {
2532 nop(); 2532 nop();
2533 } 2533 }
2534 } 2534 }
2535 } 2535 }
2536 2536
2537 2537
2538 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { 2538 void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
2539 if (context_chain_length > 0) { 2539 if (context_chain_length > 0) {
2540 // Move up the chain of contexts to the context containing the slot. 2540 // Move up the chain of contexts to the context containing the slot.
2541 ldr(dst, MemOperand(cp, Context::SlotOffset(Context::CLOSURE_INDEX))); 2541 ldr(dst, MemOperand(cp, Context::SlotOffset(Context::PREVIOUS_INDEX)));
2542 // Load the function context (which is the incoming, outer context).
2543 ldr(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
2544 for (int i = 1; i < context_chain_length; i++) { 2542 for (int i = 1; i < context_chain_length; i++) {
2545 ldr(dst, MemOperand(dst, Context::SlotOffset(Context::CLOSURE_INDEX))); 2543 ldr(dst, MemOperand(dst, Context::SlotOffset(Context::PREVIOUS_INDEX)));
2546 ldr(dst, FieldMemOperand(dst, JSFunction::kContextOffset));
2547 } 2544 }
2548 } else { 2545 } else {
2549 // Slot is in the current function context. Move it into the 2546 // Slot is in the current function context. Move it into the
2550 // destination register in case we store into it (the write barrier 2547 // destination register in case we store into it (the write barrier
2551 // cannot be allowed to destroy the context in esi). 2548 // cannot be allowed to destroy the context in esi).
2552 mov(dst, cp); 2549 mov(dst, cp);
2553 } 2550 }
2554 2551
2555 // We should not have found a 'with' context by walking the context chain 2552 // We should not have found a 'with' context by walking the context chain
2556 // (i.e., the static scope chain and runtime context chain do not agree). 2553 // (i.e., the static scope chain and runtime context chain do not agree).
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 void CodePatcher::EmitCondition(Condition cond) { 3171 void CodePatcher::EmitCondition(Condition cond) {
3175 Instr instr = Assembler::instr_at(masm_.pc_); 3172 Instr instr = Assembler::instr_at(masm_.pc_);
3176 instr = (instr & ~kCondMask) | cond; 3173 instr = (instr & ~kCondMask) | cond;
3177 masm_.emit(instr); 3174 masm_.emit(instr);
3178 } 3175 }
3179 3176
3180 3177
3181 } } // namespace v8::internal 3178 } } // namespace v8::internal
3182 3179
3183 #endif // V8_TARGET_ARCH_ARM 3180 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698