Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: src/api-arguments.h

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | src/api-natives.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/api-natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698