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

Side by Side Diff: src/code-stubs.cc

Issue 12385014: Hydrogen stubs for array constructors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: With all ports done Created 7 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
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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 // We don't allow setting a new entry hook over one that's 640 // We don't allow setting a new entry hook over one that's
641 // already active, as the hooks won't stack. 641 // already active, as the hooks won't stack.
642 if (entry_hook != 0 && entry_hook_ != 0) 642 if (entry_hook != 0 && entry_hook_ != 0)
643 return false; 643 return false;
644 644
645 entry_hook_ = entry_hook; 645 entry_hook_ = entry_hook;
646 return true; 646 return true;
647 } 647 }
648 648
649 649
650 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) {
651 int major_key = stub->MajorKey();
652 CodeStubInterfaceDescriptor* descriptor =
653 isolate->code_stub_interface_descriptor(major_key);
654 if (descriptor->register_param_count_ < 0) {
Hannes Payer (out of office) 2013/04/18 11:14:39 could you add a comment explaining what is going o
mvstanton 2013/04/18 13:39:26 It's checking if the descriptor has been initializ
655 stub->InitializeInterfaceDescriptor(isolate, descriptor);
656 }
657 }
658
659
660 void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) {
661 ArrayNoArgumentConstructorStub stub1(GetInitialFastElementsKind());
662 InstallDescriptor(isolate, &stub1);
663 ArraySingleArgumentConstructorStub stub2(GetInitialFastElementsKind());
664 InstallDescriptor(isolate, &stub2);
665 ArrayNArgumentsConstructorStub stub3(GetInitialFastElementsKind());
666 InstallDescriptor(isolate, &stub3);
667 }
668
669
670 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
671 : argument_count_(ANY) {
672 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
673 }
674
675
676 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate,
677 int argument_count) {
678 if (argument_count == 0) {
679 argument_count_ = NONE;
680 } else if (argument_count == 1) {
681 argument_count_ = ONE;
682 } else if (argument_count >= 2) {
683 argument_count_ = MORE_THAN_ONE;
684 } else {
685 UNREACHABLE();
686 }
687 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
688 }
689
690
650 } } // namespace v8::internal 691 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698