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

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

Issue 543207: Removing redundant stub for runtime native calls. (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/x64/debug-x64.cc ('k') | test/cctest/test-debug.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 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) { 338 void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
339 // If the expected number of arguments of the runtime function is 339 // If the expected number of arguments of the runtime function is
340 // constant, we check that the actual number of arguments match the 340 // constant, we check that the actual number of arguments match the
341 // expectation. 341 // expectation.
342 if (f->nargs >= 0 && f->nargs != num_arguments) { 342 if (f->nargs >= 0 && f->nargs != num_arguments) {
343 IllegalOperation(num_arguments); 343 IllegalOperation(num_arguments);
344 return; 344 return;
345 } 345 }
346 346
347 Runtime::FunctionId function_id = 347 // TODO(1236192): Most runtime routines don't need the number of
348 static_cast<Runtime::FunctionId>(f->stub_id); 348 // arguments passed in because it is constant. At some point we
349 RuntimeStub stub(function_id, num_arguments); 349 // should remove this need and make the runtime routine entry code
350 CallStub(&stub); 350 // smarter.
351 movq(rax, Immediate(num_arguments));
352 movq(rbx, ExternalReference(f));
353 CEntryStub ces(f->result_size);
354 CallStub(&ces);
351 } 355 }
352 356
353 357
354 void MacroAssembler::TailCallRuntime(ExternalReference const& ext, 358 void MacroAssembler::TailCallRuntime(ExternalReference const& ext,
355 int num_arguments, 359 int num_arguments,
356 int result_size) { 360 int result_size) {
357 // ----------- S t a t e ------------- 361 // ----------- S t a t e -------------
358 // -- rsp[0] : return address 362 // -- rsp[0] : return address
359 // -- rsp[8] : argument num_arguments - 1 363 // -- rsp[8] : argument num_arguments - 1
360 // ... 364 // ...
(...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 CodePatcher::~CodePatcher() { 2535 CodePatcher::~CodePatcher() {
2532 // Indicate that code has changed. 2536 // Indicate that code has changed.
2533 CPU::FlushICache(address_, size_); 2537 CPU::FlushICache(address_, size_);
2534 2538
2535 // Check that the code was patched as expected. 2539 // Check that the code was patched as expected.
2536 ASSERT(masm_.pc_ == address_ + size_); 2540 ASSERT(masm_.pc_ == address_ + size_);
2537 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2541 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2538 } 2542 }
2539 2543
2540 } } // namespace v8::internal 2544 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/debug-x64.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698