OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_API_ARGUMENTS_H_ | 5 #ifndef V8_API_ARGUMENTS_H_ |
6 #define V8_API_ARGUMENTS_H_ | 6 #define V8_API_ARGUMENTS_H_ |
7 | 7 |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/tracing/trace-event.h" | 10 #include "src/tracing/trace-event.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return reinterpret_cast<Isolate*>(this->begin()[T::kIsolateIndex]); | 51 return reinterpret_cast<Isolate*>(this->begin()[T::kIsolateIndex]); |
52 } | 52 } |
53 }; | 53 }; |
54 | 54 |
55 template <typename T> | 55 template <typename T> |
56 template <typename V> | 56 template <typename V> |
57 Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) { | 57 Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) { |
58 // Check the ReturnValue. | 58 // Check the ReturnValue. |
59 Object** handle = &this->begin()[kReturnValueOffset]; | 59 Object** handle = &this->begin()[kReturnValueOffset]; |
60 // Nothing was set, return empty handle as per previous behaviour. | 60 // Nothing was set, return empty handle as per previous behaviour. |
61 if ((*handle)->IsTheHole()) return Handle<V>(); | 61 if ((*handle)->IsTheHole(isolate)) return Handle<V>(); |
62 Handle<V> result = Handle<V>::cast(Handle<Object>(handle)); | 62 Handle<V> result = Handle<V>::cast(Handle<Object>(handle)); |
63 result->VerifyApiCallResultType(); | 63 result->VerifyApiCallResultType(); |
64 return result; | 64 return result; |
65 } | 65 } |
66 | 66 |
67 class PropertyCallbackArguments | 67 class PropertyCallbackArguments |
68 : public CustomArguments<PropertyCallbackInfo<Value> > { | 68 : public CustomArguments<PropertyCallbackInfo<Value> > { |
69 public: | 69 public: |
70 typedef PropertyCallbackInfo<Value> T; | 70 typedef PropertyCallbackInfo<Value> T; |
71 typedef CustomArguments<T> Super; | 71 typedef CustomArguments<T> Super; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 private: | 253 private: |
254 internal::Object** argv_; | 254 internal::Object** argv_; |
255 int argc_; | 255 int argc_; |
256 }; | 256 }; |
257 | 257 |
258 } // namespace internal | 258 } // namespace internal |
259 } // namespace v8 | 259 } // namespace v8 |
260 | 260 |
261 #endif // V8_API_ARGUMENTS_H_ | 261 #endif // V8_API_ARGUMENTS_H_ |
OLD | NEW |