Skip to content
Newer
Older
100644 45 lines (35 sloc) 1.24 KB
214fe7e Refactor Message out
Evan Phoenix authored Mar 31, 2009
1 #include "dispatch.hpp"
2 #include "arguments.hpp"
3 #include "lookup_data.hpp"
ddc3c3e Cull SendSite and Selector
Evan Phoenix authored Dec 11, 2009
4 #include "global_cache.hpp"
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
5
6 #include "builtin/module.hpp"
7 #include "builtin/class.hpp"
8 #include "builtin/symbol.hpp"
9 #include "builtin/executable.hpp"
10
11 namespace rubinius {
8745b10 Add Rubinius.method_missing_reason, improve method_missing exception
Evan Phoenix authored Dec 10, 2009
12 Object* Dispatch::send(STATE, CallFrame* call_frame, Arguments& args,
13 MethodMissingReason reason)
14 {
a50f20c @jfirebaugh Fix #public_send to raise when sending protected methods
jfirebaugh authored Dec 1, 2011
15 LookupData lookup(args.recv(), args.recv()->lookup_begin(state), G(sym_protected));
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
16
8745b10 Add Rubinius.method_missing_reason, improve method_missing exception
Evan Phoenix authored Dec 10, 2009
17 return send(state, call_frame, lookup, args, reason);
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
18 }
19
20 Object* Dispatch::send(STATE, CallFrame* call_frame, LookupData& lookup,
8745b10 Add Rubinius.method_missing_reason, improve method_missing exception
Evan Phoenix authored Dec 10, 2009
21 Arguments& args, MethodMissingReason reason)
22 {
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
23 Symbol* original_name = name;
24
ddc3c3e Cull SendSite and Selector
Evan Phoenix authored Dec 11, 2009
25 if(!GlobalCache::resolve(state, name, *this, lookup)) {
35a49f3 @evanphx Introduce State class as STATE
evanphx authored Nov 1, 2011
26 state->vm()->set_method_missing_reason(reason);
8745b10 Add Rubinius.method_missing_reason, improve method_missing exception
Evan Phoenix authored Dec 10, 2009
27
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
28 method_missing = true;
a50f20c @jfirebaugh Fix #public_send to raise when sending protected methods
jfirebaugh authored Dec 2, 2011
29 lookup.min_visibility = G(sym_private);
ddc3c3e Cull SendSite and Selector
Evan Phoenix authored Dec 11, 2009
30 if(!GlobalCache::resolve(state, G(sym_method_missing), *this, lookup)) {
8745b10 Add Rubinius.method_missing_reason, improve method_missing exception
Evan Phoenix authored Dec 10, 2009
31 Exception::internal_error(state, call_frame, "no method_missing");
32 return 0;
33 }
7b95ba8 Fix method cache/method_missing bug
Evan Phoenix authored Mar 4, 2010
34
35 method_missing = true;
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
36 }
37
38 if(method_missing) {
39 args.unshift(state, original_name);
40 }
41
45a2de9 Change call protocol to remove Dispatch&. Make IC thread-safe.
Evan Phoenix authored Aug 16, 2010
42 return method->execute(state, call_frame, method, module, args);
214fe7e Refactor Message out
Evan Phoenix authored Apr 1, 2009
43 }
44 }
Something went wrong with that request. Please try again.