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

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

Issue 6062002: Merge 6006:6095 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 10 years 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/string-stream.cc ('k') | src/stub-cache.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 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 Map* transition, 636 Map* transition,
637 String* name); 637 String* name);
638 638
639 MUST_USE_RESULT MaybeObject* CompileStoreSpecialized(JSObject* receiver); 639 MUST_USE_RESULT MaybeObject* CompileStoreSpecialized(JSObject* receiver);
640 640
641 private: 641 private:
642 MaybeObject* GetCode(PropertyType type, String* name); 642 MaybeObject* GetCode(PropertyType type, String* name);
643 }; 643 };
644 644
645 645
646 // List of functions with custom constant call IC stubs. 646 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call
647 // 647 // IC stubs.
648 // Installation of custom call generators for the selected builtins is 648 #define CUSTOM_CALL_IC_GENERATORS(V) \
649 // handled by the bootstrapper. 649 V(ArrayPush) \
650 // 650 V(ArrayPop) \
651 // Each entry has a name of a global object property holding an object 651 V(StringCharCodeAt) \
652 // optionally followed by ".prototype" (this controls whether the 652 V(StringCharAt) \
653 // generator is set on the object itself or, in case it's a function, 653 V(StringFromCharCode) \
654 // on the its instance prototype), a name of a builtin function on the 654 V(MathFloor) \
655 // object (the one the generator is set for), and a name of the 655 V(MathAbs)
656 // generator (used to build ids and generator function names).
657 #define CUSTOM_CALL_IC_GENERATORS(V) \
658 V(Array.prototype, push, ArrayPush) \
659 V(Array.prototype, pop, ArrayPop) \
660 V(String.prototype, charCodeAt, StringCharCodeAt) \
661 V(String.prototype, charAt, StringCharAt) \
662 V(String, fromCharCode, StringFromCharCode) \
663 V(Math, floor, MathFloor) \
664 V(Math, abs, MathAbs)
665 656
666 657
667 class CallStubCompiler: public StubCompiler { 658 class CallStubCompiler: public StubCompiler {
668 public: 659 public:
669 enum {
670 #define DECLARE_CALL_GENERATOR_ID(ignored1, ignore2, name) \
671 k##name##CallGenerator,
672 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR_ID)
673 #undef DECLARE_CALL_GENERATOR_ID
674 kNumCallGenerators
675 };
676
677 CallStubCompiler(int argc, 660 CallStubCompiler(int argc,
678 InLoopFlag in_loop, 661 InLoopFlag in_loop,
679 Code::Kind kind, 662 Code::Kind kind,
680 InlineCacheHolderFlag cache_holder); 663 InlineCacheHolderFlag cache_holder);
681 664
682 MUST_USE_RESULT MaybeObject* CompileCallField(JSObject* object, 665 MUST_USE_RESULT MaybeObject* CompileCallField(JSObject* object,
683 JSObject* holder, 666 JSObject* holder,
684 int index, 667 int index,
685 String* name); 668 String* name);
686 MUST_USE_RESULT MaybeObject* CompileCallConstant(Object* object, 669 MUST_USE_RESULT MaybeObject* CompileCallConstant(Object* object,
687 JSObject* holder, 670 JSObject* holder,
688 JSFunction* function, 671 JSFunction* function,
689 String* name, 672 String* name,
690 CheckType check); 673 CheckType check);
691 MUST_USE_RESULT MaybeObject* CompileCallInterceptor(JSObject* object, 674 MUST_USE_RESULT MaybeObject* CompileCallInterceptor(JSObject* object,
692 JSObject* holder, 675 JSObject* holder,
693 String* name); 676 String* name);
694 MUST_USE_RESULT MaybeObject* CompileCallGlobal(JSObject* object, 677 MUST_USE_RESULT MaybeObject* CompileCallGlobal(JSObject* object,
695 GlobalObject* holder, 678 GlobalObject* holder,
696 JSGlobalPropertyCell* cell, 679 JSGlobalPropertyCell* cell,
697 JSFunction* function, 680 JSFunction* function,
698 String* name); 681 String* name);
699 682
700 // Compiles a custom call constant/global IC using the generator 683 static bool HasCustomCallGenerator(BuiltinFunctionId id);
701 // with given id. For constant calls cell is NULL. 684
702 MUST_USE_RESULT MaybeObject* CompileCustomCall(int generator_id, 685 private:
686 // Compiles a custom call constant/global IC. For constant calls
687 // cell is NULL. Returns undefined if there is no custom call code
688 // for the given function or it can't be generated.
689 MUST_USE_RESULT MaybeObject* CompileCustomCall(BuiltinFunctionId id,
703 Object* object, 690 Object* object,
704 JSObject* holder, 691 JSObject* holder,
705 JSGlobalPropertyCell* cell, 692 JSGlobalPropertyCell* cell,
706 JSFunction* function, 693 JSFunction* function,
707 String* name); 694 String* name);
708 695
709 #define DECLARE_CALL_GENERATOR(ignored1, ignored2, name) \ 696 #define DECLARE_CALL_GENERATOR(name) \
710 MUST_USE_RESULT MaybeObject* Compile##name##Call(Object* object, \ 697 MUST_USE_RESULT MaybeObject* Compile##name##Call(Object* object, \
711 JSObject* holder, \ 698 JSObject* holder, \
712 JSGlobalPropertyCell* cell, \ 699 JSGlobalPropertyCell* cell, \
713 JSFunction* function, \ 700 JSFunction* function, \
714 String* fname); 701 String* fname);
715 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) 702 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR)
716 #undef DECLARE_CALL_GENERATOR 703 #undef DECLARE_CALL_GENERATOR
717 704
718 private:
719 const ParameterCount arguments_; 705 const ParameterCount arguments_;
720 const InLoopFlag in_loop_; 706 const InLoopFlag in_loop_;
721 const Code::Kind kind_; 707 const Code::Kind kind_;
722 const InlineCacheHolderFlag cache_holder_; 708 const InlineCacheHolderFlag cache_holder_;
723 709
724 const ParameterCount& arguments() { return arguments_; } 710 const ParameterCount& arguments() { return arguments_; }
725 711
726 MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name); 712 MUST_USE_RESULT MaybeObject* GetCode(PropertyType type, String* name);
727 713
728 // Convenience function. Calls GetCode above passing 714 // Convenience function. Calls GetCode above passing
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 789
804 JSFunction* constant_function_; 790 JSFunction* constant_function_;
805 bool is_simple_api_call_; 791 bool is_simple_api_call_;
806 FunctionTemplateInfo* expected_receiver_type_; 792 FunctionTemplateInfo* expected_receiver_type_;
807 CallHandlerInfo* api_call_info_; 793 CallHandlerInfo* api_call_info_;
808 }; 794 };
809 795
810 } } // namespace v8::internal 796 } } // namespace v8::internal
811 797
812 #endif // V8_STUB_CACHE_H_ 798 #endif // V8_STUB_CACHE_H_
OLDNEW
« no previous file with comments | « src/string-stream.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698