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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 Handle<JSObject> object) { | 550 Handle<JSObject> object) { |
551 Isolate* isolate = receiver->GetIsolate(); | 551 Isolate* isolate = receiver->GetIsolate(); |
552 Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor()); | 552 Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor()); |
553 PropertyCallbackArguments | 553 PropertyCallbackArguments |
554 args(isolate, interceptor->data(), *receiver, *object); | 554 args(isolate, interceptor->data(), *receiver, *object); |
555 v8::Handle<v8::Array> result; | 555 v8::Handle<v8::Array> result; |
556 if (!interceptor->enumerator()->IsUndefined()) { | 556 if (!interceptor->enumerator()->IsUndefined()) { |
557 v8::NamedPropertyEnumerator enum_fun = | 557 v8::NamedPropertyEnumerator enum_fun = |
558 v8::ToCData<v8::NamedPropertyEnumerator>(interceptor->enumerator()); | 558 v8::ToCData<v8::NamedPropertyEnumerator>(interceptor->enumerator()); |
559 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); | 559 LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object)); |
560 { | 560 result = args.Call(enum_fun); |
561 // Leaving JavaScript. | |
562 VMState<EXTERNAL> state(isolate); | |
563 result = args.Call(enum_fun); | |
564 } | |
565 } | 561 } |
566 #if ENABLE_EXTRA_CHECKS | 562 #if ENABLE_EXTRA_CHECKS |
567 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); | 563 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); |
568 #endif | 564 #endif |
569 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), | 565 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), |
570 result); | 566 result); |
571 } | 567 } |
572 | 568 |
573 | 569 |
574 // Compute the element keys from the interceptor. | 570 // Compute the element keys from the interceptor. |
575 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, | 571 v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver, |
576 Handle<JSObject> object) { | 572 Handle<JSObject> object) { |
577 Isolate* isolate = receiver->GetIsolate(); | 573 Isolate* isolate = receiver->GetIsolate(); |
578 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); | 574 Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor()); |
579 PropertyCallbackArguments | 575 PropertyCallbackArguments |
580 args(isolate, interceptor->data(), *receiver, *object); | 576 args(isolate, interceptor->data(), *receiver, *object); |
581 v8::Handle<v8::Array> result; | 577 v8::Handle<v8::Array> result; |
582 if (!interceptor->enumerator()->IsUndefined()) { | 578 if (!interceptor->enumerator()->IsUndefined()) { |
583 v8::IndexedPropertyEnumerator enum_fun = | 579 v8::IndexedPropertyEnumerator enum_fun = |
584 v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator()); | 580 v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator()); |
585 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); | 581 LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object)); |
586 { | 582 result = args.Call(enum_fun); |
587 // Leaving JavaScript. | |
588 VMState<EXTERNAL> state(isolate); | |
589 result = args.Call(enum_fun); | |
590 #if ENABLE_EXTRA_CHECKS | 583 #if ENABLE_EXTRA_CHECKS |
591 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); | 584 CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject()); |
592 #endif | 585 #endif |
593 } | |
594 } | 586 } |
595 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), | 587 return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate), |
596 result); | 588 result); |
597 } | 589 } |
598 | 590 |
599 | 591 |
600 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) { | 592 Handle<Object> GetScriptNameOrSourceURL(Handle<Script> script) { |
601 Isolate* isolate = script->GetIsolate(); | 593 Isolate* isolate = script->GetIsolate(); |
602 Handle<String> name_or_source_url_key = | 594 Handle<String> name_or_source_url_key = |
603 isolate->factory()->InternalizeOneByteString( | 595 isolate->factory()->InternalizeOneByteString( |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 data->next = prev_next_; | 916 data->next = prev_next_; |
925 data->limit = prev_limit_; | 917 data->limit = prev_limit_; |
926 #ifdef DEBUG | 918 #ifdef DEBUG |
927 handles_detached_ = true; | 919 handles_detached_ = true; |
928 #endif | 920 #endif |
929 return deferred; | 921 return deferred; |
930 } | 922 } |
931 | 923 |
932 | 924 |
933 } } // namespace v8::internal | 925 } } // namespace v8::internal |
OLD | NEW |