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

Side by Side Diff: src/virtual-frame.cc

Issue 42638: In the IA32 code genrator, handle call ICs and constructor calls the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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-ia32.cc ('k') | src/virtual-frame-arm.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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 value->Unuse(); 411 value->Unuse();
412 } 412 }
413 413
414 414
415 void VirtualFrame::PushFrameSlotAt(int index) { 415 void VirtualFrame::PushFrameSlotAt(int index) {
416 FrameElement new_element = CopyElementAt(index); 416 FrameElement new_element = CopyElementAt(index);
417 elements_.Add(new_element); 417 elements_.Add(new_element);
418 } 418 }
419 419
420 420
421 Result VirtualFrame::CallStub(CodeStub* stub, int frame_arg_count) { 421 Result VirtualFrame::CallStub(CodeStub* stub, int arg_count) {
422 PrepareForCall(frame_arg_count, frame_arg_count); 422 PrepareForCall(arg_count, arg_count);
423 return RawCallStub(stub, frame_arg_count); 423 return RawCallStub(stub);
424 } 424 }
425 425
426 426
427 Result VirtualFrame::CallStub(CodeStub* stub, 427 Result VirtualFrame::CallStub(CodeStub* stub, Result* arg, int arg_count) {
428 Result* arg, 428 PrepareForCall(arg_count, arg_count);
429 int frame_arg_count) {
430 PrepareForCall(frame_arg_count, frame_arg_count);
431 arg->Unuse(); 429 arg->Unuse();
432 return RawCallStub(stub, frame_arg_count); 430 return RawCallStub(stub);
433 } 431 }
434 432
435 433
436 Result VirtualFrame::CallStub(CodeStub* stub, 434 Result VirtualFrame::CallStub(CodeStub* stub,
437 Result* arg0, 435 Result* arg0,
438 Result* arg1, 436 Result* arg1,
439 int frame_arg_count) { 437 int arg_count) {
440 PrepareForCall(frame_arg_count, frame_arg_count); 438 PrepareForCall(arg_count, arg_count);
441 arg0->Unuse(); 439 arg0->Unuse();
442 arg1->Unuse(); 440 arg1->Unuse();
443 return RawCallStub(stub, frame_arg_count); 441 return RawCallStub(stub);
444 }
445
446
447 Result VirtualFrame::CallCodeObject(Handle<Code> code,
448 RelocInfo::Mode rmode,
449 int dropped_args) {
450 int spilled_args = 0;
451 switch (code->kind()) {
452 case Code::CALL_IC:
453 spilled_args = dropped_args + 1;
454 break;
455 case Code::FUNCTION:
456 spilled_args = dropped_args + 1;
457 break;
458 #ifdef ARM
459 case Code::KEYED_LOAD_IC:
460 ASSERT(dropped_args == 0);
461 spilled_args = 2;
462 break;
463 #endif
464 default:
465 // The other types of code objects are called with values
466 // in specific registers, and are handled in functions with
467 // a different signature.
468 UNREACHABLE();
469 break;
470 }
471 PrepareForCall(spilled_args, dropped_args);
472 return RawCallCodeObject(code, rmode);
473 } 442 }
474 443
475 444
476 void VirtualFrame::Push(Register reg) { 445 void VirtualFrame::Push(Register reg) {
477 if (is_used(reg)) { 446 if (is_used(reg)) {
478 elements_.Add(CopyElementAt(register_index(reg))); 447 elements_.Add(CopyElementAt(register_index(reg)));
479 } else { 448 } else {
480 Use(reg, elements_.length()); 449 Use(reg, elements_.length());
481 elements_.Add(FrameElement::RegisterElement(reg, FrameElement::NOT_SYNCED)); 450 elements_.Add(FrameElement::RegisterElement(reg, FrameElement::NOT_SYNCED));
482 } 451 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 #endif 514 #endif
546 if (stack_pointer_ != other->stack_pointer_) return false; 515 if (stack_pointer_ != other->stack_pointer_) return false;
547 for (int i = 0; i < elements_.length(); i++) { 516 for (int i = 0; i < elements_.length(); i++) {
548 if (!elements_[i].Equals(other->elements_[i])) return false; 517 if (!elements_[i].Equals(other->elements_[i])) return false;
549 } 518 }
550 519
551 return true; 520 return true;
552 } 521 }
553 522
554 } } // namespace v8::internal 523 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-ia32.cc ('k') | src/virtual-frame-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698