OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 | 77 |
78 template<typename T> | 78 template<typename T> |
79 template<typename V> | 79 template<typename V> |
80 v8::Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) { | 80 v8::Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) { |
81 // Check the ReturnValue. | 81 // Check the ReturnValue. |
82 Object** handle = &this->end()[kReturnValueOffset]; | 82 Object** handle = &this->end()[kReturnValueOffset]; |
83 // Nothing was set, return empty handle as per previous behaviour. | 83 // Nothing was set, return empty handle as per previous behaviour. |
84 if ((*handle)->IsTheHole()) return v8::Handle<V>(); | 84 if ((*handle)->IsTheHole()) return v8::Handle<V>(); |
85 return v8::Handle<V>(reinterpret_cast<V*>(handle)); | 85 return Utils::Convert<Object, V>(Handle<Object>(handle)); |
86 } | 86 } |
87 | 87 |
88 | 88 |
89 v8::Handle<v8::Value> FunctionCallbackArguments::Call(InvocationCallback f) { | 89 v8::Handle<v8::Value> FunctionCallbackArguments::Call(InvocationCallback f) { |
90 Isolate* isolate = this->isolate(); | 90 Isolate* isolate = this->isolate(); |
91 void* f_as_void = CallbackTable::FunctionToVoidPtr(f); | 91 void* f_as_void = CallbackTable::FunctionToVoidPtr(f); |
92 bool new_style = CallbackTable::ReturnsVoid(isolate, f_as_void); | 92 bool new_style = CallbackTable::ReturnsVoid(isolate, f_as_void); |
93 if (new_style) { | 93 if (new_style) { |
94 FunctionCallback c = reinterpret_cast<FunctionCallback>(f); | 94 FunctionCallback c = reinterpret_cast<FunctionCallback>(f); |
95 FunctionCallbackInfo<v8::Value> info(end(), | 95 FunctionCallbackInfo<v8::Value> info(end(), |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(WRITE_CALL_2_VOID) | 186 FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(WRITE_CALL_2_VOID) |
187 | 187 |
188 #undef WRITE_CALL_0 | 188 #undef WRITE_CALL_0 |
189 #undef WRITE_CALL_1 | 189 #undef WRITE_CALL_1 |
190 #undef WRITE_CALL_2 | 190 #undef WRITE_CALL_2 |
191 #undef WRITE_CALL_2_VOID | 191 #undef WRITE_CALL_2_VOID |
192 | 192 |
193 | 193 |
194 } } // namespace v8::internal | 194 } } // namespace v8::internal |
195 | 195 |
OLD | NEW |