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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor()); | 558 Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor()); |
559 CustomArguments args(isolate, interceptor->data(), *receiver, *object); | 559 CustomArguments args(isolate, interceptor->data(), *receiver, *object); |
560 v8::AccessorInfo info(args.end()); | 560 v8::AccessorInfo info(args.end()); |
561 v8::Handle<v8::Array> result; | 561 v8::Handle<v8::Array> result; |
562 if (!interceptor->enumerator()->IsUndefined()) { | 562 if (!interceptor->enumerator()->IsUndefined()) { |
563 v8::NamedPropertyEnumerator enum_fun = | 563 v8::NamedPropertyEnumerator enum_fun = |
564 v8::ToCData<v8::NamedPropertyEnumerator>(interceptor->enumerator()); | 564 v8::ToCData<v8::NamedPropertyEnumerator>(interceptor->enumerator()); |
565 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); | 565 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); |
566 { | 566 { |
567 // Leaving JavaScript. | 567 // Leaving JavaScript. |
568 VMState state(isolate, EXTERNAL); | 568 VMState<EXTERNAL> state(isolate); |
569 result = enum_fun(info); | 569 result = enum_fun(info); |
570 } | 570 } |
571 } | 571 } |
572 #if ENABLE_EXTRA_CHECKS | 572 #if ENABLE_EXTRA_CHECKS |
573 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); | 573 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); |
574 #endif | 574 #endif |
575 return result; | 575 return result; |
576 } | 576 } |
577 | 577 |
578 | 578 |
579 // Compute the element keys from the interceptor. | 579 // Compute the element keys from the interceptor. |
580 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, | 580 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, |
581 Handle<JSObject> object) { | 581 Handle<JSObject> object) { |
582 Isolate* isolate = receiver->GetIsolate(); | 582 Isolate* isolate = receiver->GetIsolate(); |
583 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); | 583 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); |
584 CustomArguments args(isolate, interceptor->data(), *receiver, *object); | 584 CustomArguments args(isolate, interceptor->data(), *receiver, *object); |
585 v8::AccessorInfo info(args.end()); | 585 v8::AccessorInfo info(args.end()); |
586 v8::Handle<v8::Array> result; | 586 v8::Handle<v8::Array> result; |
587 if (!interceptor->enumerator()->IsUndefined()) { | 587 if (!interceptor->enumerator()->IsUndefined()) { |
588 v8::IndexedPropertyEnumerator enum_fun = | 588 v8::IndexedPropertyEnumerator enum_fun = |
589 v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator()); | 589 v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator()); |
590 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); | 590 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); |
591 { | 591 { |
592 // Leaving JavaScript. | 592 // Leaving JavaScript. |
593 VMState state(isolate, EXTERNAL); | 593 VMState<EXTERNAL> state(isolate); |
594 result = enum_fun(info); | 594 result = enum_fun(info); |
595 #if ENABLE_EXTRA_CHECKS | 595 #if ENABLE_EXTRA_CHECKS |
596 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); | 596 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); |
597 #endif | 597 #endif |
598 } | 598 } |
599 } | 599 } |
600 return result; | 600 return result; |
601 } | 601 } |
602 | 602 |
603 | 603 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 data->next = prev_next_; | 928 data->next = prev_next_; |
929 data->limit = prev_limit_; | 929 data->limit = prev_limit_; |
930 #ifdef DEBUG | 930 #ifdef DEBUG |
931 handles_detached_ = true; | 931 handles_detached_ = true; |
932 #endif | 932 #endif |
933 return deferred; | 933 return deferred; |
934 } | 934 } |
935 | 935 |
936 | 936 |
937 } } // namespace v8::internal | 937 } } // namespace v8::internal |
OLD | NEW |