Skip to content
Newer
Older
100644 135 lines (117 sloc) 4.4 KB
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
1 /**********************************************************************
2
3 id.c -
4
5 $Author: ko1 $
6 created at: Thu Jul 12 04:37:51 2007
7
8 Copyright (C) 2004-2007 Koichi Sasada
9
10 **********************************************************************/
11
12 #include "ruby/ruby.h"
301b43b ported to rb_objc_block_call() + misc cleanup
Laurent Sansonetti authored Apr 5, 2009
13 #include "ruby/node.h"
cb65416 the great schism, part I
Laurent Sansonetti authored May 23, 2009
14 #include "vm.h"
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
15
16 #define extern
17 #include "id.h"
18 #undef extern
19
20 void
21 Init_id(void)
22 {
23 /* Symbols */
24 symIFUNC = ID2SYM(rb_intern("<IFUNC>"));
25 symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
26
27 /* IDs */
28 idPLUS = rb_intern("+");
29 idMINUS = rb_intern("-");
30 idMULT = rb_intern("*");
31 idDIV = rb_intern("/");
32 idMOD = rb_intern("%");
33 idLT = rb_intern("<");
34 idLTLT = rb_intern("<<");
35 idLE = rb_intern("<=");
36 idGT = rb_intern(">");
37 idGE = rb_intern(">=");
38 idEq = rb_intern("==");
39 idEqq = rb_intern("===");
40 idBackquote = rb_intern("`");
41 idEqTilde = rb_intern("=~");
42 idNot = rb_intern("!");
43 idNeq = rb_intern("!=");
44
45 #if WITH_OBJC
46 selPLUS = sel_registerName("+:");
47 selMINUS = sel_registerName("-:");
48 selMULT = sel_registerName("*:");
49 selDIV = sel_registerName("/:");
50 selMOD = sel_registerName("%:");
51 selEq = sel_registerName("==:");
52 selNeq = sel_registerName("!=:");
53 selLT = sel_registerName("<:");
54 selLE = sel_registerName("<=:");
55 selGT = sel_registerName(">:");
56 selGE = sel_registerName(">=:");
57 selLTLT = sel_registerName("<<:");
58 selAREF = sel_registerName("[]:");
59 selASET = sel_registerName("[]=:");
60 selLength = sel_registerName("length");
61 selSucc = sel_registerName("succ");
62 selNot = sel_registerName("!");
63 selAlloc = sel_registerName("alloc");
f0291bf define -allocWithZone: and not -alloc on every new Ruby class
Laurent Sansonetti authored May 29, 2009
64 selAllocWithZone = sel_registerName("allocWithZone:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
65 selInit = sel_registerName("init");
66 selInitialize = sel_registerName("initialize");
67 selInitialize2 = sel_registerName("initialize:");
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored Aug 22, 2009
68 selInitializeCopy = sel_registerName("initialize_copy:");
a3ff57f overwrite -[NSObject description] in every new subclass + optimized o…
Laurent Sansonetti authored Aug 2, 2009
69 selDescription = sel_registerName("description");
70 selInspect = sel_registerName("inspect");
792d1ad implemented Method#to_proc, fixed Hash.new{}
Laurent Sansonetti authored May 15, 2009
71 selNew = sel_registerName("new");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
72 selRespondTo = sel_registerName("respond_to?:");
73 selMethodMissing = sel_registerName("method_missing:");
74 selCopy = sel_registerName("copy");
28f110b removed the previous bytestring code and now use the new one
Laurent Sansonetti authored Mar 16, 2009
75 selMutableCopy = sel_registerName("mutableCopy");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
76 sel_ignored = sel_registerName("retain");
77 assert(sel_ignored == sel_registerName("release"));
78 sel_zone = sel_registerName("zone");
79 selToS = sel_registerName("to_s");
3d5760c more small Array optimizations
Laurent Sansonetti authored Aug 7, 2009
80 selToAry = sel_registerName("to_ary");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
81 selSend = sel_registerName("send:");
82 sel__send__ = sel_registerName("__send__:");
83 selEqTilde = sel_registerName("=~:");
c59aa3c working on a new objc dispatch, marked a few methods are always_inline
Laurent Sansonetti authored Apr 14, 2009
84 selClass = sel_registerName("class");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
85 selEval = sel_registerName("eval:");
084a52a a faster implementation of dvars + fixed eval bugs + preliminary impl…
Laurent Sansonetti authored Apr 3, 2009
86 selInstanceEval = sel_registerName("instance_eval:");
87 selClassEval = sel_registerName("class_eval:");
88 selModuleEval = sel_registerName("module_eval:");
89 selLocalVariables = sel_registerName("local_variables");
90 selBinding = sel_registerName("binding");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
91 selEach = sel_registerName("each");
92 selEqq = sel_registerName("===:");
6a7c8b6 implemented struct #dup/#clone
Laurent Sansonetti authored Apr 24, 2009
93 selDup = sel_registerName("dup");
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
94 selBackquote = sel_registerName("`:");
95 selMethodAdded = sel_registerName("method_added:");
96 selSingletonMethodAdded = sel_registerName("singleton_method_added:");
f0291bf define -allocWithZone: and not -alloc on every new Ruby class
Laurent Sansonetti authored May 29, 2009
97 selIsEqual = sel_registerName("isEqual:");
c0d189d IO#write: if the receiver isn't an IO object, dispatches the write: s…
Laurent Sansonetti authored Jul 27, 2009
98 selWrite = sel_registerName("write:");
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored Aug 22, 2009
99 selInherited = sel_registerName("inherited:");
301b43b ported to rb_objc_block_call() + misc cleanup
Laurent Sansonetti authored Apr 5, 2009
100
101 cacheEach = rb_vm_get_call_cache(selEach);
9c1d230 committing experimental branch content
Laurent Sansonetti authored Mar 11, 2009
102 #endif
103
104 idAREF = rb_intern("[]");
105 idASET = rb_intern("[]=");
106
107 idEach = rb_intern("each");
108 idTimes = rb_intern("times");
109 idLength = rb_intern("length");
110 idLambda = rb_intern("lambda");
111 idIntern = rb_intern("intern");
112 idGets = rb_intern("gets");
113 idSucc = rb_intern("succ");
114 idEnd = rb_intern("end");
115 idRangeEachLT = rb_intern("Range#each#LT");
116 idRangeEachLE = rb_intern("Range#each#LE");
117 idArrayEach = rb_intern("Array#each");
118 idMethodMissing = rb_intern("method_missing");
119
120 idThrowState = rb_intern("#__ThrowState__");
121
122 idBitblt = rb_intern("bitblt");
123 idAnswer = rb_intern("the_answer_to_life_the_universe_and_everything");
124
125 idSend = rb_intern("send");
126 id__send__ = rb_intern("__send__");
127
128 idRespond_to = rb_intern("respond_to?");
129 idInitialize = rb_intern("initialize");
130
131 idIncludedModules = rb_intern("__included_modules__");
132 idIncludedInClasses = rb_intern("__included_in_classes__");
133 idAncestors = rb_intern("__ancestors__");
134 }
Something went wrong with that request. Please try again.