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

Side by Side Diff: src/objects.cc

Issue 200095: Add near calls (32-bit displacement) to Code objects on X64 platform. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | « src/memory.h ('k') | src/serialize.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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 5033 matching lines...) Expand 10 before | Expand all | Expand 10 after
5044 // copy reloc info 5044 // copy reloc info
5045 memmove(relocation_start(), 5045 memmove(relocation_start(),
5046 desc.buffer + desc.buffer_size - desc.reloc_size, 5046 desc.buffer + desc.buffer_size - desc.reloc_size,
5047 desc.reloc_size); 5047 desc.reloc_size);
5048 5048
5049 // unbox handles and relocate 5049 // unbox handles and relocate
5050 int delta = instruction_start() - desc.buffer; 5050 int delta = instruction_start() - desc.buffer;
5051 int mode_mask = RelocInfo::kCodeTargetMask | 5051 int mode_mask = RelocInfo::kCodeTargetMask |
5052 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 5052 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
5053 RelocInfo::kApplyMask; 5053 RelocInfo::kApplyMask;
5054 Assembler* origin = desc.origin; // Needed to find target_object on X64.
5054 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { 5055 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
5055 RelocInfo::Mode mode = it.rinfo()->rmode(); 5056 RelocInfo::Mode mode = it.rinfo()->rmode();
5056 if (mode == RelocInfo::EMBEDDED_OBJECT) { 5057 if (mode == RelocInfo::EMBEDDED_OBJECT) {
5057 Object** p = reinterpret_cast<Object**>(it.rinfo()->target_object()); 5058 Handle<Object> p = it.rinfo()->target_object_handle(origin);
5058 it.rinfo()->set_target_object(*p); 5059 it.rinfo()->set_target_object(*p);
5059 } else if (RelocInfo::IsCodeTarget(mode)) { 5060 } else if (RelocInfo::IsCodeTarget(mode)) {
5060 // rewrite code handles in inline cache targets to direct 5061 // rewrite code handles in inline cache targets to direct
5061 // pointers to the first instruction in the code object 5062 // pointers to the first instruction in the code object
5062 Object** p = reinterpret_cast<Object**>(it.rinfo()->target_object()); 5063 Handle<Object> p = it.rinfo()->target_object_handle(origin);
5063 Code* code = Code::cast(*p); 5064 Code* code = Code::cast(*p);
5064 it.rinfo()->set_target_address(code->instruction_start()); 5065 it.rinfo()->set_target_address(code->instruction_start());
5065 } else { 5066 } else {
5066 it.rinfo()->apply(delta); 5067 it.rinfo()->apply(delta);
5067 } 5068 }
5068 } 5069 }
5069 CPU::FlushICache(instruction_start(), instruction_size()); 5070 CPU::FlushICache(instruction_start(), instruction_size());
5070 } 5071 }
5071 5072
5072 5073
(...skipping 2900 matching lines...) Expand 10 before | Expand all | Expand 10 after
7973 if (break_point_objects()->IsUndefined()) return 0; 7974 if (break_point_objects()->IsUndefined()) return 0;
7974 // Single beak point. 7975 // Single beak point.
7975 if (!break_point_objects()->IsFixedArray()) return 1; 7976 if (!break_point_objects()->IsFixedArray()) return 1;
7976 // Multiple break points. 7977 // Multiple break points.
7977 return FixedArray::cast(break_point_objects())->length(); 7978 return FixedArray::cast(break_point_objects())->length();
7978 } 7979 }
7979 #endif 7980 #endif
7980 7981
7981 7982
7982 } } // namespace v8::internal 7983 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/memory.h ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698