Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 146 lines (134 sloc) 5.382 kB
9595725 update copyrights to 2011
Laurent Sansonetti authored
1 /*
2 * This file is covered by the Ruby license. See COPYING for more details.
7d7d3e8 @ferrous26 Change ownership to The MacRuby Team and update copyrights
ferrous26 authored
3 *
4 * Copyright (C) 2012, The MacRuby Team. All rights reserved.
9595725 update copyrights to 2011
Laurent Sansonetti authored
5 * Copyright (C) 2007-2011, Apple Inc. All rights reserved.
6 * Copyright (C) 2004-2007 Koichi Sasada
7 */
9c1d230 committing experimental branch content
Laurent Sansonetti authored
8
d0898dd include/ruby/macruby.h -> macruby_internal.h
Laurent Sansonetti authored
9 #include "macruby_internal.h"
301b43b ported to rb_objc_block_call() + misc cleanup
Laurent Sansonetti authored
10 #include "ruby/node.h"
cb65416 the great schism, part I
Laurent Sansonetti authored
11 #include "vm.h"
9c1d230 committing experimental branch content
Laurent Sansonetti authored
12
13 #define extern
14 #include "id.h"
15 #undef extern
16
17 void
18 Init_id(void)
19 {
20 /* Symbols */
21 symIFUNC = ID2SYM(rb_intern("<IFUNC>"));
22 symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
23
24 /* IDs */
25 idPLUS = rb_intern("+");
26 idMINUS = rb_intern("-");
27 idMULT = rb_intern("*");
28 idDIV = rb_intern("/");
29 idMOD = rb_intern("%");
30 idLT = rb_intern("<");
31 idLTLT = rb_intern("<<");
32 idLE = rb_intern("<=");
33 idGT = rb_intern(">");
34 idGE = rb_intern(">=");
35 idEq = rb_intern("==");
36 idEqq = rb_intern("===");
37 idBackquote = rb_intern("`");
38 idEqTilde = rb_intern("=~");
39 idNot = rb_intern("!");
40 idNeq = rb_intern("!=");
c1833dd some work on garbage collecting singleton classes - disabled for now …
Laurent Sansonetti authored
41 idAttached = rb_intern("__attached__");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
42 #if WITH_OBJC
43 selPLUS = sel_registerName("+:");
44 selMINUS = sel_registerName("-:");
45 selMULT = sel_registerName("*:");
46 selDIV = sel_registerName("/:");
47 selMOD = sel_registerName("%:");
e59fe57 fixed String#sum to accept bits argument greater than 64 (logic impor…
Laurent Sansonetti authored
48 selAND = sel_registerName("&:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
49 selEq = sel_registerName("==:");
50 selNeq = sel_registerName("!=:");
35d9f66 optimized rb_num_coerce_bin() calls + optimized complex.c to use the …
Laurent Sansonetti authored
51 selCmp = sel_registerName("<=>:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
52 selLT = sel_registerName("<:");
53 selLE = sel_registerName("<=:");
54 selGT = sel_registerName(">:");
55 selGE = sel_registerName(">=:");
56 selLTLT = sel_registerName("<<:");
57 selAREF = sel_registerName("[]:");
58 selASET = sel_registerName("[]=:");
59 selLength = sel_registerName("length");
60 selSucc = sel_registerName("succ");
61 selNot = sel_registerName("!");
19f18d3 a new Symbol class, unicode-aware + refactored/cleaned symbol generation
Laurent Sansonetti authored
62 selNot2 = sel_registerName("!:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
63 selAlloc = sel_registerName("alloc");
f0291bf define -allocWithZone: and not -alloc on every new Ruby class
Laurent Sansonetti authored
64 selAllocWithZone = sel_registerName("allocWithZone:");
06f4a0c create -copyWithZone: on every new Object-based Ruby class
Laurent Sansonetti authored
65 selCopyWithZone = sel_registerName("copyWithZone:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
66 selInit = sel_registerName("init");
67 selInitialize = sel_registerName("initialize");
68 selInitialize2 = sel_registerName("initialize:");
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
69 selInitializeCopy = sel_registerName("initialize_copy:");
0a52569 @Watson1978 Object#clone calls initialize_clone hook
Watson1978 authored
70 selInitializeClone = sel_registerName("initialize_clone:");
b3d3de8 @Watson1978 Object#dup calls initialize_dup hook
Watson1978 authored
71 selInitializeDup = sel_registerName("initialize_dup:");
a3ff57f overwrite -[NSObject description] in every new subclass + optimized o…
Laurent Sansonetti authored
72 selDescription = sel_registerName("description");
73 selInspect = sel_registerName("inspect");
792d1ad implemented Method#to_proc, fixed Hash.new{}
Laurent Sansonetti authored
74 selNew = sel_registerName("new");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
75 selRespondTo = sel_registerName("respond_to?:");
76 selMethodMissing = sel_registerName("method_missing:");
927e7ec call const_missing with a direct VM call
Laurent Sansonetti authored
77 selConstMissing = sel_registerName("const_missing:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
78 selCopy = sel_registerName("copy");
28f110b removed the previous bytestring code and now use the new one
Laurent Sansonetti authored
79 selMutableCopy = sel_registerName("mutableCopy");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
80 sel_zone = sel_registerName("zone");
81 selToS = sel_registerName("to_s");
3d5760c more small Array optimizations
Laurent Sansonetti authored
82 selToAry = sel_registerName("to_ary");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
83 selSend = sel_registerName("send:");
84 sel__send__ = sel_registerName("__send__:");
639c64d implemented ObjectSpace finalizers (experimental)
Laurent Sansonetti authored
85 selCall = sel_registerName("call:");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
86 selEqTilde = sel_registerName("=~:");
c59aa3c working on a new objc dispatch, marked a few methods are always_inline
Laurent Sansonetti authored
87 selClass = sel_registerName("class");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
88 selEval = sel_registerName("eval:");
084a52a a faster implementation of dvars + fixed eval bugs + preliminary impl…
Laurent Sansonetti authored
89 selInstanceEval = sel_registerName("instance_eval:");
90 selClassEval = sel_registerName("class_eval:");
91 selModuleEval = sel_registerName("module_eval:");
92 selLocalVariables = sel_registerName("local_variables");
93 selBinding = sel_registerName("binding");
6757fc6 @takaokouji If a call to below methods is detected in a method at compile time, j…
takaokouji authored
94 selNesting = sel_registerName("nesting");
95 selConstants = sel_registerName("constants");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
96 selEach = sel_registerName("each");
97 selEqq = sel_registerName("===:");
6a7c8b6 implemented struct #dup/#clone
Laurent Sansonetti authored
98 selDup = sel_registerName("dup");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
99 selBackquote = sel_registerName("`:");
100 selMethodAdded = sel_registerName("method_added:");
101 selSingletonMethodAdded = sel_registerName("singleton_method_added:");
e732379 moved the removed_method code to the VM + fixed undef_method callbacks
Laurent Sansonetti authored
102 selMethodRemoved = sel_registerName("method_removed:");
103 selSingletonMethodRemoved = sel_registerName("singleton_method_removed:");
104 selMethodUndefined = sel_registerName("method_undefined:");
105 selSingletonMethodUndefined = sel_registerName("singleton_method_undefined:");
f0291bf define -allocWithZone: and not -alloc on every new Ruby class
Laurent Sansonetti authored
106 selIsEqual = sel_registerName("isEqual:");
c0d189d IO#write: if the receiver isn't an IO object, dispatches the write: s…
Laurent Sansonetti authored
107 selWrite = sel_registerName("write:");
9590d40 fixing and adding several missing ruby method features
Laurent Sansonetti authored
108 selInherited = sel_registerName("inherited:");
295167b - Added NODE_LAMBDA compatibility (for the "->" syntax)
Thibault Martin-Lagardette authored
109 selLambda = sel_registerName("lambda");
420a9db - Fixes #531 by implementing #[] and #[]= as shortcuts for objectFor…
Thibault Martin-Lagardette authored
110 selObjectForKey = sel_registerName("objectForKey:");
111 selSetObjectForKey = sel_registerName("setObject:forKey:");
c1833dd some work on garbage collecting singleton classes - disabled for now …
Laurent Sansonetti authored
112 selFinalize = sel_registerName("finalize");
00b147f add basic support for __method__ and __callee__
Laurent Sansonetti authored
113
114 sel__method__= sel_registerName("__method__");
115 sel__callee__ = sel_registerName("__callee__");
9c1d230 committing experimental branch content
Laurent Sansonetti authored
116 #endif
117
118 idAREF = rb_intern("[]");
119 idASET = rb_intern("[]=");
120
121 idEach = rb_intern("each");
122 idTimes = rb_intern("times");
123 idLength = rb_intern("length");
124 idLambda = rb_intern("lambda");
125 idIntern = rb_intern("intern");
126 idGets = rb_intern("gets");
127 idSucc = rb_intern("succ");
128 idEnd = rb_intern("end");
129 idRangeEachLT = rb_intern("Range#each#LT");
130 idRangeEachLE = rb_intern("Range#each#LE");
131 idArrayEach = rb_intern("Array#each");
132 idMethodMissing = rb_intern("method_missing");
133
134 idThrowState = rb_intern("#__ThrowState__");
135
136 idSend = rb_intern("send");
137 id__send__ = rb_intern("__send__");
138
139 idRespond_to = rb_intern("respond_to?");
140 idInitialize = rb_intern("initialize");
141
142 idIncludedModules = rb_intern("__included_modules__");
143 idIncludedInClasses = rb_intern("__included_in_classes__");
144 idAncestors = rb_intern("__ancestors__");
145 }
Something went wrong with that request. Please try again.