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

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

Issue 10081009: Add PushAddress(ExternalReference) for X64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment by Erik Corry. Created 8 years, 8 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/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 size += 3; // Need full four-byte displacement in lea. 143 size += 3; // Need full four-byte displacement in lea.
144 } 144 }
145 return size; 145 return size;
146 } 146 }
147 } 147 }
148 // Size of movq(destination, src); 148 // Size of movq(destination, src);
149 return 10; 149 return 10;
150 } 150 }
151 151
152 152
153 void MacroAssembler::PushAddress(ExternalReference source) {
154 int64_t address = reinterpret_cast<int64_t>(source.address());
155 if (is_int32(address) && !Serializer::enabled()) {
156 if (emit_debug_code()) {
157 movq(kScratchRegister, BitCast<int64_t>(kZapValue), RelocInfo::NONE);
158 }
159 push(Immediate(static_cast<int32_t>(address)));
160 return;
161 }
162 LoadAddress(kScratchRegister, source);
163 push(kScratchRegister);
164 }
165
166
153 void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) { 167 void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
154 ASSERT(root_array_available_); 168 ASSERT(root_array_available_);
155 movq(destination, Operand(kRootRegister, 169 movq(destination, Operand(kRootRegister,
156 (index << kPointerSizeLog2) - kRootRegisterBias)); 170 (index << kPointerSizeLog2) - kRootRegisterBias));
157 } 171 }
158 172
159 173
160 void MacroAssembler::LoadRootIndexed(Register destination, 174 void MacroAssembler::LoadRootIndexed(Register destination,
161 Register variable_offset, 175 Register variable_offset,
162 int fixed_offset) { 176 int fixed_offset) {
(...skipping 4259 matching lines...) Expand 10 before | Expand all | Expand 10 after
4422 bind(&check_prototype); 4436 bind(&check_prototype);
4423 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 4437 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
4424 cmpq(rcx, null_value); 4438 cmpq(rcx, null_value);
4425 j(not_equal, &next); 4439 j(not_equal, &next);
4426 } 4440 }
4427 4441
4428 4442
4429 } } // namespace v8::internal 4443 } } // namespace v8::internal
4430 4444
4431 #endif // V8_TARGET_ARCH_X64 4445 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698