| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 29 matching lines...) Expand all Loading... |
| 40 #include "full-codegen.h" | 40 #include "full-codegen.h" |
| 41 #include "hydrogen.h" | 41 #include "hydrogen.h" |
| 42 #include "objects-inl.h" | 42 #include "objects-inl.h" |
| 43 #include "objects-visiting.h" | 43 #include "objects-visiting.h" |
| 44 #include "objects-visiting-inl.h" | 44 #include "objects-visiting-inl.h" |
| 45 #include "macro-assembler.h" | 45 #include "macro-assembler.h" |
| 46 #include "mark-compact.h" | 46 #include "mark-compact.h" |
| 47 #include "safepoint-table.h" | 47 #include "safepoint-table.h" |
| 48 #include "string-stream.h" | 48 #include "string-stream.h" |
| 49 #include "utils.h" | 49 #include "utils.h" |
| 50 #include "vm-state-inl.h" | |
| 51 | 50 |
| 52 #ifdef ENABLE_DISASSEMBLER | 51 #ifdef ENABLE_DISASSEMBLER |
| 53 #include "disasm.h" | 52 #include "disasm.h" |
| 54 #include "disassembler.h" | 53 #include "disassembler.h" |
| 55 #endif | 54 #endif |
| 56 | 55 |
| 57 namespace v8 { | 56 namespace v8 { |
| 58 namespace internal { | 57 namespace internal { |
| 59 | 58 |
| 60 | 59 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 367 } |
| 369 ExecutableAccessorInfo* data = ExecutableAccessorInfo::cast(structure); | 368 ExecutableAccessorInfo* data = ExecutableAccessorInfo::cast(structure); |
| 370 Object* fun_obj = data->getter(); | 369 Object* fun_obj = data->getter(); |
| 371 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); | 370 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); |
| 372 if (call_fun == NULL) return isolate->heap()->undefined_value(); | 371 if (call_fun == NULL) return isolate->heap()->undefined_value(); |
| 373 HandleScope scope(isolate); | 372 HandleScope scope(isolate); |
| 374 JSObject* self = JSObject::cast(receiver); | 373 JSObject* self = JSObject::cast(receiver); |
| 375 Handle<String> key(String::cast(name)); | 374 Handle<String> key(String::cast(name)); |
| 376 LOG(isolate, ApiNamedPropertyAccess("load", self, name)); | 375 LOG(isolate, ApiNamedPropertyAccess("load", self, name)); |
| 377 PropertyCallbackArguments args(isolate, data->data(), self, this); | 376 PropertyCallbackArguments args(isolate, data->data(), self, this); |
| 378 v8::Handle<v8::Value> result; | 377 v8::Handle<v8::Value> result = |
| 379 { | 378 args.Call(call_fun, v8::Utils::ToLocal(key)); |
| 380 // Leaving JavaScript. | |
| 381 VMState<EXTERNAL> state(isolate); | |
| 382 ExternalCallbackScope call_scope(isolate, | |
| 383 v8::ToCData<Address>(fun_obj)); | |
| 384 result = args.Call(call_fun, v8::Utils::ToLocal(key)); | |
| 385 } | |
| 386 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 379 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 387 if (result.IsEmpty()) { | 380 if (result.IsEmpty()) { |
| 388 return isolate->heap()->undefined_value(); | 381 return isolate->heap()->undefined_value(); |
| 389 } | 382 } |
| 390 Object* return_value = *v8::Utils::OpenHandle(*result); | 383 Object* return_value = *v8::Utils::OpenHandle(*result); |
| 391 return_value->VerifyApiCallResultType(); | 384 return_value->VerifyApiCallResultType(); |
| 392 return return_value; | 385 return return_value; |
| 393 } | 386 } |
| 394 | 387 |
| 395 // __defineGetter__ callback | 388 // __defineGetter__ callback |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 654 |
| 662 MaybeObject* JSObject::SetNormalizedProperty(Name* name, | 655 MaybeObject* JSObject::SetNormalizedProperty(Name* name, |
| 663 Object* value, | 656 Object* value, |
| 664 PropertyDetails details) { | 657 PropertyDetails details) { |
| 665 ASSERT(!HasFastProperties()); | 658 ASSERT(!HasFastProperties()); |
| 666 int entry = property_dictionary()->FindEntry(name); | 659 int entry = property_dictionary()->FindEntry(name); |
| 667 if (entry == NameDictionary::kNotFound) { | 660 if (entry == NameDictionary::kNotFound) { |
| 668 Object* store_value = value; | 661 Object* store_value = value; |
| 669 if (IsGlobalObject()) { | 662 if (IsGlobalObject()) { |
| 670 Heap* heap = name->GetHeap(); | 663 Heap* heap = name->GetHeap(); |
| 671 MaybeObject* maybe_store_value = | 664 MaybeObject* maybe_store_value = heap->AllocatePropertyCell(value); |
| 672 heap->AllocatePropertyCell(value); | |
| 673 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; | 665 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; |
| 674 } | 666 } |
| 675 Object* dict; | 667 Object* dict; |
| 676 { MaybeObject* maybe_dict = | 668 { MaybeObject* maybe_dict = |
| 677 property_dictionary()->Add(name, store_value, details); | 669 property_dictionary()->Add(name, store_value, details); |
| 678 if (!maybe_dict->ToObject(&dict)) return maybe_dict; | 670 if (!maybe_dict->ToObject(&dict)) return maybe_dict; |
| 679 } | 671 } |
| 680 set_properties(NameDictionary::cast(dict)); | 672 set_properties(NameDictionary::cast(dict)); |
| 681 return value; | 673 return value; |
| 682 } | 674 } |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 break; | 1616 break; |
| 1625 case JS_OBJECT_TYPE: | 1617 case JS_OBJECT_TYPE: |
| 1626 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 1618 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
| 1627 case JS_GENERATOR_OBJECT_TYPE: | 1619 case JS_GENERATOR_OBJECT_TYPE: |
| 1628 case JS_MODULE_TYPE: | 1620 case JS_MODULE_TYPE: |
| 1629 case JS_VALUE_TYPE: | 1621 case JS_VALUE_TYPE: |
| 1630 case JS_DATE_TYPE: | 1622 case JS_DATE_TYPE: |
| 1631 case JS_ARRAY_TYPE: | 1623 case JS_ARRAY_TYPE: |
| 1632 case JS_ARRAY_BUFFER_TYPE: | 1624 case JS_ARRAY_BUFFER_TYPE: |
| 1633 case JS_TYPED_ARRAY_TYPE: | 1625 case JS_TYPED_ARRAY_TYPE: |
| 1626 case JS_DATA_VIEW_TYPE: |
| 1634 case JS_SET_TYPE: | 1627 case JS_SET_TYPE: |
| 1635 case JS_MAP_TYPE: | 1628 case JS_MAP_TYPE: |
| 1636 case JS_WEAK_MAP_TYPE: | 1629 case JS_WEAK_MAP_TYPE: |
| 1637 case JS_REGEXP_TYPE: | 1630 case JS_REGEXP_TYPE: |
| 1638 case JS_GLOBAL_PROXY_TYPE: | 1631 case JS_GLOBAL_PROXY_TYPE: |
| 1639 case JS_GLOBAL_OBJECT_TYPE: | 1632 case JS_GLOBAL_OBJECT_TYPE: |
| 1640 case JS_BUILTINS_OBJECT_TYPE: | 1633 case JS_BUILTINS_OBJECT_TYPE: |
| 1641 case JS_MESSAGE_OBJECT_TYPE: | 1634 case JS_MESSAGE_OBJECT_TYPE: |
| 1642 JSObject::BodyDescriptor::IterateBody(this, object_size, v); | 1635 JSObject::BodyDescriptor::IterateBody(this, object_size, v); |
| 1643 break; | 1636 break; |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 HandleScope scope(isolate); | 2722 HandleScope scope(isolate); |
| 2730 Handle<JSObject> this_handle(this); | 2723 Handle<JSObject> this_handle(this); |
| 2731 Handle<String> name_handle(String::cast(name)); | 2724 Handle<String> name_handle(String::cast(name)); |
| 2732 Handle<Object> value_handle(value, isolate); | 2725 Handle<Object> value_handle(value, isolate); |
| 2733 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); | 2726 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); |
| 2734 if (!interceptor->setter()->IsUndefined()) { | 2727 if (!interceptor->setter()->IsUndefined()) { |
| 2735 LOG(isolate, ApiNamedPropertyAccess("interceptor-named-set", this, name)); | 2728 LOG(isolate, ApiNamedPropertyAccess("interceptor-named-set", this, name)); |
| 2736 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); | 2729 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); |
| 2737 v8::NamedPropertySetter setter = | 2730 v8::NamedPropertySetter setter = |
| 2738 v8::ToCData<v8::NamedPropertySetter>(interceptor->setter()); | 2731 v8::ToCData<v8::NamedPropertySetter>(interceptor->setter()); |
| 2739 v8::Handle<v8::Value> result; | 2732 Handle<Object> value_unhole(value->IsTheHole() ? |
| 2740 { | 2733 isolate->heap()->undefined_value() : |
| 2741 // Leaving JavaScript. | 2734 value, |
| 2742 VMState<EXTERNAL> state(isolate); | 2735 isolate); |
| 2743 Handle<Object> value_unhole(value->IsTheHole() ? | 2736 v8::Handle<v8::Value> result = args.Call(setter, |
| 2744 isolate->heap()->undefined_value() : | 2737 v8::Utils::ToLocal(name_handle), |
| 2745 value, | 2738 v8::Utils::ToLocal(value_unhole)); |
| 2746 isolate); | |
| 2747 result = args.Call(setter, | |
| 2748 v8::Utils::ToLocal(name_handle), | |
| 2749 v8::Utils::ToLocal(value_unhole)); | |
| 2750 } | |
| 2751 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 2739 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 2752 if (!result.IsEmpty()) return *value_handle; | 2740 if (!result.IsEmpty()) return *value_handle; |
| 2753 } | 2741 } |
| 2754 MaybeObject* raw_result = | 2742 MaybeObject* raw_result = |
| 2755 this_handle->SetPropertyPostInterceptor(*name_handle, | 2743 this_handle->SetPropertyPostInterceptor(*name_handle, |
| 2756 *value_handle, | 2744 *value_handle, |
| 2757 attributes, | 2745 attributes, |
| 2758 strict_mode, | 2746 strict_mode, |
| 2759 PERFORM_EXTENSIBILITY_CHECK); | 2747 PERFORM_EXTENSIBILITY_CHECK); |
| 2760 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 2748 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2839 ARRAY_SIZE(args))); | 2827 ARRAY_SIZE(args))); |
| 2840 return isolate->Throw(*error); | 2828 return isolate->Throw(*error); |
| 2841 } | 2829 } |
| 2842 // TODO(rossberg): Support symbols in the API. | 2830 // TODO(rossberg): Support symbols in the API. |
| 2843 if (name->IsSymbol()) return value; | 2831 if (name->IsSymbol()) return value; |
| 2844 Object* call_obj = data->setter(); | 2832 Object* call_obj = data->setter(); |
| 2845 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); | 2833 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); |
| 2846 if (call_fun == NULL) return value; | 2834 if (call_fun == NULL) return value; |
| 2847 Handle<String> key(String::cast(name)); | 2835 Handle<String> key(String::cast(name)); |
| 2848 LOG(isolate, ApiNamedPropertyAccess("store", this, name)); | 2836 LOG(isolate, ApiNamedPropertyAccess("store", this, name)); |
| 2849 PropertyCallbackArguments | 2837 PropertyCallbackArguments args( |
| 2850 args(isolate, data->data(), this, JSObject::cast(holder)); | 2838 isolate, data->data(), this, JSObject::cast(holder)); |
| 2851 { | 2839 args.Call(call_fun, |
| 2852 // Leaving JavaScript. | 2840 v8::Utils::ToLocal(key), |
| 2853 VMState<EXTERNAL> state(isolate); | 2841 v8::Utils::ToLocal(value_handle)); |
| 2854 ExternalCallbackScope call_scope(isolate, | |
| 2855 v8::ToCData<Address>(call_obj)); | |
| 2856 args.Call(call_fun, | |
| 2857 v8::Utils::ToLocal(key), | |
| 2858 v8::Utils::ToLocal(value_handle)); | |
| 2859 } | |
| 2860 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 2842 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 2861 return *value_handle; | 2843 return *value_handle; |
| 2862 } | 2844 } |
| 2863 | 2845 |
| 2864 if (structure->IsAccessorPair()) { | 2846 if (structure->IsAccessorPair()) { |
| 2865 Object* setter = AccessorPair::cast(structure)->setter(); | 2847 Object* setter = AccessorPair::cast(structure)->setter(); |
| 2866 if (setter->IsSpecFunction()) { | 2848 if (setter->IsSpecFunction()) { |
| 2867 // TODO(rossberg): nicer would be to cast to some JSCallable here... | 2849 // TODO(rossberg): nicer would be to cast to some JSCallable here... |
| 2868 return SetPropertyWithDefinedSetter(JSReceiver::cast(setter), value); | 2850 return SetPropertyWithDefinedSetter(JSReceiver::cast(setter), value); |
| 2869 } else { | 2851 } else { |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4180 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); | 4162 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); |
| 4181 Handle<JSObject> receiver_handle(receiver); | 4163 Handle<JSObject> receiver_handle(receiver); |
| 4182 Handle<JSObject> holder_handle(this); | 4164 Handle<JSObject> holder_handle(this); |
| 4183 Handle<String> name_handle(String::cast(name)); | 4165 Handle<String> name_handle(String::cast(name)); |
| 4184 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); | 4166 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); |
| 4185 if (!interceptor->query()->IsUndefined()) { | 4167 if (!interceptor->query()->IsUndefined()) { |
| 4186 v8::NamedPropertyQuery query = | 4168 v8::NamedPropertyQuery query = |
| 4187 v8::ToCData<v8::NamedPropertyQuery>(interceptor->query()); | 4169 v8::ToCData<v8::NamedPropertyQuery>(interceptor->query()); |
| 4188 LOG(isolate, | 4170 LOG(isolate, |
| 4189 ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); | 4171 ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); |
| 4190 v8::Handle<v8::Integer> result; | 4172 v8::Handle<v8::Integer> result = |
| 4191 { | 4173 args.Call(query, v8::Utils::ToLocal(name_handle)); |
| 4192 // Leaving JavaScript. | |
| 4193 VMState<EXTERNAL> state(isolate); | |
| 4194 result = args.Call(query, v8::Utils::ToLocal(name_handle)); | |
| 4195 } | |
| 4196 if (!result.IsEmpty()) { | 4174 if (!result.IsEmpty()) { |
| 4197 ASSERT(result->IsInt32()); | 4175 ASSERT(result->IsInt32()); |
| 4198 return static_cast<PropertyAttributes>(result->Int32Value()); | 4176 return static_cast<PropertyAttributes>(result->Int32Value()); |
| 4199 } | 4177 } |
| 4200 } else if (!interceptor->getter()->IsUndefined()) { | 4178 } else if (!interceptor->getter()->IsUndefined()) { |
| 4201 v8::NamedPropertyGetter getter = | 4179 v8::NamedPropertyGetter getter = |
| 4202 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); | 4180 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); |
| 4203 LOG(isolate, | 4181 LOG(isolate, |
| 4204 ApiNamedPropertyAccess("interceptor-named-get-has", this, name)); | 4182 ApiNamedPropertyAccess("interceptor-named-get-has", this, name)); |
| 4205 v8::Handle<v8::Value> result; | 4183 v8::Handle<v8::Value> result = |
| 4206 { | 4184 args.Call(getter, v8::Utils::ToLocal(name_handle)); |
| 4207 // Leaving JavaScript. | |
| 4208 VMState<EXTERNAL> state(isolate); | |
| 4209 result = args.Call(getter, v8::Utils::ToLocal(name_handle)); | |
| 4210 } | |
| 4211 if (!result.IsEmpty()) return DONT_ENUM; | 4185 if (!result.IsEmpty()) return DONT_ENUM; |
| 4212 } | 4186 } |
| 4213 return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle, | 4187 return holder_handle->GetPropertyAttributePostInterceptor(*receiver_handle, |
| 4214 *name_handle, | 4188 *name_handle, |
| 4215 continue_search); | 4189 continue_search); |
| 4216 } | 4190 } |
| 4217 | 4191 |
| 4218 | 4192 |
| 4219 PropertyAttributes JSReceiver::GetPropertyAttributeWithReceiver( | 4193 PropertyAttributes JSReceiver::GetPropertyAttributeWithReceiver( |
| 4220 JSReceiver* receiver, | 4194 JSReceiver* receiver, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4320 HandleScope scope(isolate); | 4294 HandleScope scope(isolate); |
| 4321 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 4295 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
| 4322 Handle<JSReceiver> hreceiver(receiver); | 4296 Handle<JSReceiver> hreceiver(receiver); |
| 4323 Handle<JSObject> holder(this); | 4297 Handle<JSObject> holder(this); |
| 4324 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); | 4298 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); |
| 4325 if (!interceptor->query()->IsUndefined()) { | 4299 if (!interceptor->query()->IsUndefined()) { |
| 4326 v8::IndexedPropertyQuery query = | 4300 v8::IndexedPropertyQuery query = |
| 4327 v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query()); | 4301 v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query()); |
| 4328 LOG(isolate, | 4302 LOG(isolate, |
| 4329 ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); | 4303 ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); |
| 4330 v8::Handle<v8::Integer> result; | 4304 v8::Handle<v8::Integer> result = args.Call(query, index); |
| 4331 { | |
| 4332 // Leaving JavaScript. | |
| 4333 VMState<EXTERNAL> state(isolate); | |
| 4334 result = args.Call(query, index); | |
| 4335 } | |
| 4336 if (!result.IsEmpty()) | 4305 if (!result.IsEmpty()) |
| 4337 return static_cast<PropertyAttributes>(result->Int32Value()); | 4306 return static_cast<PropertyAttributes>(result->Int32Value()); |
| 4338 } else if (!interceptor->getter()->IsUndefined()) { | 4307 } else if (!interceptor->getter()->IsUndefined()) { |
| 4339 v8::IndexedPropertyGetter getter = | 4308 v8::IndexedPropertyGetter getter = |
| 4340 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); | 4309 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); |
| 4341 LOG(isolate, | 4310 LOG(isolate, |
| 4342 ApiIndexedPropertyAccess("interceptor-indexed-get-has", this, index)); | 4311 ApiIndexedPropertyAccess("interceptor-indexed-get-has", this, index)); |
| 4343 v8::Handle<v8::Value> result; | 4312 v8::Handle<v8::Value> result = args.Call(getter, index); |
| 4344 { | |
| 4345 // Leaving JavaScript. | |
| 4346 VMState<EXTERNAL> state(isolate); | |
| 4347 result = args.Call(getter, index); | |
| 4348 } | |
| 4349 if (!result.IsEmpty()) return NONE; | 4313 if (!result.IsEmpty()) return NONE; |
| 4350 } | 4314 } |
| 4351 | 4315 |
| 4352 return holder->GetElementAttributeWithoutInterceptor( | 4316 return holder->GetElementAttributeWithoutInterceptor( |
| 4353 *hreceiver, index, continue_search); | 4317 *hreceiver, index, continue_search); |
| 4354 } | 4318 } |
| 4355 | 4319 |
| 4356 | 4320 |
| 4357 PropertyAttributes JSObject::GetElementAttributeWithoutInterceptor( | 4321 PropertyAttributes JSObject::GetElementAttributeWithoutInterceptor( |
| 4358 JSReceiver* receiver, uint32_t index, bool continue_search) { | 4322 JSReceiver* receiver, uint32_t index, bool continue_search) { |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4762 return hash; | 4726 return hash; |
| 4763 } | 4727 } |
| 4764 | 4728 |
| 4765 | 4729 |
| 4766 Object* JSObject::GetHiddenProperty(Name* key) { | 4730 Object* JSObject::GetHiddenProperty(Name* key) { |
| 4767 ASSERT(key->IsUniqueName()); | 4731 ASSERT(key->IsUniqueName()); |
| 4768 if (IsJSGlobalProxy()) { | 4732 if (IsJSGlobalProxy()) { |
| 4769 // For a proxy, use the prototype as target object. | 4733 // For a proxy, use the prototype as target object. |
| 4770 Object* proxy_parent = GetPrototype(); | 4734 Object* proxy_parent = GetPrototype(); |
| 4771 // If the proxy is detached, return undefined. | 4735 // If the proxy is detached, return undefined. |
| 4772 if (proxy_parent->IsNull()) return GetHeap()->undefined_value(); | 4736 if (proxy_parent->IsNull()) return GetHeap()->the_hole_value(); |
| 4773 ASSERT(proxy_parent->IsJSGlobalObject()); | 4737 ASSERT(proxy_parent->IsJSGlobalObject()); |
| 4774 return JSObject::cast(proxy_parent)->GetHiddenProperty(key); | 4738 return JSObject::cast(proxy_parent)->GetHiddenProperty(key); |
| 4775 } | 4739 } |
| 4776 ASSERT(!IsJSGlobalProxy()); | 4740 ASSERT(!IsJSGlobalProxy()); |
| 4777 MaybeObject* hidden_lookup = | 4741 MaybeObject* hidden_lookup = |
| 4778 GetHiddenPropertiesHashTable(ONLY_RETURN_INLINE_VALUE); | 4742 GetHiddenPropertiesHashTable(ONLY_RETURN_INLINE_VALUE); |
| 4779 Object* inline_value = hidden_lookup->ToObjectUnchecked(); | 4743 Object* inline_value = hidden_lookup->ToObjectUnchecked(); |
| 4780 | 4744 |
| 4781 if (inline_value->IsSmi()) { | 4745 if (inline_value->IsSmi()) { |
| 4782 // Handle inline-stored identity hash. | 4746 // Handle inline-stored identity hash. |
| 4783 if (key == GetHeap()->identity_hash_string()) { | 4747 if (key == GetHeap()->identity_hash_string()) { |
| 4784 return inline_value; | 4748 return inline_value; |
| 4785 } else { | 4749 } else { |
| 4786 return GetHeap()->undefined_value(); | 4750 return GetHeap()->the_hole_value(); |
| 4787 } | 4751 } |
| 4788 } | 4752 } |
| 4789 | 4753 |
| 4790 if (inline_value->IsUndefined()) return GetHeap()->undefined_value(); | 4754 if (inline_value->IsUndefined()) return GetHeap()->the_hole_value(); |
| 4791 | 4755 |
| 4792 ObjectHashTable* hashtable = ObjectHashTable::cast(inline_value); | 4756 ObjectHashTable* hashtable = ObjectHashTable::cast(inline_value); |
| 4793 Object* entry = hashtable->Lookup(key); | 4757 Object* entry = hashtable->Lookup(key); |
| 4794 if (entry->IsTheHole()) return GetHeap()->undefined_value(); | |
| 4795 return entry; | 4758 return entry; |
| 4796 } | 4759 } |
| 4797 | 4760 |
| 4798 | 4761 |
| 4799 Handle<Object> JSObject::SetHiddenProperty(Handle<JSObject> obj, | 4762 Handle<Object> JSObject::SetHiddenProperty(Handle<JSObject> obj, |
| 4800 Handle<Name> key, | 4763 Handle<Name> key, |
| 4801 Handle<Object> value) { | 4764 Handle<Object> value) { |
| 4802 CALL_HEAP_FUNCTION(obj->GetIsolate(), | 4765 CALL_HEAP_FUNCTION(obj->GetIsolate(), |
| 4803 obj->SetHiddenProperty(*key, *value), | 4766 obj->SetHiddenProperty(*key, *value), |
| 4804 Object); | 4767 Object); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5008 HandleScope scope(isolate); | 4971 HandleScope scope(isolate); |
| 5009 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); | 4972 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); |
| 5010 Handle<String> name_handle(String::cast(name)); | 4973 Handle<String> name_handle(String::cast(name)); |
| 5011 Handle<JSObject> this_handle(this); | 4974 Handle<JSObject> this_handle(this); |
| 5012 if (!interceptor->deleter()->IsUndefined()) { | 4975 if (!interceptor->deleter()->IsUndefined()) { |
| 5013 v8::NamedPropertyDeleter deleter = | 4976 v8::NamedPropertyDeleter deleter = |
| 5014 v8::ToCData<v8::NamedPropertyDeleter>(interceptor->deleter()); | 4977 v8::ToCData<v8::NamedPropertyDeleter>(interceptor->deleter()); |
| 5015 LOG(isolate, | 4978 LOG(isolate, |
| 5016 ApiNamedPropertyAccess("interceptor-named-delete", *this_handle, name)); | 4979 ApiNamedPropertyAccess("interceptor-named-delete", *this_handle, name)); |
| 5017 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); | 4980 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); |
| 5018 v8::Handle<v8::Boolean> result; | 4981 v8::Handle<v8::Boolean> result = |
| 5019 { | 4982 args.Call(deleter, v8::Utils::ToLocal(name_handle)); |
| 5020 // Leaving JavaScript. | |
| 5021 VMState<EXTERNAL> state(isolate); | |
| 5022 result = args.Call(deleter, v8::Utils::ToLocal(name_handle)); | |
| 5023 } | |
| 5024 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 4983 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 5025 if (!result.IsEmpty()) { | 4984 if (!result.IsEmpty()) { |
| 5026 ASSERT(result->IsBoolean()); | 4985 ASSERT(result->IsBoolean()); |
| 5027 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); | 4986 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); |
| 5028 result_internal->VerifyApiCallResultType(); | 4987 result_internal->VerifyApiCallResultType(); |
| 5029 return *result_internal; | 4988 return *result_internal; |
| 5030 } | 4989 } |
| 5031 } | 4990 } |
| 5032 MaybeObject* raw_result = | 4991 MaybeObject* raw_result = |
| 5033 this_handle->DeletePropertyPostInterceptor(*name_handle, NORMAL_DELETION); | 4992 this_handle->DeletePropertyPostInterceptor(*name_handle, NORMAL_DELETION); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5044 AssertNoContextChange ncc; | 5003 AssertNoContextChange ncc; |
| 5045 HandleScope scope(isolate); | 5004 HandleScope scope(isolate); |
| 5046 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 5005 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
| 5047 if (interceptor->deleter()->IsUndefined()) return heap->false_value(); | 5006 if (interceptor->deleter()->IsUndefined()) return heap->false_value(); |
| 5048 v8::IndexedPropertyDeleter deleter = | 5007 v8::IndexedPropertyDeleter deleter = |
| 5049 v8::ToCData<v8::IndexedPropertyDeleter>(interceptor->deleter()); | 5008 v8::ToCData<v8::IndexedPropertyDeleter>(interceptor->deleter()); |
| 5050 Handle<JSObject> this_handle(this); | 5009 Handle<JSObject> this_handle(this); |
| 5051 LOG(isolate, | 5010 LOG(isolate, |
| 5052 ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index)); | 5011 ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index)); |
| 5053 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); | 5012 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); |
| 5054 v8::Handle<v8::Boolean> result; | 5013 v8::Handle<v8::Boolean> result = args.Call(deleter, index); |
| 5055 { | |
| 5056 // Leaving JavaScript. | |
| 5057 VMState<EXTERNAL> state(isolate); | |
| 5058 result = args.Call(deleter, index); | |
| 5059 } | |
| 5060 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 5014 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 5061 if (!result.IsEmpty()) { | 5015 if (!result.IsEmpty()) { |
| 5062 ASSERT(result->IsBoolean()); | 5016 ASSERT(result->IsBoolean()); |
| 5063 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); | 5017 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); |
| 5064 result_internal->VerifyApiCallResultType(); | 5018 result_internal->VerifyApiCallResultType(); |
| 5065 return *result_internal; | 5019 return *result_internal; |
| 5066 } | 5020 } |
| 5067 MaybeObject* raw_result = this_handle->GetElementsAccessor()->Delete( | 5021 MaybeObject* raw_result = this_handle->GetElementsAccessor()->Delete( |
| 5068 *this_handle, | 5022 *this_handle, |
| 5069 index, | 5023 index, |
| (...skipping 4326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9396 ClearOptimizedCodeMap(); | 9350 ClearOptimizedCodeMap(); |
| 9397 } | 9351 } |
| 9398 } | 9352 } |
| 9399 | 9353 |
| 9400 | 9354 |
| 9401 bool JSFunction::CompileLazy(Handle<JSFunction> function, | 9355 bool JSFunction::CompileLazy(Handle<JSFunction> function, |
| 9402 ClearExceptionFlag flag) { | 9356 ClearExceptionFlag flag) { |
| 9403 bool result = true; | 9357 bool result = true; |
| 9404 if (function->shared()->is_compiled()) { | 9358 if (function->shared()->is_compiled()) { |
| 9405 function->ReplaceCode(function->shared()->code()); | 9359 function->ReplaceCode(function->shared()->code()); |
| 9406 function->shared()->set_code_age(0); | |
| 9407 } else { | 9360 } else { |
| 9408 ASSERT(function->shared()->allows_lazy_compilation()); | 9361 ASSERT(function->shared()->allows_lazy_compilation()); |
| 9409 CompilationInfoWithZone info(function); | 9362 CompilationInfoWithZone info(function); |
| 9410 result = CompileLazyHelper(&info, flag); | 9363 result = CompileLazyHelper(&info, flag); |
| 9411 ASSERT(!result || function->is_compiled()); | 9364 ASSERT(!result || function->is_compiled()); |
| 9412 } | 9365 } |
| 9413 return result; | 9366 return result; |
| 9414 } | 9367 } |
| 9415 | 9368 |
| 9416 | 9369 |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10019 Address* p = rinfo->target_reference_address(); | 9972 Address* p = rinfo->target_reference_address(); |
| 10020 VisitExternalReferences(p, p + 1); | 9973 VisitExternalReferences(p, p + 1); |
| 10021 } | 9974 } |
| 10022 | 9975 |
| 10023 byte Code::compare_nil_state() { | 9976 byte Code::compare_nil_state() { |
| 10024 ASSERT(is_compare_nil_ic_stub()); | 9977 ASSERT(is_compare_nil_ic_stub()); |
| 10025 return CompareNilICStub::ExtractTypesFromExtraICState( | 9978 return CompareNilICStub::ExtractTypesFromExtraICState( |
| 10026 extended_extra_ic_state()); | 9979 extended_extra_ic_state()); |
| 10027 } | 9980 } |
| 10028 | 9981 |
| 9982 byte Code::compare_nil_value() { |
| 9983 ASSERT(is_compare_nil_ic_stub()); |
| 9984 return CompareNilICStub::ExtractNilValueFromExtraICState( |
| 9985 extended_extra_ic_state()); |
| 9986 } |
| 9987 |
| 10029 | 9988 |
| 10030 void Code::InvalidateRelocation() { | 9989 void Code::InvalidateRelocation() { |
| 10031 set_relocation_info(GetHeap()->empty_byte_array()); | 9990 set_relocation_info(GetHeap()->empty_byte_array()); |
| 10032 } | 9991 } |
| 10033 | 9992 |
| 10034 | 9993 |
| 10035 void Code::Relocate(intptr_t delta) { | 9994 void Code::Relocate(intptr_t delta) { |
| 10036 for (RelocIterator it(this, RelocInfo::kApplyMask); !it.done(); it.next()) { | 9995 for (RelocIterator it(this, RelocInfo::kApplyMask); !it.done(); it.next()) { |
| 10037 it.rinfo()->apply(delta); | 9996 it.rinfo()->apply(delta); |
| 10038 } | 9997 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10143 return statement_position; | 10102 return statement_position; |
| 10144 } | 10103 } |
| 10145 | 10104 |
| 10146 | 10105 |
| 10147 SafepointEntry Code::GetSafepointEntry(Address pc) { | 10106 SafepointEntry Code::GetSafepointEntry(Address pc) { |
| 10148 SafepointTable table(this); | 10107 SafepointTable table(this); |
| 10149 return table.FindEntry(pc); | 10108 return table.FindEntry(pc); |
| 10150 } | 10109 } |
| 10151 | 10110 |
| 10152 | 10111 |
| 10153 Map* Code::FindFirstMap() { | 10112 Object* Code::FindNthObject(int n, Map* match_map) { |
| 10154 ASSERT(is_inline_cache_stub()); | 10113 ASSERT(is_inline_cache_stub()); |
| 10155 DisallowHeapAllocation no_allocation; | 10114 DisallowHeapAllocation no_allocation; |
| 10156 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 10115 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 10157 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10116 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10158 RelocInfo* info = it.rinfo(); | 10117 RelocInfo* info = it.rinfo(); |
| 10159 Object* object = info->target_object(); | 10118 Object* object = info->target_object(); |
| 10160 if (object->IsMap()) return Map::cast(object); | 10119 if (object->IsHeapObject()) { |
| 10120 if (HeapObject::cast(object)->map() == match_map) { |
| 10121 if (--n == 0) return object; |
| 10122 } |
| 10123 } |
| 10161 } | 10124 } |
| 10162 return NULL; | 10125 return NULL; |
| 10163 } | 10126 } |
| 10164 | 10127 |
| 10165 | 10128 |
| 10166 void Code::ReplaceFirstMap(Map* replace_with) { | 10129 Map* Code::FindFirstMap() { |
| 10130 Object* result = FindNthObject(1, GetHeap()->meta_map()); |
| 10131 return (result != NULL) ? Map::cast(result) : NULL; |
| 10132 } |
| 10133 |
| 10134 |
| 10135 void Code::ReplaceNthObject(int n, |
| 10136 Map* match_map, |
| 10137 Object* replace_with) { |
| 10167 ASSERT(is_inline_cache_stub()); | 10138 ASSERT(is_inline_cache_stub()); |
| 10168 DisallowHeapAllocation no_allocation; | 10139 DisallowHeapAllocation no_allocation; |
| 10169 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 10140 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 10170 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10141 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10171 RelocInfo* info = it.rinfo(); | 10142 RelocInfo* info = it.rinfo(); |
| 10172 Object* object = info->target_object(); | 10143 Object* object = info->target_object(); |
| 10173 if (object->IsMap()) { | 10144 if (object->IsHeapObject()) { |
| 10174 info->set_target_object(replace_with); | 10145 if (HeapObject::cast(object)->map() == match_map) { |
| 10175 return; | 10146 if (--n == 0) { |
| 10147 info->set_target_object(replace_with); |
| 10148 return; |
| 10149 } |
| 10150 } |
| 10176 } | 10151 } |
| 10177 } | 10152 } |
| 10178 UNREACHABLE(); | 10153 UNREACHABLE(); |
| 10179 } | 10154 } |
| 10180 | 10155 |
| 10181 | 10156 |
| 10182 void Code::FindAllMaps(MapHandleList* maps) { | 10157 void Code::FindAllMaps(MapHandleList* maps) { |
| 10183 ASSERT(is_inline_cache_stub()); | 10158 ASSERT(is_inline_cache_stub()); |
| 10184 DisallowHeapAllocation no_allocation; | 10159 DisallowHeapAllocation no_allocation; |
| 10185 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 10160 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 10186 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10161 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10187 RelocInfo* info = it.rinfo(); | 10162 RelocInfo* info = it.rinfo(); |
| 10188 Object* object = info->target_object(); | 10163 Object* object = info->target_object(); |
| 10189 if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object))); | 10164 if (object->IsMap()) maps->Add(Handle<Map>(Map::cast(object))); |
| 10190 } | 10165 } |
| 10191 } | 10166 } |
| 10192 | 10167 |
| 10193 | 10168 |
| 10169 void Code::ReplaceFirstMap(Map* replace_with) { |
| 10170 ReplaceNthObject(1, GetHeap()->meta_map(), replace_with); |
| 10171 } |
| 10172 |
| 10173 |
| 10194 Code* Code::FindFirstCode() { | 10174 Code* Code::FindFirstCode() { |
| 10195 ASSERT(is_inline_cache_stub()); | 10175 ASSERT(is_inline_cache_stub()); |
| 10196 DisallowHeapAllocation no_allocation; | 10176 DisallowHeapAllocation no_allocation; |
| 10197 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); | 10177 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET); |
| 10198 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10178 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10199 RelocInfo* info = it.rinfo(); | 10179 RelocInfo* info = it.rinfo(); |
| 10200 return Code::GetCodeFromTargetAddress(info->target_address()); | 10180 return Code::GetCodeFromTargetAddress(info->target_address()); |
| 10201 } | 10181 } |
| 10202 return NULL; | 10182 return NULL; |
| 10203 } | 10183 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 10225 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 10205 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 10226 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10206 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10227 RelocInfo* info = it.rinfo(); | 10207 RelocInfo* info = it.rinfo(); |
| 10228 Object* object = info->target_object(); | 10208 Object* object = info->target_object(); |
| 10229 if (object->IsName()) return Name::cast(object); | 10209 if (object->IsName()) return Name::cast(object); |
| 10230 } | 10210 } |
| 10231 return NULL; | 10211 return NULL; |
| 10232 } | 10212 } |
| 10233 | 10213 |
| 10234 | 10214 |
| 10215 void Code::ReplaceNthCell(int n, Cell* replace_with) { |
| 10216 ASSERT(is_inline_cache_stub()); |
| 10217 DisallowHeapAllocation no_allocation; |
| 10218 int mask = RelocInfo::ModeMask(RelocInfo::CELL); |
| 10219 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10220 RelocInfo* info = it.rinfo(); |
| 10221 if (--n == 0) { |
| 10222 info->set_target_cell(replace_with); |
| 10223 return; |
| 10224 } |
| 10225 } |
| 10226 UNREACHABLE(); |
| 10227 } |
| 10228 |
| 10229 |
| 10235 void Code::ClearInlineCaches() { | 10230 void Code::ClearInlineCaches() { |
| 10236 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 10231 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | |
| 10237 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 10232 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | |
| 10238 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | | 10233 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID) | |
| 10239 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); | 10234 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_CONTEXT); |
| 10240 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 10235 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 10241 RelocInfo* info = it.rinfo(); | 10236 RelocInfo* info = it.rinfo(); |
| 10242 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); | 10237 Code* target(Code::GetCodeFromTargetAddress(info->target_address())); |
| 10243 if (target->is_inline_cache_stub()) { | 10238 if (target->is_inline_cache_stub()) { |
| 10244 IC::Clear(info->pc()); | 10239 IC::Clear(info->pc()); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10382 return; | 10377 return; |
| 10383 } | 10378 } |
| 10384 } | 10379 } |
| 10385 } | 10380 } |
| 10386 } | 10381 } |
| 10387 | 10382 |
| 10388 | 10383 |
| 10389 // Identify kind of code. | 10384 // Identify kind of code. |
| 10390 const char* Code::Kind2String(Kind kind) { | 10385 const char* Code::Kind2String(Kind kind) { |
| 10391 switch (kind) { | 10386 switch (kind) { |
| 10392 case FUNCTION: return "FUNCTION"; | 10387 #define CASE(name) case name: return #name; |
| 10393 case OPTIMIZED_FUNCTION: return "OPTIMIZED_FUNCTION"; | 10388 CODE_KIND_LIST(CASE) |
| 10394 case STUB: return "STUB"; | 10389 #undef CASE |
| 10395 case BUILTIN: return "BUILTIN"; | 10390 case NUMBER_OF_KINDS: break; |
| 10396 case LOAD_IC: return "LOAD_IC"; | |
| 10397 case KEYED_LOAD_IC: return "KEYED_LOAD_IC"; | |
| 10398 case STORE_IC: return "STORE_IC"; | |
| 10399 case KEYED_STORE_IC: return "KEYED_STORE_IC"; | |
| 10400 case CALL_IC: return "CALL_IC"; | |
| 10401 case KEYED_CALL_IC: return "KEYED_CALL_IC"; | |
| 10402 case UNARY_OP_IC: return "UNARY_OP_IC"; | |
| 10403 case BINARY_OP_IC: return "BINARY_OP_IC"; | |
| 10404 case COMPARE_IC: return "COMPARE_IC"; | |
| 10405 case COMPARE_NIL_IC: return "COMPARE_NIL_IC"; | |
| 10406 case TO_BOOLEAN_IC: return "TO_BOOLEAN_IC"; | |
| 10407 } | 10391 } |
| 10408 UNREACHABLE(); | 10392 UNREACHABLE(); |
| 10409 return NULL; | 10393 return NULL; |
| 10410 } | 10394 } |
| 10411 | 10395 |
| 10412 | 10396 |
| 10413 #ifdef ENABLE_DISASSEMBLER | 10397 #ifdef ENABLE_DISASSEMBLER |
| 10414 | 10398 |
| 10415 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { | 10399 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { |
| 10416 disasm::NameConverter converter; | 10400 disasm::NameConverter converter; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10491 case Translation::SETTER_STUB_FRAME: { | 10475 case Translation::SETTER_STUB_FRAME: { |
| 10492 int function_id = iterator.Next(); | 10476 int function_id = iterator.Next(); |
| 10493 JSFunction* function = | 10477 JSFunction* function = |
| 10494 JSFunction::cast(LiteralArray()->get(function_id)); | 10478 JSFunction::cast(LiteralArray()->get(function_id)); |
| 10495 PrintF(out, "{function="); | 10479 PrintF(out, "{function="); |
| 10496 function->PrintName(out); | 10480 function->PrintName(out); |
| 10497 PrintF(out, "}"); | 10481 PrintF(out, "}"); |
| 10498 break; | 10482 break; |
| 10499 } | 10483 } |
| 10500 | 10484 |
| 10501 case Translation::DUPLICATE: | |
| 10502 break; | |
| 10503 | |
| 10504 case Translation::REGISTER: { | 10485 case Translation::REGISTER: { |
| 10505 int reg_code = iterator.Next(); | 10486 int reg_code = iterator.Next(); |
| 10506 PrintF(out, "{input=%s}", converter.NameOfCPURegister(reg_code)); | 10487 PrintF(out, "{input=%s}", converter.NameOfCPURegister(reg_code)); |
| 10507 break; | 10488 break; |
| 10508 } | 10489 } |
| 10509 | 10490 |
| 10510 case Translation::INT32_REGISTER: { | 10491 case Translation::INT32_REGISTER: { |
| 10511 int reg_code = iterator.Next(); | 10492 int reg_code = iterator.Next(); |
| 10512 PrintF(out, "{input=%s}", converter.NameOfCPURegister(reg_code)); | 10493 PrintF(out, "{input=%s}", converter.NameOfCPURegister(reg_code)); |
| 10513 break; | 10494 break; |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11107 proto_transitions->length()); | 11088 proto_transitions->length()); |
| 11108 } | 11089 } |
| 11109 | 11090 |
| 11110 | 11091 |
| 11111 void Map::AddDependentCompilationInfo(DependentCode::DependencyGroup group, | 11092 void Map::AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
| 11112 CompilationInfo* info) { | 11093 CompilationInfo* info) { |
| 11113 Handle<DependentCode> dep(dependent_code()); | 11094 Handle<DependentCode> dep(dependent_code()); |
| 11114 Handle<DependentCode> codes = | 11095 Handle<DependentCode> codes = |
| 11115 DependentCode::Insert(dep, group, info->object_wrapper()); | 11096 DependentCode::Insert(dep, group, info->object_wrapper()); |
| 11116 if (*codes != dependent_code()) set_dependent_code(*codes); | 11097 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 11117 info->dependent_maps(group)->Add(Handle<Map>(this), info->zone()); | 11098 info->dependencies(group)->Add(Handle<HeapObject>(this), info->zone()); |
| 11118 } | 11099 } |
| 11119 | 11100 |
| 11120 | 11101 |
| 11121 void Map::AddDependentCode(DependentCode::DependencyGroup group, | 11102 void Map::AddDependentCode(DependentCode::DependencyGroup group, |
| 11122 Handle<Code> code) { | 11103 Handle<Code> code) { |
| 11123 Handle<DependentCode> codes = DependentCode::Insert( | 11104 Handle<DependentCode> codes = DependentCode::Insert( |
| 11124 Handle<DependentCode>(dependent_code()), group, code); | 11105 Handle<DependentCode>(dependent_code()), group, code); |
| 11125 if (*codes != dependent_code()) set_dependent_code(*codes); | 11106 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 11126 } | 11107 } |
| 11127 | 11108 |
| 11128 | 11109 |
| 11129 DependentCode::GroupStartIndexes::GroupStartIndexes(DependentCode* entries) { | 11110 DependentCode::GroupStartIndexes::GroupStartIndexes(DependentCode* entries) { |
| 11130 Recompute(entries); | 11111 Recompute(entries); |
| 11131 } | 11112 } |
| 11132 | 11113 |
| 11133 | 11114 |
| 11134 void DependentCode::GroupStartIndexes::Recompute(DependentCode* entries) { | 11115 void DependentCode::GroupStartIndexes::Recompute(DependentCode* entries) { |
| 11135 start_indexes_[0] = 0; | 11116 start_indexes_[0] = 0; |
| 11136 for (int g = 1; g <= kGroupCount; g++) { | 11117 for (int g = 1; g <= kGroupCount; g++) { |
| 11137 int count = entries->number_of_entries(static_cast<DependencyGroup>(g - 1)); | 11118 int count = entries->number_of_entries(static_cast<DependencyGroup>(g - 1)); |
| 11138 start_indexes_[g] = start_indexes_[g - 1] + count; | 11119 start_indexes_[g] = start_indexes_[g - 1] + count; |
| 11139 } | 11120 } |
| 11140 } | 11121 } |
| 11141 | 11122 |
| 11142 | 11123 |
| 11124 DependentCode* DependentCode::ForObject(Handle<HeapObject> object, |
| 11125 DependencyGroup group) { |
| 11126 AllowDeferredHandleDereference dependencies_are_safe; |
| 11127 if (group == DependentCode::kPropertyCellChangedGroup) { |
| 11128 return Handle<PropertyCell>::cast(object)->dependent_code(); |
| 11129 } |
| 11130 return Handle<Map>::cast(object)->dependent_code(); |
| 11131 } |
| 11132 |
| 11133 |
| 11143 Handle<DependentCode> DependentCode::Insert(Handle<DependentCode> entries, | 11134 Handle<DependentCode> DependentCode::Insert(Handle<DependentCode> entries, |
| 11144 DependencyGroup group, | 11135 DependencyGroup group, |
| 11145 Handle<Object> object) { | 11136 Handle<Object> object) { |
| 11146 GroupStartIndexes starts(*entries); | 11137 GroupStartIndexes starts(*entries); |
| 11147 int start = starts.at(group); | 11138 int start = starts.at(group); |
| 11148 int end = starts.at(group + 1); | 11139 int end = starts.at(group + 1); |
| 11149 int number_of_entries = starts.number_of_entries(); | 11140 int number_of_entries = starts.number_of_entries(); |
| 11150 if (start < end && entries->object_at(end - 1) == *object) { | 11141 if (start < end && entries->object_at(end - 1) == *object) { |
| 11151 // Do not append the compilation info if it is already in the array. | 11142 // Do not append the compilation info if it is already in the array. |
| 11152 // It is sufficient to just check only the last element because | 11143 // It is sufficient to just check only the last element because |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11271 int start = starts.at(group); | 11262 int start = starts.at(group); |
| 11272 int end = starts.at(group + 1); | 11263 int end = starts.at(group + 1); |
| 11273 int code_entries = starts.number_of_entries(); | 11264 int code_entries = starts.number_of_entries(); |
| 11274 if (start == end) return; | 11265 if (start == end) return; |
| 11275 for (int i = start; i < end; i++) { | 11266 for (int i = start; i < end; i++) { |
| 11276 if (is_code_at(i)) { | 11267 if (is_code_at(i)) { |
| 11277 Code* code = code_at(i); | 11268 Code* code = code_at(i); |
| 11278 code->set_marked_for_deoptimization(true); | 11269 code->set_marked_for_deoptimization(true); |
| 11279 } else { | 11270 } else { |
| 11280 CompilationInfo* info = compilation_info_at(i); | 11271 CompilationInfo* info = compilation_info_at(i); |
| 11281 info->AbortDueToDependentMap(); | 11272 info->AbortDueToDependencyChange(); |
| 11282 } | 11273 } |
| 11283 } | 11274 } |
| 11284 // Compact the array by moving all subsequent groups to fill in the new holes. | 11275 // Compact the array by moving all subsequent groups to fill in the new holes. |
| 11285 for (int src = end, dst = start; src < code_entries; src++, dst++) { | 11276 for (int src = end, dst = start; src < code_entries; src++, dst++) { |
| 11286 copy(src, dst); | 11277 copy(src, dst); |
| 11287 } | 11278 } |
| 11288 // Now the holes are at the end of the array, zap them for heap-verifier. | 11279 // Now the holes are at the end of the array, zap them for heap-verifier. |
| 11289 int removed = end - start; | 11280 int removed = end - start; |
| 11290 for (int i = code_entries - removed; i < code_entries; i++) { | 11281 for (int i = code_entries - removed; i < code_entries; i++) { |
| 11291 clear_at(i); | 11282 clear_at(i); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11458 HandleScope scope(isolate); | 11449 HandleScope scope(isolate); |
| 11459 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 11450 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
| 11460 Handle<JSObject> this_handle(this); | 11451 Handle<JSObject> this_handle(this); |
| 11461 Handle<Object> value_handle(value, isolate); | 11452 Handle<Object> value_handle(value, isolate); |
| 11462 if (!interceptor->setter()->IsUndefined()) { | 11453 if (!interceptor->setter()->IsUndefined()) { |
| 11463 v8::IndexedPropertySetter setter = | 11454 v8::IndexedPropertySetter setter = |
| 11464 v8::ToCData<v8::IndexedPropertySetter>(interceptor->setter()); | 11455 v8::ToCData<v8::IndexedPropertySetter>(interceptor->setter()); |
| 11465 LOG(isolate, | 11456 LOG(isolate, |
| 11466 ApiIndexedPropertyAccess("interceptor-indexed-set", this, index)); | 11457 ApiIndexedPropertyAccess("interceptor-indexed-set", this, index)); |
| 11467 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); | 11458 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); |
| 11468 v8::Handle<v8::Value> result; | 11459 v8::Handle<v8::Value> result = |
| 11469 { | 11460 args.Call(setter, index, v8::Utils::ToLocal(value_handle)); |
| 11470 // Leaving JavaScript. | |
| 11471 VMState<EXTERNAL> state(isolate); | |
| 11472 result = args.Call(setter, index, v8::Utils::ToLocal(value_handle)); | |
| 11473 } | |
| 11474 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 11461 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 11475 if (!result.IsEmpty()) return *value_handle; | 11462 if (!result.IsEmpty()) return *value_handle; |
| 11476 } | 11463 } |
| 11477 MaybeObject* raw_result = | 11464 MaybeObject* raw_result = |
| 11478 this_handle->SetElementWithoutInterceptor(index, | 11465 this_handle->SetElementWithoutInterceptor(index, |
| 11479 *value_handle, | 11466 *value_handle, |
| 11480 attributes, | 11467 attributes, |
| 11481 strict_mode, | 11468 strict_mode, |
| 11482 check_prototype, | 11469 check_prototype, |
| 11483 set_mode); | 11470 set_mode); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 11501 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); | 11488 v8::AccessorGetter call_fun = v8::ToCData<v8::AccessorGetter>(fun_obj); |
| 11502 if (call_fun == NULL) return isolate->heap()->undefined_value(); | 11489 if (call_fun == NULL) return isolate->heap()->undefined_value(); |
| 11503 HandleScope scope(isolate); | 11490 HandleScope scope(isolate); |
| 11504 Handle<JSObject> self(JSObject::cast(receiver)); | 11491 Handle<JSObject> self(JSObject::cast(receiver)); |
| 11505 Handle<JSObject> holder_handle(JSObject::cast(holder)); | 11492 Handle<JSObject> holder_handle(JSObject::cast(holder)); |
| 11506 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); | 11493 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); |
| 11507 Handle<String> key = isolate->factory()->NumberToString(number); | 11494 Handle<String> key = isolate->factory()->NumberToString(number); |
| 11508 LOG(isolate, ApiNamedPropertyAccess("load", *self, *key)); | 11495 LOG(isolate, ApiNamedPropertyAccess("load", *self, *key)); |
| 11509 PropertyCallbackArguments | 11496 PropertyCallbackArguments |
| 11510 args(isolate, data->data(), *self, *holder_handle); | 11497 args(isolate, data->data(), *self, *holder_handle); |
| 11511 v8::Handle<v8::Value> result; | 11498 v8::Handle<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(key)); |
| 11512 { | |
| 11513 // Leaving JavaScript. | |
| 11514 VMState<EXTERNAL> state(isolate); | |
| 11515 result = args.Call(call_fun, v8::Utils::ToLocal(key)); | |
| 11516 } | |
| 11517 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 11499 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 11518 if (result.IsEmpty()) return isolate->heap()->undefined_value(); | 11500 if (result.IsEmpty()) return isolate->heap()->undefined_value(); |
| 11519 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); | 11501 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); |
| 11520 result_internal->VerifyApiCallResultType(); | 11502 result_internal->VerifyApiCallResultType(); |
| 11521 return *result_internal; | 11503 return *result_internal; |
| 11522 } | 11504 } |
| 11523 | 11505 |
| 11524 // __defineGetter__ callback | 11506 // __defineGetter__ callback |
| 11525 if (structure->IsAccessorPair()) { | 11507 if (structure->IsAccessorPair()) { |
| 11526 Object* getter = AccessorPair::cast(structure)->getter(); | 11508 Object* getter = AccessorPair::cast(structure)->getter(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11568 Handle<ExecutableAccessorInfo> data( | 11550 Handle<ExecutableAccessorInfo> data( |
| 11569 ExecutableAccessorInfo::cast(structure)); | 11551 ExecutableAccessorInfo::cast(structure)); |
| 11570 Object* call_obj = data->setter(); | 11552 Object* call_obj = data->setter(); |
| 11571 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); | 11553 v8::AccessorSetter call_fun = v8::ToCData<v8::AccessorSetter>(call_obj); |
| 11572 if (call_fun == NULL) return value; | 11554 if (call_fun == NULL) return value; |
| 11573 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); | 11555 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); |
| 11574 Handle<String> key(isolate->factory()->NumberToString(number)); | 11556 Handle<String> key(isolate->factory()->NumberToString(number)); |
| 11575 LOG(isolate, ApiNamedPropertyAccess("store", *self, *key)); | 11557 LOG(isolate, ApiNamedPropertyAccess("store", *self, *key)); |
| 11576 PropertyCallbackArguments | 11558 PropertyCallbackArguments |
| 11577 args(isolate, data->data(), *self, *holder_handle); | 11559 args(isolate, data->data(), *self, *holder_handle); |
| 11578 { | 11560 args.Call(call_fun, |
| 11579 // Leaving JavaScript. | 11561 v8::Utils::ToLocal(key), |
| 11580 VMState<EXTERNAL> state(isolate); | 11562 v8::Utils::ToLocal(value_handle)); |
| 11581 args.Call(call_fun, | |
| 11582 v8::Utils::ToLocal(key), | |
| 11583 v8::Utils::ToLocal(value_handle)); | |
| 11584 } | |
| 11585 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 11563 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 11586 return *value_handle; | 11564 return *value_handle; |
| 11587 } | 11565 } |
| 11588 | 11566 |
| 11589 if (structure->IsAccessorPair()) { | 11567 if (structure->IsAccessorPair()) { |
| 11590 Handle<Object> setter(AccessorPair::cast(structure)->setter(), isolate); | 11568 Handle<Object> setter(AccessorPair::cast(structure)->setter(), isolate); |
| 11591 if (setter->IsSpecFunction()) { | 11569 if (setter->IsSpecFunction()) { |
| 11592 // TODO(rossberg): nicer would be to cast to some JSCallable here... | 11570 // TODO(rossberg): nicer would be to cast to some JSCallable here... |
| 11593 return SetPropertyWithDefinedSetter(JSReceiver::cast(*setter), value); | 11571 return SetPropertyWithDefinedSetter(JSReceiver::cast(*setter), value); |
| 11594 } else { | 11572 } else { |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12474 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate); | 12452 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate); |
| 12475 Handle<Object> this_handle(receiver, isolate); | 12453 Handle<Object> this_handle(receiver, isolate); |
| 12476 Handle<JSObject> holder_handle(this, isolate); | 12454 Handle<JSObject> holder_handle(this, isolate); |
| 12477 if (!interceptor->getter()->IsUndefined()) { | 12455 if (!interceptor->getter()->IsUndefined()) { |
| 12478 v8::IndexedPropertyGetter getter = | 12456 v8::IndexedPropertyGetter getter = |
| 12479 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); | 12457 v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter()); |
| 12480 LOG(isolate, | 12458 LOG(isolate, |
| 12481 ApiIndexedPropertyAccess("interceptor-indexed-get", this, index)); | 12459 ApiIndexedPropertyAccess("interceptor-indexed-get", this, index)); |
| 12482 PropertyCallbackArguments | 12460 PropertyCallbackArguments |
| 12483 args(isolate, interceptor->data(), receiver, this); | 12461 args(isolate, interceptor->data(), receiver, this); |
| 12484 v8::Handle<v8::Value> result; | 12462 v8::Handle<v8::Value> result = args.Call(getter, index); |
| 12485 { | |
| 12486 // Leaving JavaScript. | |
| 12487 VMState<EXTERNAL> state(isolate); | |
| 12488 result = args.Call(getter, index); | |
| 12489 } | |
| 12490 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 12463 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 12491 if (!result.IsEmpty()) { | 12464 if (!result.IsEmpty()) { |
| 12492 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); | 12465 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); |
| 12493 result_internal->VerifyApiCallResultType(); | 12466 result_internal->VerifyApiCallResultType(); |
| 12494 return *result_internal; | 12467 return *result_internal; |
| 12495 } | 12468 } |
| 12496 } | 12469 } |
| 12497 | 12470 |
| 12498 Heap* heap = holder_handle->GetHeap(); | 12471 Heap* heap = holder_handle->GetHeap(); |
| 12499 ElementsAccessor* handler = holder_handle->GetElementsAccessor(); | 12472 ElementsAccessor* handler = holder_handle->GetElementsAccessor(); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12784 Handle<JSObject> holder_handle(this); | 12757 Handle<JSObject> holder_handle(this); |
| 12785 Handle<String> name_handle(String::cast(name)); | 12758 Handle<String> name_handle(String::cast(name)); |
| 12786 | 12759 |
| 12787 if (!interceptor->getter()->IsUndefined()) { | 12760 if (!interceptor->getter()->IsUndefined()) { |
| 12788 v8::NamedPropertyGetter getter = | 12761 v8::NamedPropertyGetter getter = |
| 12789 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); | 12762 v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter()); |
| 12790 LOG(isolate, | 12763 LOG(isolate, |
| 12791 ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name)); | 12764 ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name)); |
| 12792 PropertyCallbackArguments | 12765 PropertyCallbackArguments |
| 12793 args(isolate, interceptor->data(), receiver, this); | 12766 args(isolate, interceptor->data(), receiver, this); |
| 12794 v8::Handle<v8::Value> result; | 12767 v8::Handle<v8::Value> result = |
| 12795 { | 12768 args.Call(getter, v8::Utils::ToLocal(name_handle)); |
| 12796 // Leaving JavaScript. | |
| 12797 VMState<EXTERNAL> state(isolate); | |
| 12798 result = args.Call(getter, v8::Utils::ToLocal(name_handle)); | |
| 12799 } | |
| 12800 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 12769 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| 12801 if (!result.IsEmpty()) { | 12770 if (!result.IsEmpty()) { |
| 12802 *attributes = NONE; | 12771 *attributes = NONE; |
| 12803 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); | 12772 Handle<Object> result_internal = v8::Utils::OpenHandle(*result); |
| 12804 result_internal->VerifyApiCallResultType(); | 12773 result_internal->VerifyApiCallResultType(); |
| 12805 return *result_internal; | 12774 return *result_internal; |
| 12806 } | 12775 } |
| 12807 } | 12776 } |
| 12808 | 12777 |
| 12809 MaybeObject* result = holder_handle->GetPropertyPostInterceptor( | 12778 MaybeObject* result = holder_handle->GetPropertyPostInterceptor( |
| (...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15798 } | 15767 } |
| 15799 | 15768 |
| 15800 | 15769 |
| 15801 void JSArrayBuffer::Neuter() { | 15770 void JSArrayBuffer::Neuter() { |
| 15802 ASSERT(is_external()); | 15771 ASSERT(is_external()); |
| 15803 set_backing_store(NULL); | 15772 set_backing_store(NULL); |
| 15804 set_byte_length(Smi::FromInt(0)); | 15773 set_byte_length(Smi::FromInt(0)); |
| 15805 } | 15774 } |
| 15806 | 15775 |
| 15807 | 15776 |
| 15777 void JSArrayBufferView::NeuterView() { |
| 15778 set_byte_offset(Smi::FromInt(0)); |
| 15779 set_byte_length(Smi::FromInt(0)); |
| 15780 } |
| 15781 |
| 15782 |
| 15783 void JSDataView::Neuter() { |
| 15784 NeuterView(); |
| 15785 } |
| 15786 |
| 15787 |
| 15808 void JSTypedArray::Neuter() { | 15788 void JSTypedArray::Neuter() { |
| 15809 set_byte_offset(Smi::FromInt(0)); | 15789 NeuterView(); |
| 15810 set_byte_length(Smi::FromInt(0)); | |
| 15811 set_length(Smi::FromInt(0)); | 15790 set_length(Smi::FromInt(0)); |
| 15812 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); | 15791 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
| 15813 } | 15792 } |
| 15814 | 15793 |
| 15815 | 15794 |
| 15816 Type* PropertyCell::type() { | 15795 Type* PropertyCell::type() { |
| 15817 return static_cast<Type*>(type_raw()); | 15796 return static_cast<Type*>(type_raw()); |
| 15818 } | 15797 } |
| 15819 | 15798 |
| 15820 | 15799 |
| 15821 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { | 15800 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { |
| 15822 set_type_raw(type, ignored); | 15801 set_type_raw(type, ignored); |
| 15823 } | 15802 } |
| 15824 | 15803 |
| 15825 | 15804 |
| 15805 void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) { |
| 15806 Handle<DependentCode> dep(dependent_code()); |
| 15807 Handle<DependentCode> codes = |
| 15808 DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup, |
| 15809 info->object_wrapper()); |
| 15810 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15811 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 15812 Handle<HeapObject>(this), info->zone()); |
| 15813 } |
| 15814 |
| 15815 |
| 15816 void PropertyCell::AddDependentCode(Handle<Code> code) { |
| 15817 Handle<DependentCode> codes = DependentCode::Insert( |
| 15818 Handle<DependentCode>(dependent_code()), |
| 15819 DependentCode::kPropertyCellChangedGroup, code); |
| 15820 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15821 } |
| 15822 |
| 15823 |
| 15826 } } // namespace v8::internal | 15824 } } // namespace v8::internal |
| OLD | NEW |