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

Side by Side Diff: src/codegen.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/codegen.h ('k') | src/debug.h » ('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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (FLAG_debug_info) RecordPositions(masm(), stmt->condition_position()); 445 if (FLAG_debug_info) RecordPositions(masm(), stmt->condition_position());
446 } 446 }
447 447
448 void CodeGenerator::CodeForSourcePosition(int pos) { 448 void CodeGenerator::CodeForSourcePosition(int pos) {
449 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) { 449 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) {
450 masm()->RecordPosition(pos); 450 masm()->RecordPosition(pos);
451 } 451 }
452 } 452 }
453 453
454 454
455 const char* RuntimeStub::GetName() {
456 return Runtime::FunctionForId(id_)->stub_name;
457 }
458
459
460 const char* GenericUnaryOpStub::GetName() { 455 const char* GenericUnaryOpStub::GetName() {
461 switch (op_) { 456 switch (op_) {
462 case Token::SUB: 457 case Token::SUB:
463 return overwrite_ 458 return overwrite_
464 ? "GenericUnaryOpStub_SUB_Overwrite" 459 ? "GenericUnaryOpStub_SUB_Overwrite"
465 : "GenericUnaryOpStub_SUB_Alloc"; 460 : "GenericUnaryOpStub_SUB_Alloc";
466 case Token::BIT_NOT: 461 case Token::BIT_NOT:
467 return overwrite_ 462 return overwrite_
468 ? "GenericUnaryOpStub_BIT_NOT_Overwrite" 463 ? "GenericUnaryOpStub_BIT_NOT_Overwrite"
469 : "GenericUnaryOpStub_BIT_NOT_Alloc"; 464 : "GenericUnaryOpStub_BIT_NOT_Alloc";
470 default: 465 default:
471 UNREACHABLE(); 466 UNREACHABLE();
472 return "<unknown>"; 467 return "<unknown>";
473 } 468 }
474 } 469 }
475 470
476 471
477 void RuntimeStub::Generate(MacroAssembler* masm) {
478 Runtime::Function* f = Runtime::FunctionForId(id_);
479 masm->TailCallRuntime(ExternalReference(f),
480 num_arguments_,
481 f->result_size);
482 }
483
484
485 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { 472 void ArgumentsAccessStub::Generate(MacroAssembler* masm) {
486 switch (type_) { 473 switch (type_) {
487 case READ_LENGTH: GenerateReadLength(masm); break; 474 case READ_LENGTH: GenerateReadLength(masm); break;
488 case READ_ELEMENT: GenerateReadElement(masm); break; 475 case READ_ELEMENT: GenerateReadElement(masm); break;
489 case NEW_OBJECT: GenerateNewObject(masm); break; 476 case NEW_OBJECT: GenerateNewObject(masm); break;
490 } 477 }
491 } 478 }
492 479
493 480
494 bool ApiGetterEntryStub::GetCustomCache(Code** code_out) { 481 bool ApiGetterEntryStub::GetCustomCache(Code** code_out) {
495 Object* cache = info()->load_stub_cache(); 482 Object* cache = info()->load_stub_cache();
496 if (cache->IsUndefined()) { 483 if (cache->IsUndefined()) {
497 return false; 484 return false;
498 } else { 485 } else {
499 *code_out = Code::cast(cache); 486 *code_out = Code::cast(cache);
500 return true; 487 return true;
501 } 488 }
502 } 489 }
503 490
504 491
505 void ApiGetterEntryStub::SetCustomCache(Code* value) { 492 void ApiGetterEntryStub::SetCustomCache(Code* value) {
506 info()->set_load_stub_cache(value); 493 info()->set_load_stub_cache(value);
507 } 494 }
508 495
509 496
497 void DebugerStatementStub::Generate(MacroAssembler* masm) {
498 Runtime::Function* f = Runtime::FunctionForId(Runtime::kDebugBreak);
499 masm->TailCallRuntime(ExternalReference(f), 0, f->result_size);
500 }
501
502
510 } } // namespace v8::internal 503 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen.h ('k') | src/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698