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

Side by Side Diff: src/handles.cc

Issue 14139033: Clean up VMState a little bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed mistake Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/global-handles.cc ('k') | src/heap.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 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
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
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
OLDNEW
« no previous file with comments | « src/global-handles.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698