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

Side by Side Diff: src/objects.cc

Issue 6696042: Adding 'isolates' argument to LOG to get rid of multiple TLS fetches in profiling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Addressing code review feedback + rebase Created 9 years, 9 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/mark-compact.cc ('k') | src/platform-cygwin.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 // api style callbacks. 182 // api style callbacks.
183 if (structure->IsAccessorInfo()) { 183 if (structure->IsAccessorInfo()) {
184 AccessorInfo* data = AccessorInfo::cast(structure); 184 AccessorInfo* data = AccessorInfo::cast(structure);
185 Object* fun_obj = data->getter(); 185 Object* fun_obj = data->getter();
186 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); 186 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj);
187 HandleScope scope; 187 HandleScope scope;
188 JSObject* self = JSObject::cast(receiver); 188 JSObject* self = JSObject::cast(receiver);
189 JSObject* holder_handle = JSObject::cast(holder); 189 JSObject* holder_handle = JSObject::cast(holder);
190 Handle<String> key(name); 190 Handle<String> key(name);
191 LOG(ApiNamedPropertyAccess("load", self, name)); 191 LOG(isolate, ApiNamedPropertyAccess("load", self, name));
192 CustomArguments args(isolate, data->data(), self, holder_handle); 192 CustomArguments args(isolate, data->data(), self, holder_handle);
193 v8::AccessorInfo info(args.end()); 193 v8::AccessorInfo info(args.end());
194 v8::Handle<v8::Value> result; 194 v8::Handle<v8::Value> result;
195 { 195 {
196 // Leaving JavaScript. 196 // Leaving JavaScript.
197 VMState state(isolate, EXTERNAL); 197 VMState state(isolate, EXTERNAL);
198 result = call_fun(v8::Utils::ToLocal(key), info); 198 result = call_fun(v8::Utils::ToLocal(key), info);
199 } 199 }
200 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 200 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
201 if (result.IsEmpty()) { 201 if (result.IsEmpty()) {
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 Object* value, 1610 Object* value,
1611 PropertyAttributes attributes, 1611 PropertyAttributes attributes,
1612 StrictModeFlag strict_mode) { 1612 StrictModeFlag strict_mode) {
1613 Isolate* isolate = GetIsolate(); 1613 Isolate* isolate = GetIsolate();
1614 HandleScope scope(isolate); 1614 HandleScope scope(isolate);
1615 Handle<JSObject> this_handle(this); 1615 Handle<JSObject> this_handle(this);
1616 Handle<String> name_handle(name); 1616 Handle<String> name_handle(name);
1617 Handle<Object> value_handle(value, isolate); 1617 Handle<Object> value_handle(value, isolate);
1618 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); 1618 Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
1619 if (!interceptor->setter()->IsUndefined()) { 1619 if (!interceptor->setter()->IsUndefined()) {
1620 LOG(ApiNamedPropertyAccess("interceptor-named-set", this, name)); 1620 LOG(isolate, ApiNamedPropertyAccess("interceptor-named-set", this, name));
1621 CustomArguments args(isolate, interceptor->data(), this, this); 1621 CustomArguments args(isolate, interceptor->data(), this, this);
1622 v8::AccessorInfo info(args.end()); 1622 v8::AccessorInfo info(args.end());
1623 v8::NamedPropertySetter setter = 1623 v8::NamedPropertySetter setter =
1624 v8::ToCData<v8::NamedPropertySetter>(interceptor->setter()); 1624 v8::ToCData<v8::NamedPropertySetter>(interceptor->setter());
1625 v8::Handle<v8::Value> result; 1625 v8::Handle<v8::Value> result;
1626 { 1626 {
1627 // Leaving JavaScript. 1627 // Leaving JavaScript.
1628 VMState state(isolate, EXTERNAL); 1628 VMState state(isolate, EXTERNAL);
1629 Handle<Object> value_unhole(value->IsTheHole() ? 1629 Handle<Object> value_unhole(value->IsTheHole() ?
1630 isolate->heap()->undefined_value() : 1630 isolate->heap()->undefined_value() :
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 return *value_handle; 1681 return *value_handle;
1682 } 1682 }
1683 1683
1684 if (structure->IsAccessorInfo()) { 1684 if (structure->IsAccessorInfo()) {
1685 // api style callbacks 1685 // api style callbacks
1686 AccessorInfo* data = AccessorInfo::cast(structure); 1686 AccessorInfo* data = AccessorInfo::cast(structure);
1687 Object* call_obj = data->setter(); 1687 Object* call_obj = data->setter();
1688 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); 1688 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj);
1689 if (call_fun == NULL) return value; 1689 if (call_fun == NULL) return value;
1690 Handle<String> key(name); 1690 Handle<String> key(name);
1691 LOG(ApiNamedPropertyAccess("store", this, name)); 1691 LOG(isolate, ApiNamedPropertyAccess("store", this, name));
1692 CustomArguments args(isolate, data->data(), this, JSObject::cast(holder)); 1692 CustomArguments args(isolate, data->data(), this, JSObject::cast(holder));
1693 v8::AccessorInfo info(args.end()); 1693 v8::AccessorInfo info(args.end());
1694 { 1694 {
1695 // Leaving JavaScript. 1695 // Leaving JavaScript.
1696 VMState state(isolate, EXTERNAL); 1696 VMState state(isolate, EXTERNAL);
1697 call_fun(v8::Utils::ToLocal(key), 1697 call_fun(v8::Utils::ToLocal(key),
1698 v8::Utils::ToLocal(value_handle), 1698 v8::Utils::ToLocal(value_handle),
1699 info); 1699 info);
1700 } 1700 }
1701 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 1701 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 HandleScope scope(isolate); 2173 HandleScope scope(isolate);
2174 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); 2174 Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
2175 Handle<JSObject> receiver_handle(receiver); 2175 Handle<JSObject> receiver_handle(receiver);
2176 Handle<JSObject> holder_handle(this); 2176 Handle<JSObject> holder_handle(this);
2177 Handle<String> name_handle(name); 2177 Handle<String> name_handle(name);
2178 CustomArguments args(isolate, interceptor->data(), receiver, this); 2178 CustomArguments args(isolate, interceptor->data(), receiver, this);
2179 v8::AccessorInfo info(args.end()); 2179 v8::AccessorInfo info(args.end());
2180 if (!interceptor->query()->IsUndefined()) { 2180 if (!interceptor->query()->IsUndefined()) {
2181 v8::NamedPropertyQuery query = 2181 v8::NamedPropertyQuery query =
2182 v8::ToCData<v8::NamedPropertyQuery>(interceptor->query()); 2182 v8::ToCData<v8::NamedPropertyQuery>(interceptor->query());
2183 LOG(ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); 2183 LOG(isolate,
2184 ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name));
2184 v8::Handle<v8::Integer> result; 2185 v8::Handle<v8::Integer> result;
2185 { 2186 {
2186 // Leaving JavaScript. 2187 // Leaving JavaScript.
2187 VMState state(isolate, EXTERNAL); 2188 VMState state(isolate, EXTERNAL);
2188 result = query(v8::Utils::ToLocal(name_handle), info); 2189 result = query(v8::Utils::ToLocal(name_handle), info);
2189 } 2190 }
2190 if (!result.IsEmpty()) { 2191 if (!result.IsEmpty()) {
2191 ASSERT(result->IsInt32()); 2192 ASSERT(result->IsInt32());
2192 return static_cast<PropertyAttributes>(result->Int32Value()); 2193 return static_cast<PropertyAttributes>(result->Int32Value());
2193 } 2194 }
2194 } else if (!interceptor->getter()->IsUndefined()) { 2195 } else if (!interceptor->getter()->IsUndefined()) {
2195 v8::NamedPropertyGetter getter = 2196 v8::NamedPropertyGetter getter =
2196 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); 2197 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter());
2197 LOG(ApiNamedPropertyAccess("interceptor-named-get-has", this, name)); 2198 LOG(isolate,
2199 ApiNamedPropertyAccess("interceptor-named-get-has", this, name));
2198 v8::Handle<v8::Value> result; 2200 v8::Handle<v8::Value> result;
2199 { 2201 {
2200 // Leaving JavaScript. 2202 // Leaving JavaScript.
2201 VMState state(isolate, EXTERNAL); 2203 VMState state(isolate, EXTERNAL);
2202 result = getter(v8::Utils::ToLocal(name_handle), info); 2204 result = getter(v8::Utils::ToLocal(name_handle), info);
2203 } 2205 }
2204 if (!result.IsEmpty()) return DONT_ENUM; 2206 if (!result.IsEmpty()) return DONT_ENUM;
2205 } 2207 }
2206 return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle, 2208 return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle,
2207 *name_handle, 2209 *name_handle,
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 2562
2561 MaybeObject* JSObject::DeletePropertyWithInterceptor(String* name) { 2563 MaybeObject* JSObject::DeletePropertyWithInterceptor(String* name) {
2562 Isolate* isolate = GetIsolate(); 2564 Isolate* isolate = GetIsolate();
2563 HandleScope scope(isolate); 2565 HandleScope scope(isolate);
2564 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); 2566 Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
2565 Handle<String> name_handle(name); 2567 Handle<String> name_handle(name);
2566 Handle<JSObject> this_handle(this); 2568 Handle<JSObject> this_handle(this);
2567 if (!interceptor->deleter()->IsUndefined()) { 2569 if (!interceptor->deleter()->IsUndefined()) {
2568 v8::NamedPropertyDeleter deleter = 2570 v8::NamedPropertyDeleter deleter =
2569 v8::ToCData<v8::NamedPropertyDeleter>(interceptor->deleter()); 2571 v8::ToCData<v8::NamedPropertyDeleter>(interceptor->deleter());
2570 LOG(ApiNamedPropertyAccess("interceptor-named-delete", *this_handle, name)); 2572 LOG(isolate,
2573 ApiNamedPropertyAccess("interceptor-named-delete", *this_handle, name));
2571 CustomArguments args(isolate, interceptor->data(), this, this); 2574 CustomArguments args(isolate, interceptor->data(), this, this);
2572 v8::AccessorInfo info(args.end()); 2575 v8::AccessorInfo info(args.end());
2573 v8::Handle<v8::Boolean> result; 2576 v8::Handle<v8::Boolean> result;
2574 { 2577 {
2575 // Leaving JavaScript. 2578 // Leaving JavaScript.
2576 VMState state(isolate, EXTERNAL); 2579 VMState state(isolate, EXTERNAL);
2577 result = deleter(v8::Utils::ToLocal(name_handle), info); 2580 result = deleter(v8::Utils::ToLocal(name_handle), info);
2578 } 2581 }
2579 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 2582 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
2580 if (!result.IsEmpty()) { 2583 if (!result.IsEmpty()) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 Heap* heap = isolate->heap(); 2631 Heap* heap = isolate->heap();
2629 // Make sure that the top context does not change when doing 2632 // Make sure that the top context does not change when doing
2630 // callbacks or interceptor calls. 2633 // callbacks or interceptor calls.
2631 AssertNoContextChange ncc; 2634 AssertNoContextChange ncc;
2632 HandleScope scope(isolate); 2635 HandleScope scope(isolate);
2633 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); 2636 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
2634 if (interceptor->deleter()->IsUndefined()) return heap->false_value(); 2637 if (interceptor->deleter()->IsUndefined()) return heap->false_value();
2635 v8::IndexedPropertyDeleter deleter = 2638 v8::IndexedPropertyDeleter deleter =
2636 v8::ToCData<v8::IndexedPropertyDeleter>(interceptor->deleter()); 2639 v8::ToCData<v8::IndexedPropertyDeleter>(interceptor->deleter());
2637 Handle<JSObject> this_handle(this); 2640 Handle<JSObject> this_handle(this);
2638 LOG(ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index)); 2641 LOG(isolate,
2642 ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index));
2639 CustomArguments args(isolate, interceptor->data(), this, this); 2643 CustomArguments args(isolate, interceptor->data(), this, this);
2640 v8::AccessorInfo info(args.end()); 2644 v8::AccessorInfo info(args.end());
2641 v8::Handle<v8::Boolean> result; 2645 v8::Handle<v8::Boolean> result;
2642 { 2646 {
2643 // Leaving JavaScript. 2647 // Leaving JavaScript.
2644 VMState state(isolate, EXTERNAL); 2648 VMState state(isolate, EXTERNAL);
2645 result = deleter(index, info); 2649 result = deleter(index, info);
2646 } 2650 }
2647 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 2651 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
2648 if (!result.IsEmpty()) { 2652 if (!result.IsEmpty()) {
(...skipping 4184 matching lines...) Expand 10 before | Expand all | Expand 10 after
6833 AssertNoContextChange ncc; 6837 AssertNoContextChange ncc;
6834 HandleScope scope(isolate); 6838 HandleScope scope(isolate);
6835 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); 6839 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
6836 Handle<JSObject> receiver_handle(receiver); 6840 Handle<JSObject> receiver_handle(receiver);
6837 Handle<JSObject> holder_handle(this); 6841 Handle<JSObject> holder_handle(this);
6838 CustomArguments args(isolate, interceptor->data(), receiver, this); 6842 CustomArguments args(isolate, interceptor->data(), receiver, this);
6839 v8::AccessorInfo info(args.end()); 6843 v8::AccessorInfo info(args.end());
6840 if (!interceptor->query()->IsUndefined()) { 6844 if (!interceptor->query()->IsUndefined()) {
6841 v8::IndexedPropertyQuery query = 6845 v8::IndexedPropertyQuery query =
6842 v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query()); 6846 v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query());
6843 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); 6847 LOG(isolate,
6848 ApiIndexedPropertyAccess("interceptor-indexed-has", this, index));
6844 v8::Handle<v8::Integer> result; 6849 v8::Handle<v8::Integer> result;
6845 { 6850 {
6846 // Leaving JavaScript. 6851 // Leaving JavaScript.
6847 VMState state(isolate, EXTERNAL); 6852 VMState state(isolate, EXTERNAL);
6848 result = query(index, info); 6853 result = query(index, info);
6849 } 6854 }
6850 if (!result.IsEmpty()) { 6855 if (!result.IsEmpty()) {
6851 ASSERT(result->IsInt32()); 6856 ASSERT(result->IsInt32());
6852 return true; // absence of property is signaled by empty handle. 6857 return true; // absence of property is signaled by empty handle.
6853 } 6858 }
6854 } else if (!interceptor->getter()->IsUndefined()) { 6859 } else if (!interceptor->getter()->IsUndefined()) {
6855 v8::IndexedPropertyGetter getter = 6860 v8::IndexedPropertyGetter getter =
6856 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); 6861 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter());
6857 LOG(ApiIndexedPropertyAccess("interceptor-indexed-has-get", this, index)); 6862 LOG(isolate,
6863 ApiIndexedPropertyAccess("interceptor-indexed-has-get", this, index));
6858 v8::Handle<v8::Value> result; 6864 v8::Handle<v8::Value> result;
6859 { 6865 {
6860 // Leaving JavaScript. 6866 // Leaving JavaScript.
6861 VMState state(isolate, EXTERNAL); 6867 VMState state(isolate, EXTERNAL);
6862 result = getter(index, info); 6868 result = getter(index, info);
6863 } 6869 }
6864 if (!result.IsEmpty()) return true; 6870 if (!result.IsEmpty()) return true;
6865 } 6871 }
6866 return holder_handle->HasElementPostInterceptor(*receiver_handle, index); 6872 return holder_handle->HasElementPostInterceptor(*receiver_handle, index);
6867 } 6873 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
7013 // Make sure that the top context does not change when doing 7019 // Make sure that the top context does not change when doing
7014 // callbacks or interceptor calls. 7020 // callbacks or interceptor calls.
7015 AssertNoContextChange ncc; 7021 AssertNoContextChange ncc;
7016 HandleScope scope(isolate); 7022 HandleScope scope(isolate);
7017 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); 7023 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
7018 Handle<JSObject> this_handle(this); 7024 Handle<JSObject> this_handle(this);
7019 Handle<Object> value_handle(value, isolate); 7025 Handle<Object> value_handle(value, isolate);
7020 if (!interceptor->setter()->IsUndefined()) { 7026 if (!interceptor->setter()->IsUndefined()) {
7021 v8::IndexedPropertySetter setter = 7027 v8::IndexedPropertySetter setter =
7022 v8::ToCData<v8::IndexedPropertySetter>(interceptor->setter()); 7028 v8::ToCData<v8::IndexedPropertySetter>(interceptor->setter());
7023 LOG(ApiIndexedPropertyAccess("interceptor-indexed-set", this, index)); 7029 LOG(isolate,
7030 ApiIndexedPropertyAccess("interceptor-indexed-set", this, index));
7024 CustomArguments args(isolate, interceptor->data(), this, this); 7031 CustomArguments args(isolate, interceptor->data(), this, this);
7025 v8::AccessorInfo info(args.end()); 7032 v8::AccessorInfo info(args.end());
7026 v8::Handle<v8::Value> result; 7033 v8::Handle<v8::Value> result;
7027 { 7034 {
7028 // Leaving JavaScript. 7035 // Leaving JavaScript.
7029 VMState state(isolate, EXTERNAL); 7036 VMState state(isolate, EXTERNAL);
7030 result = setter(index, v8::Utils::ToLocal(value_handle), info); 7037 result = setter(index, v8::Utils::ToLocal(value_handle), info);
7031 } 7038 }
7032 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 7039 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
7033 if (!result.IsEmpty()) return *value_handle; 7040 if (!result.IsEmpty()) return *value_handle;
(...skipping 18 matching lines...) Expand all
7052 // api style callbacks. 7059 // api style callbacks.
7053 if (structure->IsAccessorInfo()) { 7060 if (structure->IsAccessorInfo()) {
7054 AccessorInfo* data = AccessorInfo::cast(structure); 7061 AccessorInfo* data = AccessorInfo::cast(structure);
7055 Object* fun_obj = data->getter(); 7062 Object* fun_obj = data->getter();
7056 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); 7063 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj);
7057 HandleScope scope(isolate); 7064 HandleScope scope(isolate);
7058 Handle<JSObject> self(JSObject::cast(receiver)); 7065 Handle<JSObject> self(JSObject::cast(receiver));
7059 Handle<JSObject> holder_handle(JSObject::cast(holder)); 7066 Handle<JSObject> holder_handle(JSObject::cast(holder));
7060 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); 7067 Handle<Object> number = isolate->factory()->NewNumberFromUint(index);
7061 Handle<String> key(isolate->factory()->NumberToString(number)); 7068 Handle<String> key(isolate->factory()->NumberToString(number));
7062 LOG(ApiNamedPropertyAccess("load", *self, *key)); 7069 LOG(isolate, ApiNamedPropertyAccess("load", *self, *key));
7063 CustomArguments args(isolate, data->data(), *self, *holder_handle); 7070 CustomArguments args(isolate, data->data(), *self, *holder_handle);
7064 v8::AccessorInfo info(args.end()); 7071 v8::AccessorInfo info(args.end());
7065 v8::Handle<v8::Value> result; 7072 v8::Handle<v8::Value> result;
7066 { 7073 {
7067 // Leaving JavaScript. 7074 // Leaving JavaScript.
7068 VMState state(isolate, EXTERNAL); 7075 VMState state(isolate, EXTERNAL);
7069 result = call_fun(v8::Utils::ToLocal(key), info); 7076 result = call_fun(v8::Utils::ToLocal(key), info);
7070 } 7077 }
7071 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 7078 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
7072 if (result.IsEmpty()) return isolate->heap()->undefined_value(); 7079 if (result.IsEmpty()) return isolate->heap()->undefined_value();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
7107 ASSERT(!structure->IsProxy()); 7114 ASSERT(!structure->IsProxy());
7108 7115
7109 if (structure->IsAccessorInfo()) { 7116 if (structure->IsAccessorInfo()) {
7110 // api style callbacks 7117 // api style callbacks
7111 AccessorInfo* data = AccessorInfo::cast(structure); 7118 AccessorInfo* data = AccessorInfo::cast(structure);
7112 Object* call_obj = data->setter(); 7119 Object* call_obj = data->setter();
7113 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); 7120 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj);
7114 if (call_fun == NULL) return value; 7121 if (call_fun == NULL) return value;
7115 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); 7122 Handle<Object> number = isolate->factory()->NewNumberFromUint(index);
7116 Handle<String> key(isolate->factory()->NumberToString(number)); 7123 Handle<String> key(isolate->factory()->NumberToString(number));
7117 LOG(ApiNamedPropertyAccess("store", this, *key)); 7124 LOG(isolate, ApiNamedPropertyAccess("store", this, *key));
7118 CustomArguments args(isolate, data->data(), this, JSObject::cast(holder)); 7125 CustomArguments args(isolate, data->data(), this, JSObject::cast(holder));
7119 v8::AccessorInfo info(args.end()); 7126 v8::AccessorInfo info(args.end());
7120 { 7127 {
7121 // Leaving JavaScript. 7128 // Leaving JavaScript.
7122 VMState state(isolate, EXTERNAL); 7129 VMState state(isolate, EXTERNAL);
7123 call_fun(v8::Utils::ToLocal(key), 7130 call_fun(v8::Utils::ToLocal(key),
7124 v8::Utils::ToLocal(value_handle), 7131 v8::Utils::ToLocal(value_handle),
7125 info); 7132 info);
7126 } 7133 }
7127 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 7134 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
7476 // callbacks or interceptor calls. 7483 // callbacks or interceptor calls.
7477 AssertNoContextChange ncc; 7484 AssertNoContextChange ncc;
7478 HandleScope scope(isolate); 7485 HandleScope scope(isolate);
7479 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); 7486 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
7480 Handle<Object> this_handle(receiver); 7487 Handle<Object> this_handle(receiver);
7481 Handle<JSObject> holder_handle(this); 7488 Handle<JSObject> holder_handle(this);
7482 7489
7483 if (!interceptor->getter()->IsUndefined()) { 7490 if (!interceptor->getter()->IsUndefined()) {
7484 v8::IndexedPropertyGetter getter = 7491 v8::IndexedPropertyGetter getter =
7485 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); 7492 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter());
7486 LOG(ApiIndexedPropertyAccess("interceptor-indexed-get", this, index)); 7493 LOG(isolate,
7494 ApiIndexedPropertyAccess("interceptor-indexed-get", this, index));
7487 CustomArguments args(isolate, interceptor->data(), receiver, this); 7495 CustomArguments args(isolate, interceptor->data(), receiver, this);
7488 v8::AccessorInfo info(args.end()); 7496 v8::AccessorInfo info(args.end());
7489 v8::Handle<v8::Value> result; 7497 v8::Handle<v8::Value> result;
7490 { 7498 {
7491 // Leaving JavaScript. 7499 // Leaving JavaScript.
7492 VMState state(isolate, EXTERNAL); 7500 VMState state(isolate, EXTERNAL);
7493 result = getter(index, info); 7501 result = getter(index, info);
7494 } 7502 }
7495 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 7503 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
7496 if (!result.IsEmpty()) return *v8::Utils::OpenHandle(*result); 7504 if (!result.IsEmpty()) return *v8::Utils::OpenHandle(*result);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
7824 Isolate* isolate = GetIsolate(); 7832 Isolate* isolate = GetIsolate();
7825 InterceptorInfo* interceptor = GetNamedInterceptor(); 7833 InterceptorInfo* interceptor = GetNamedInterceptor();
7826 HandleScope scope(isolate); 7834 HandleScope scope(isolate);
7827 Handle<JSObject> receiver_handle(receiver); 7835 Handle<JSObject> receiver_handle(receiver);
7828 Handle<JSObject> holder_handle(this); 7836 Handle<JSObject> holder_handle(this);
7829 Handle<String> name_handle(name); 7837 Handle<String> name_handle(name);
7830 7838
7831 if (!interceptor->getter()->IsUndefined()) { 7839 if (!interceptor->getter()->IsUndefined()) {
7832 v8::NamedPropertyGetter getter = 7840 v8::NamedPropertyGetter getter =
7833 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); 7841 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter());
7834 LOG(ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name)); 7842 LOG(isolate,
7843 ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name));
7835 CustomArguments args(isolate, interceptor->data(), receiver, this); 7844 CustomArguments args(isolate, interceptor->data(), receiver, this);
7836 v8::AccessorInfo info(args.end()); 7845 v8::AccessorInfo info(args.end());
7837 v8::Handle<v8::Value> result; 7846 v8::Handle<v8::Value> result;
7838 { 7847 {
7839 // Leaving JavaScript. 7848 // Leaving JavaScript.
7840 VMState state(isolate, EXTERNAL); 7849 VMState state(isolate, EXTERNAL);
7841 result = getter(v8::Utils::ToLocal(name_handle), info); 7850 result = getter(v8::Utils::ToLocal(name_handle), info);
7842 } 7851 }
7843 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 7852 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
7844 if (!result.IsEmpty()) { 7853 if (!result.IsEmpty()) {
(...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after
10145 if (break_point_objects()->IsUndefined()) return 0; 10154 if (break_point_objects()->IsUndefined()) return 0;
10146 // Single beak point. 10155 // Single beak point.
10147 if (!break_point_objects()->IsFixedArray()) return 1; 10156 if (!break_point_objects()->IsFixedArray()) return 1;
10148 // Multiple break points. 10157 // Multiple break points.
10149 return FixedArray::cast(break_point_objects())->length(); 10158 return FixedArray::cast(break_point_objects())->length();
10150 } 10159 }
10151 #endif 10160 #endif
10152 10161
10153 10162
10154 } } // namespace v8::internal 10163 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/platform-cygwin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698