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

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

Issue 545117: X64: Fix bug that reads from rax instead of correct register. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); 2411 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex);
2412 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); 2412 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
2413 } 2413 }
2414 2414
2415 2415
2416 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { 2416 void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
2417 if (context_chain_length > 0) { 2417 if (context_chain_length > 0) {
2418 // Move up the chain of contexts to the context containing the slot. 2418 // Move up the chain of contexts to the context containing the slot.
2419 movq(dst, Operand(rsi, Context::SlotOffset(Context::CLOSURE_INDEX))); 2419 movq(dst, Operand(rsi, Context::SlotOffset(Context::CLOSURE_INDEX)));
2420 // Load the function context (which is the incoming, outer context). 2420 // Load the function context (which is the incoming, outer context).
2421 movq(rax, FieldOperand(rax, JSFunction::kContextOffset)); 2421 movq(dst, FieldOperand(dst, JSFunction::kContextOffset));
2422 for (int i = 1; i < context_chain_length; i++) { 2422 for (int i = 1; i < context_chain_length; i++) {
2423 movq(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX))); 2423 movq(dst, Operand(dst, Context::SlotOffset(Context::CLOSURE_INDEX)));
2424 movq(dst, FieldOperand(dst, JSFunction::kContextOffset)); 2424 movq(dst, FieldOperand(dst, JSFunction::kContextOffset));
2425 } 2425 }
2426 // The context may be an intermediate context, not a function context. 2426 // The context may be an intermediate context, not a function context.
2427 movq(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX))); 2427 movq(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX)));
2428 } else { // context is the current function context. 2428 } else { // context is the current function context.
2429 // The context may be an intermediate context, not a function context. 2429 // The context may be an intermediate context, not a function context.
2430 movq(dst, Operand(rsi, Context::SlotOffset(Context::FCONTEXT_INDEX))); 2430 movq(dst, Operand(rsi, Context::SlotOffset(Context::FCONTEXT_INDEX)));
2431 } 2431 }
(...skipping 12 matching lines...) Expand all
2444 CodePatcher::~CodePatcher() { 2444 CodePatcher::~CodePatcher() {
2445 // Indicate that code has changed. 2445 // Indicate that code has changed.
2446 CPU::FlushICache(address_, size_); 2446 CPU::FlushICache(address_, size_);
2447 2447
2448 // Check that the code was patched as expected. 2448 // Check that the code was patched as expected.
2449 ASSERT(masm_.pc_ == address_ + size_); 2449 ASSERT(masm_.pc_ == address_ + size_);
2450 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2450 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2451 } 2451 }
2452 2452
2453 } } // namespace v8::internal 2453 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698