OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 // Compute the property keys from the interceptor. | 525 // Compute the property keys from the interceptor. |
526 // TODO(rossberg): support symbols in API, and filter here if needed. | 526 // TODO(rossberg): support symbols in API, and filter here if needed. |
527 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSReceiver> receiver, | 527 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSReceiver> receiver, |
528 Handle<JSObject> object) { | 528 Handle<JSObject> object) { |
529 Isolate* isolate = receiver->GetIsolate(); | 529 Isolate* isolate = receiver->GetIsolate(); |
530 Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor()); | 530 Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor()); |
531 PropertyCallbackArguments | 531 PropertyCallbackArguments |
532 args(isolate, interceptor->data(), *receiver, *object); | 532 args(isolate, interceptor->data(), *receiver, *object); |
533 v8::Handle<v8::Array> result; | 533 v8::Handle<v8::Array> result; |
534 if (!interceptor->enumerator()->IsUndefined()) { | 534 if (!interceptor->enumerator()->IsUndefined()) { |
535 v8::NamedPropertyEnumerator enum_fun = | 535 v8::NamedPropertyEnumeratorCallback enum_fun = |
536 v8::ToCData<v8::NamedPropertyEnumerator>(interceptor->enumerator()); | 536 v8::ToCData<v8::NamedPropertyEnumeratorCallback>( |
| 537 interceptor->enumerator()); |
537 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); | 538 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); |
538 result = args.Call(enum_fun); | 539 result = args.Call(enum_fun); |
539 } | 540 } |
540 #if ENABLE_EXTRA_CHECKS | 541 #if ENABLE_EXTRA_CHECKS |
541 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); | 542 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); |
542 #endif | 543 #endif |
543 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), | 544 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), |
544 result); | 545 result); |
545 } | 546 } |
546 | 547 |
547 | 548 |
548 // Compute the element keys from the interceptor. | 549 // Compute the element keys from the interceptor. |
549 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, | 550 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, |
550 Handle<JSObject> object) { | 551 Handle<JSObject> object) { |
551 Isolate* isolate = receiver->GetIsolate(); | 552 Isolate* isolate = receiver->GetIsolate(); |
552 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); | 553 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); |
553 PropertyCallbackArguments | 554 PropertyCallbackArguments |
554 args(isolate, interceptor->data(), *receiver, *object); | 555 args(isolate, interceptor->data(), *receiver, *object); |
555 v8::Handle<v8::Array> result; | 556 v8::Handle<v8::Array> result; |
556 if (!interceptor->enumerator()->IsUndefined()) { | 557 if (!interceptor->enumerator()->IsUndefined()) { |
557 v8::IndexedPropertyEnumerator enum_fun = | 558 v8::IndexedPropertyEnumeratorCallback enum_fun = |
558 v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator()); | 559 v8::ToCData<v8::IndexedPropertyEnumeratorCallback>( |
| 560 interceptor->enumerator()); |
559 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); | 561 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); |
560 result = args.Call(enum_fun); | 562 result = args.Call(enum_fun); |
561 #if ENABLE_EXTRA_CHECKS | 563 #if ENABLE_EXTRA_CHECKS |
562 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); | 564 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); |
563 #endif | 565 #endif |
564 } | 566 } |
565 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), | 567 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), |
566 result); | 568 result); |
567 } | 569 } |
568 | 570 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 data->next = prev_next_; | 900 data->next = prev_next_; |
899 data->limit = prev_limit_; | 901 data->limit = prev_limit_; |
900 #ifdef DEBUG | 902 #ifdef DEBUG |
901 handles_detached_ = true; | 903 handles_detached_ = true; |
902 #endif | 904 #endif |
903 return deferred; | 905 return deferred; |
904 } | 906 } |
905 | 907 |
906 | 908 |
907 } } // namespace v8::internal | 909 } } // namespace v8::internal |
OLD | NEW |