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

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

Issue 652118: Refactored TailCallRuntime (splitted to TailCallRuntime and TailCallExternalReference) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 // arguments passed in because it is constant. At some point we 1179 // arguments passed in because it is constant. At some point we
1180 // should remove this need and make the runtime routine entry code 1180 // should remove this need and make the runtime routine entry code
1181 // smarter. 1181 // smarter.
1182 Set(eax, Immediate(num_arguments)); 1182 Set(eax, Immediate(num_arguments));
1183 mov(ebx, Immediate(ExternalReference(f))); 1183 mov(ebx, Immediate(ExternalReference(f)));
1184 CEntryStub ces(1); 1184 CEntryStub ces(1);
1185 return TryCallStub(&ces); 1185 return TryCallStub(&ces);
1186 } 1186 }
1187 1187
1188 1188
1189 void MacroAssembler::TailCallRuntime(const ExternalReference& ext, 1189 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
1190 int num_arguments, 1190 int num_arguments,
1191 int result_size) { 1191 int result_size) {
1192 // TODO(1236192): Most runtime routines don't need the number of 1192 // TODO(1236192): Most runtime routines don't need the number of
1193 // arguments passed in because it is constant. At some point we 1193 // arguments passed in because it is constant. At some point we
1194 // should remove this need and make the runtime routine entry code 1194 // should remove this need and make the runtime routine entry code
1195 // smarter. 1195 // smarter.
1196 Set(eax, Immediate(num_arguments)); 1196 Set(eax, Immediate(num_arguments));
1197 JumpToRuntime(ext); 1197 JumpToExternalReference(ext);
1198 }
1199
1200
1201 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
1202 int num_arguments,
1203 int result_size) {
1204 TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
1198 } 1205 }
1199 1206
1200 1207
1201 void MacroAssembler::PushHandleScope(Register scratch) { 1208 void MacroAssembler::PushHandleScope(Register scratch) {
1202 // Push the number of extensions, smi-tagged so the gc will ignore it. 1209 // Push the number of extensions, smi-tagged so the gc will ignore it.
1203 ExternalReference extensions_address = 1210 ExternalReference extensions_address =
1204 ExternalReference::handle_scope_extensions_address(); 1211 ExternalReference::handle_scope_extensions_address();
1205 mov(scratch, Operand::StaticVariable(extensions_address)); 1212 mov(scratch, Operand::StaticVariable(extensions_address));
1206 ASSERT_EQ(0, kSmiTag); 1213 ASSERT_EQ(0, kSmiTag);
1207 shl(scratch, kSmiTagSize); 1214 shl(scratch, kSmiTagSize);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 void MacroAssembler::PopHandleScope(Register saved, Register scratch) { 1264 void MacroAssembler::PopHandleScope(Register saved, Register scratch) {
1258 PopHandleScopeHelper(saved, scratch, true); 1265 PopHandleScopeHelper(saved, scratch, true);
1259 } 1266 }
1260 1267
1261 1268
1262 Object* MacroAssembler::TryPopHandleScope(Register saved, Register scratch) { 1269 Object* MacroAssembler::TryPopHandleScope(Register saved, Register scratch) {
1263 return PopHandleScopeHelper(saved, scratch, false); 1270 return PopHandleScopeHelper(saved, scratch, false);
1264 } 1271 }
1265 1272
1266 1273
1267 void MacroAssembler::JumpToRuntime(const ExternalReference& ext) { 1274 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
1268 // Set the entry point and jump to the C entry runtime stub. 1275 // Set the entry point and jump to the C entry runtime stub.
1269 mov(ebx, Immediate(ext)); 1276 mov(ebx, Immediate(ext));
1270 CEntryStub ces(1); 1277 CEntryStub ces(1);
1271 jmp(ces.GetCode(), RelocInfo::CODE_TARGET); 1278 jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
1272 } 1279 }
1273 1280
1274 1281
1275 void MacroAssembler::InvokePrologue(const ParameterCount& expected, 1282 void MacroAssembler::InvokePrologue(const ParameterCount& expected,
1276 const ParameterCount& actual, 1283 const ParameterCount& actual,
1277 Handle<Code> code_constant, 1284 Handle<Code> code_constant,
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 // Indicate that code has changed. 1635 // Indicate that code has changed.
1629 CPU::FlushICache(address_, size_); 1636 CPU::FlushICache(address_, size_);
1630 1637
1631 // Check that the code was patched as expected. 1638 // Check that the code was patched as expected.
1632 ASSERT(masm_.pc_ == address_ + size_); 1639 ASSERT(masm_.pc_ == address_ + size_);
1633 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 1640 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
1634 } 1641 }
1635 1642
1636 1643
1637 } } // namespace v8::internal 1644 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698