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

Side by Side Diff: src/stub-cache.h

Issue 3327022: Custom call IC for Math.floor. (Closed)
Patch Set: Oops, forgot to upload the test Created 10 years, 3 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 private: 605 private:
606 Object* GetCode(PropertyType type, String* name); 606 Object* GetCode(PropertyType type, String* name);
607 }; 607 };
608 608
609 609
610 // List of functions with custom constant call IC stubs. 610 // List of functions with custom constant call IC stubs.
611 // 611 //
612 // Installation of custom call generators for the selected builtins is 612 // Installation of custom call generators for the selected builtins is
613 // handled by the bootstrapper. 613 // handled by the bootstrapper.
614 // 614 //
615 // Each entry has a name of a global function (lowercased), a flag 615 // Each entry has a name of a global object property holding an object
616 // controlling whether the generator is set on the function itself or 616 // optionally followed by ".prototype" (this controls whether the
617 // on its instance prototype, a name of a builtin function on the 617 // generator is set on the object itself or, in case it's a function,
618 // function or its instance prototype (the one the generator is set 618 // on the its instance prototype), a name of a builtin function on the
619 // for), and a name of a generator itself (used to build ids and 619 // object (the one the generator is set for), and a name of the
620 // generator function names). 620 // generator (used to build ids and generator function names).
621 #define CUSTOM_CALL_IC_GENERATORS(V) \ 621 #define CUSTOM_CALL_IC_GENERATORS(V) \
622 V(array, INSTANCE_PROTOTYPE, push, ArrayPush) \ 622 V(Array.prototype, push, ArrayPush) \
623 V(array, INSTANCE_PROTOTYPE, pop, ArrayPop) \ 623 V(Array.prototype, pop, ArrayPop) \
624 V(string, INSTANCE_PROTOTYPE, charCodeAt, StringCharCodeAt) \ 624 V(String.prototype, charCodeAt, StringCharCodeAt) \
625 V(string, INSTANCE_PROTOTYPE, charAt, StringCharAt) \ 625 V(String.prototype, charAt, StringCharAt) \
626 V(string, FUNCTION, fromCharCode, StringFromCharCode) 626 V(String, fromCharCode, StringFromCharCode) \
627 V(Math, floor, MathFloor)
627 628
628 629
629 class CallStubCompiler: public StubCompiler { 630 class CallStubCompiler: public StubCompiler {
630 public: 631 public:
631 enum CustomGeneratorOwner {
632 FUNCTION,
633 INSTANCE_PROTOTYPE
634 };
635
636 enum { 632 enum {
637 #define DECLARE_CALL_GENERATOR_ID(ignored1, ignore2, ignored3, name) \ 633 #define DECLARE_CALL_GENERATOR_ID(ignored1, ignore2, name) \
638 k##name##CallGenerator, 634 k##name##CallGenerator,
639 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR_ID) 635 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR_ID)
640 #undef DECLARE_CALL_GENERATOR_ID 636 #undef DECLARE_CALL_GENERATOR_ID
641 kNumCallGenerators 637 kNumCallGenerators
642 }; 638 };
643 639
644 CallStubCompiler(int argc, 640 CallStubCompiler(int argc,
645 InLoopFlag in_loop, 641 InLoopFlag in_loop,
646 Code::Kind kind, 642 Code::Kind kind,
647 InlineCacheHolderFlag cache_holder); 643 InlineCacheHolderFlag cache_holder);
(...skipping 18 matching lines...) Expand all
666 662
667 // Compiles a custom call constant/global IC using the generator 663 // Compiles a custom call constant/global IC using the generator
668 // with given id. For constant calls cell is NULL. 664 // with given id. For constant calls cell is NULL.
669 Object* CompileCustomCall(int generator_id, 665 Object* CompileCustomCall(int generator_id,
670 Object* object, 666 Object* object,
671 JSObject* holder, 667 JSObject* holder,
672 JSGlobalPropertyCell* cell, 668 JSGlobalPropertyCell* cell,
673 JSFunction* function, 669 JSFunction* function,
674 String* name); 670 String* name);
675 671
676 #define DECLARE_CALL_GENERATOR(ignored1, ignored2, ignored3, name) \ 672 #define DECLARE_CALL_GENERATOR(ignored1, ignored2, name) \
677 Object* Compile##name##Call(Object* object, \ 673 Object* Compile##name##Call(Object* object, \
678 JSObject* holder, \ 674 JSObject* holder, \
679 JSGlobalPropertyCell* cell, \ 675 JSGlobalPropertyCell* cell, \
680 JSFunction* function, \ 676 JSFunction* function, \
681 String* fname); 677 String* fname);
682 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) 678 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR)
683 #undef DECLARE_CALL_GENERATOR 679 #undef DECLARE_CALL_GENERATOR
684 680
685 private: 681 private:
686 const ParameterCount arguments_; 682 const ParameterCount arguments_;
687 const InLoopFlag in_loop_; 683 const InLoopFlag in_loop_;
688 const Code::Kind kind_; 684 const Code::Kind kind_;
689 const InlineCacheHolderFlag cache_holder_; 685 const InlineCacheHolderFlag cache_holder_;
690 686
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 766
771 JSFunction* constant_function_; 767 JSFunction* constant_function_;
772 bool is_simple_api_call_; 768 bool is_simple_api_call_;
773 FunctionTemplateInfo* expected_receiver_type_; 769 FunctionTemplateInfo* expected_receiver_type_;
774 CallHandlerInfo* api_call_info_; 770 CallHandlerInfo* api_call_info_;
775 }; 771 };
776 772
777 } } // namespace v8::internal 773 } } // namespace v8::internal
778 774
779 #endif // V8_STUB_CACHE_H_ 775 #endif // V8_STUB_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698