OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include "src/messages.h" | 5 #include "src/messages.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/keys.h" | 10 #include "src/keys.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 if (accessors->IsAccessorPair()) { | 242 if (accessors->IsAccessorPair()) { |
243 Handle<AccessorPair> pair = Handle<AccessorPair>::cast(accessors); | 243 Handle<AccessorPair> pair = Handle<AccessorPair>::cast(accessors); |
244 return pair->getter() == *fun || pair->setter() == *fun; | 244 return pair->getter() == *fun || pair->setter() == *fun; |
245 } | 245 } |
246 } | 246 } |
247 return false; | 247 return false; |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 Handle<Object> CallSite::GetMethodName() { | 251 Handle<Object> CallSite::GetMethodName() { |
252 if (!IsJavaScript() || receiver_->IsNull(isolate_) || | 252 if (!IsJavaScript() || receiver_->IsNull() || |
253 receiver_->IsUndefined(isolate_)) { | 253 receiver_->IsUndefined(isolate_)) { |
254 return isolate_->factory()->null_value(); | 254 return isolate_->factory()->null_value(); |
255 } | 255 } |
256 Handle<JSReceiver> receiver = | 256 Handle<JSReceiver> receiver = |
257 Object::ToObject(isolate_, receiver_).ToHandleChecked(); | 257 Object::ToObject(isolate_, receiver_).ToHandleChecked(); |
258 if (!receiver->IsJSObject()) { | 258 if (!receiver->IsJSObject()) { |
259 return isolate_->factory()->null_value(); | 259 return isolate_->factory()->null_value(); |
260 } | 260 } |
261 | 261 |
262 Handle<JSObject> obj = Handle<JSObject>::cast(receiver); | 262 Handle<JSObject> obj = Handle<JSObject>::cast(receiver); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 bool CallSite::IsNative() { | 334 bool CallSite::IsNative() { |
335 if (!IsJavaScript()) return false; | 335 if (!IsJavaScript()) return false; |
336 Handle<Object> script(fun_->shared()->script(), isolate_); | 336 Handle<Object> script(fun_->shared()->script(), isolate_); |
337 return script->IsScript() && | 337 return script->IsScript() && |
338 Handle<Script>::cast(script)->type() == Script::TYPE_NATIVE; | 338 Handle<Script>::cast(script)->type() == Script::TYPE_NATIVE; |
339 } | 339 } |
340 | 340 |
341 | 341 |
342 bool CallSite::IsToplevel() { | 342 bool CallSite::IsToplevel() { |
343 if (IsWasm()) return false; | 343 if (IsWasm()) return false; |
344 return receiver_->IsJSGlobalProxy() || receiver_->IsNull(isolate_) || | 344 return receiver_->IsJSGlobalProxy() || receiver_->IsNull() || |
345 receiver_->IsUndefined(isolate_); | 345 receiver_->IsUndefined(isolate_); |
346 } | 346 } |
347 | 347 |
348 | 348 |
349 bool CallSite::IsEval() { | 349 bool CallSite::IsEval() { |
350 if (!IsJavaScript()) return false; | 350 if (!IsJavaScript()) return false; |
351 Handle<Object> script(fun_->shared()->script(), isolate_); | 351 Handle<Object> script(fun_->shared()->script(), isolate_); |
352 return script->IsScript() && | 352 return script->IsScript() && |
353 Handle<Script>::cast(script)->compilation_type() == | 353 Handle<Script>::cast(script)->compilation_type() == |
354 Script::COMPILATION_TYPE_EVAL; | 354 Script::COMPILATION_TYPE_EVAL; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 builder.AppendCharacter(*c); | 441 builder.AppendCharacter(*c); |
442 } | 442 } |
443 } | 443 } |
444 | 444 |
445 return builder.Finish(); | 445 return builder.Finish(); |
446 } | 446 } |
447 | 447 |
448 | 448 |
449 } // namespace internal | 449 } // namespace internal |
450 } // namespace v8 | 450 } // namespace v8 |
OLD | NEW |