| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2459 Object* obj; | 2459 Object* obj; |
| 2460 | 2460 |
| 2461 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 2461 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 2462 if (!maybe_obj->ToObject(&obj)) return false; | 2462 if (!maybe_obj->ToObject(&obj)) return false; |
| 2463 } | 2463 } |
| 2464 // Don't use Smi-only elements optimizations for objects with the neander | 2464 // Don't use Smi-only elements optimizations for objects with the neander |
| 2465 // map. There are too many cases where element values are set directly with a | 2465 // map. There are too many cases where element values are set directly with a |
| 2466 // bottleneck to trap the Smi-only -> fast elements transition, and there | 2466 // bottleneck to trap the Smi-only -> fast elements transition, and there |
| 2467 // appears to be no benefit for optimize this case. | 2467 // appears to be no benefit for optimize this case. |
| 2468 Map* new_neander_map = Map::cast(obj); | 2468 Map* new_neander_map = Map::cast(obj); |
| 2469 new_neander_map->set_elements_kind(FAST_ELEMENTS); | 2469 new_neander_map->set_elements_kind(TERMINAL_FAST_ELEMENTS_KIND); |
| 2470 set_neander_map(new_neander_map); | 2470 set_neander_map(new_neander_map); |
| 2471 | 2471 |
| 2472 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(neander_map()); | 2472 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(neander_map()); |
| 2473 if (!maybe_obj->ToObject(&obj)) return false; | 2473 if (!maybe_obj->ToObject(&obj)) return false; |
| 2474 } | 2474 } |
| 2475 Object* elements; | 2475 Object* elements; |
| 2476 { MaybeObject* maybe_elements = AllocateFixedArray(2); | 2476 { MaybeObject* maybe_elements = AllocateFixedArray(2); |
| 2477 if (!maybe_elements->ToObject(&elements)) return false; | 2477 if (!maybe_elements->ToObject(&elements)) return false; |
| 2478 } | 2478 } |
| 2479 FixedArray::cast(elements)->set(0, Smi::FromInt(0)); | 2479 FixedArray::cast(elements)->set(0, Smi::FromInt(0)); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3041 int end_position, | 3041 int end_position, |
| 3042 Object* script, | 3042 Object* script, |
| 3043 Object* stack_trace, | 3043 Object* stack_trace, |
| 3044 Object* stack_frames) { | 3044 Object* stack_frames) { |
| 3045 Object* result; | 3045 Object* result; |
| 3046 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE); | 3046 { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE); |
| 3047 if (!maybe_result->ToObject(&result)) return maybe_result; | 3047 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 3048 } | 3048 } |
| 3049 JSMessageObject* message = JSMessageObject::cast(result); | 3049 JSMessageObject* message = JSMessageObject::cast(result); |
| 3050 message->set_properties(Heap::empty_fixed_array(), SKIP_WRITE_BARRIER); | 3050 message->set_properties(Heap::empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 3051 message->initialize_elements(); |
| 3051 message->set_elements(Heap::empty_fixed_array(), SKIP_WRITE_BARRIER); | 3052 message->set_elements(Heap::empty_fixed_array(), SKIP_WRITE_BARRIER); |
| 3052 message->set_type(type); | 3053 message->set_type(type); |
| 3053 message->set_arguments(arguments); | 3054 message->set_arguments(arguments); |
| 3054 message->set_start_position(start_position); | 3055 message->set_start_position(start_position); |
| 3055 message->set_end_position(end_position); | 3056 message->set_end_position(end_position); |
| 3056 message->set_script(script); | 3057 message->set_script(script); |
| 3057 message->set_stack_trace(stack_trace); | 3058 message->set_stack_trace(stack_trace); |
| 3058 message->set_stack_frames(stack_frames); | 3059 message->set_stack_frames(stack_frames); |
| 3059 return result; | 3060 return result; |
| 3060 } | 3061 } |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3742 Smi::FromInt(length), | 3743 Smi::FromInt(length), |
| 3743 SKIP_WRITE_BARRIER); | 3744 SKIP_WRITE_BARRIER); |
| 3744 // Set the callee property for non-strict mode arguments object only. | 3745 // Set the callee property for non-strict mode arguments object only. |
| 3745 if (!strict_mode_callee) { | 3746 if (!strict_mode_callee) { |
| 3746 JSObject::cast(result)->InObjectPropertyAtPut(kArgumentsCalleeIndex, | 3747 JSObject::cast(result)->InObjectPropertyAtPut(kArgumentsCalleeIndex, |
| 3747 callee); | 3748 callee); |
| 3748 } | 3749 } |
| 3749 | 3750 |
| 3750 // Check the state of the object | 3751 // Check the state of the object |
| 3751 ASSERT(JSObject::cast(result)->HasFastProperties()); | 3752 ASSERT(JSObject::cast(result)->HasFastProperties()); |
| 3752 ASSERT(JSObject::cast(result)->HasFastElements()); | 3753 ASSERT(JSObject::cast(result)->HasFastObjectElements()); |
| 3753 | 3754 |
| 3754 return result; | 3755 return result; |
| 3755 } | 3756 } |
| 3756 | 3757 |
| 3757 | 3758 |
| 3758 static bool HasDuplicates(DescriptorArray* descriptors) { | 3759 static bool HasDuplicates(DescriptorArray* descriptors) { |
| 3759 int count = descriptors->number_of_descriptors(); | 3760 int count = descriptors->number_of_descriptors(); |
| 3760 if (count > 1) { | 3761 if (count > 1) { |
| 3761 String* prev_key = descriptors->GetKey(0); | 3762 String* prev_key = descriptors->GetKey(0); |
| 3762 for (int i = 1; i != count; i++) { | 3763 for (int i = 1; i != count; i++) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 3787 prototype = fun->instance_prototype(); | 3788 prototype = fun->instance_prototype(); |
| 3788 } else { | 3789 } else { |
| 3789 { MaybeObject* maybe_prototype = AllocateFunctionPrototype(fun); | 3790 { MaybeObject* maybe_prototype = AllocateFunctionPrototype(fun); |
| 3790 if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype; | 3791 if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype; |
| 3791 } | 3792 } |
| 3792 } | 3793 } |
| 3793 Map* map = Map::cast(map_obj); | 3794 Map* map = Map::cast(map_obj); |
| 3794 map->set_inobject_properties(in_object_properties); | 3795 map->set_inobject_properties(in_object_properties); |
| 3795 map->set_unused_property_fields(in_object_properties); | 3796 map->set_unused_property_fields(in_object_properties); |
| 3796 map->set_prototype(prototype); | 3797 map->set_prototype(prototype); |
| 3797 ASSERT(map->has_fast_elements()); | 3798 ASSERT(map->has_fast_object_elements()); |
| 3798 | 3799 |
| 3799 // If the function has only simple this property assignments add | 3800 // If the function has only simple this property assignments add |
| 3800 // field descriptors for these to the initial map as the object | 3801 // field descriptors for these to the initial map as the object |
| 3801 // cannot be constructed without having these properties. Guard by | 3802 // cannot be constructed without having these properties. Guard by |
| 3802 // the inline_new flag so we only change the map if we generate a | 3803 // the inline_new flag so we only change the map if we generate a |
| 3803 // specialized construct stub. | 3804 // specialized construct stub. |
| 3804 ASSERT(in_object_properties <= Map::kMaxPreAllocatedPropertyFields); | 3805 ASSERT(in_object_properties <= Map::kMaxPreAllocatedPropertyFields); |
| 3805 if (fun->shared()->CanGenerateInlineConstructor(prototype)) { | 3806 if (fun->shared()->CanGenerateInlineConstructor(prototype)) { |
| 3806 int count = fun->shared()->this_property_assignments_count(); | 3807 int count = fun->shared()->this_property_assignments_count(); |
| 3807 if (count > in_object_properties) { | 3808 if (count > in_object_properties) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3904 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; | 3905 if (map->instance_size() > Page::kMaxNonCodeHeapObjectSize) space = LO_SPACE; |
| 3905 Object* obj; | 3906 Object* obj; |
| 3906 { MaybeObject* maybe_obj = Allocate(map, space); | 3907 { MaybeObject* maybe_obj = Allocate(map, space); |
| 3907 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 3908 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
| 3908 } | 3909 } |
| 3909 | 3910 |
| 3910 // Initialize the JSObject. | 3911 // Initialize the JSObject. |
| 3911 InitializeJSObjectFromMap(JSObject::cast(obj), | 3912 InitializeJSObjectFromMap(JSObject::cast(obj), |
| 3912 FixedArray::cast(properties), | 3913 FixedArray::cast(properties), |
| 3913 map); | 3914 map); |
| 3914 ASSERT(JSObject::cast(obj)->HasFastSmiOnlyElements() || | 3915 ASSERT(JSObject::cast(obj)->HasFastSmiOrObjectElements()); |
| 3915 JSObject::cast(obj)->HasFastElements()); | |
| 3916 return obj; | 3916 return obj; |
| 3917 } | 3917 } |
| 3918 | 3918 |
| 3919 | 3919 |
| 3920 MaybeObject* Heap::AllocateJSObject(JSFunction* constructor, | 3920 MaybeObject* Heap::AllocateJSObject(JSFunction* constructor, |
| 3921 PretenureFlag pretenure) { | 3921 PretenureFlag pretenure) { |
| 3922 // Allocate the initial map if absent. | 3922 // Allocate the initial map if absent. |
| 3923 if (!constructor->has_initial_map()) { | 3923 if (!constructor->has_initial_map()) { |
| 3924 Object* initial_map; | 3924 Object* initial_map; |
| 3925 { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); | 3925 { MaybeObject* maybe_initial_map = AllocateInitialMap(constructor); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3949 return AllocateJSObjectFromMap(map, TENURED); | 3949 return AllocateJSObjectFromMap(map, TENURED); |
| 3950 } | 3950 } |
| 3951 | 3951 |
| 3952 | 3952 |
| 3953 MaybeObject* Heap::AllocateJSArrayAndStorage( | 3953 MaybeObject* Heap::AllocateJSArrayAndStorage( |
| 3954 ElementsKind elements_kind, | 3954 ElementsKind elements_kind, |
| 3955 int length, | 3955 int length, |
| 3956 int capacity, | 3956 int capacity, |
| 3957 ArrayStorageAllocationMode mode, | 3957 ArrayStorageAllocationMode mode, |
| 3958 PretenureFlag pretenure) { | 3958 PretenureFlag pretenure) { |
| 3959 if (capacity == 59) { |
| 3960 OS::DebugBreak(); |
| 3961 } |
| 3959 ASSERT(capacity >= length); | 3962 ASSERT(capacity >= length); |
| 3963 if (length != 0 && mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE) { |
| 3964 elements_kind = GetHoleyElementsKind(elements_kind); |
| 3965 } |
| 3960 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure); | 3966 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure); |
| 3961 JSArray* array; | 3967 JSArray* array; |
| 3962 if (!maybe_array->To(&array)) return maybe_array; | 3968 if (!maybe_array->To(&array)) return maybe_array; |
| 3963 | 3969 |
| 3964 if (capacity == 0) { | 3970 if (capacity == 0) { |
| 3965 array->set_length(Smi::FromInt(0)); | 3971 array->set_length(Smi::FromInt(0)); |
| 3966 array->set_elements(empty_fixed_array()); | 3972 array->set_elements(empty_fixed_array()); |
| 3967 return array; | 3973 return array; |
| 3968 } | 3974 } |
| 3969 | 3975 |
| 3970 FixedArrayBase* elms; | 3976 FixedArrayBase* elms; |
| 3971 MaybeObject* maybe_elms = NULL; | 3977 MaybeObject* maybe_elms = NULL; |
| 3972 if (elements_kind == FAST_DOUBLE_ELEMENTS) { | 3978 if (elements_kind == FAST_DOUBLE_ELEMENTS) { |
| 3973 if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { | 3979 if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { |
| 3974 maybe_elms = AllocateUninitializedFixedDoubleArray(capacity); | 3980 maybe_elms = AllocateUninitializedFixedDoubleArray(capacity); |
| 3975 } else { | 3981 } else { |
| 3976 ASSERT(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); | 3982 ASSERT(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
| 3977 maybe_elms = AllocateFixedDoubleArrayWithHoles(capacity); | 3983 maybe_elms = AllocateFixedDoubleArrayWithHoles(capacity); |
| 3978 } | 3984 } |
| 3979 } else { | 3985 } else { |
| 3980 ASSERT(elements_kind == FAST_ELEMENTS || | 3986 ASSERT(IsFastSmiOrObjectElementsKind(elements_kind)); |
| 3981 elements_kind == FAST_SMI_ONLY_ELEMENTS); | |
| 3982 if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { | 3987 if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { |
| 3983 maybe_elms = AllocateUninitializedFixedArray(capacity); | 3988 maybe_elms = AllocateUninitializedFixedArray(capacity); |
| 3984 } else { | 3989 } else { |
| 3985 ASSERT(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); | 3990 ASSERT(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
| 3986 maybe_elms = AllocateFixedArrayWithHoles(capacity); | 3991 maybe_elms = AllocateFixedArrayWithHoles(capacity); |
| 3987 } | 3992 } |
| 3988 } | 3993 } |
| 3989 if (!maybe_elms->To(&elms)) return maybe_elms; | 3994 if (!maybe_elms->To(&elms)) return maybe_elms; |
| 3990 | 3995 |
| 3991 array->set_elements(elms); | 3996 array->set_elements(elms); |
| 3992 array->set_length(Smi::FromInt(length)); | 3997 array->set_length(Smi::FromInt(length)); |
| 3993 return array; | 3998 return array; |
| 3994 } | 3999 } |
| 3995 | 4000 |
| 3996 | 4001 |
| 3997 MaybeObject* Heap::AllocateJSArrayWithElements( | 4002 MaybeObject* Heap::AllocateJSArrayWithElements( |
| 3998 FixedArrayBase* elements, | 4003 FixedArrayBase* elements, |
| 3999 ElementsKind elements_kind, | 4004 ElementsKind elements_kind, |
| 4000 PretenureFlag pretenure) { | 4005 PretenureFlag pretenure) { |
| 4001 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure); | 4006 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure); |
| 4002 JSArray* array; | 4007 JSArray* array; |
| 4003 if (!maybe_array->To(&array)) return maybe_array; | 4008 if (!maybe_array->To(&array)) return maybe_array; |
| 4004 | 4009 |
| 4005 array->set_elements(elements); | 4010 array->set_elements(elements); |
| 4006 array->set_length(Smi::FromInt(elements->length())); | 4011 array->set_length(Smi::FromInt(elements->length())); |
| 4012 #if DEBUG |
| 4013 array->ValidateElements(); |
| 4014 #endif |
| 4007 return array; | 4015 return array; |
| 4008 } | 4016 } |
| 4009 | 4017 |
| 4010 | 4018 |
| 4011 MaybeObject* Heap::AllocateJSProxy(Object* handler, Object* prototype) { | 4019 MaybeObject* Heap::AllocateJSProxy(Object* handler, Object* prototype) { |
| 4012 // Allocate map. | 4020 // Allocate map. |
| 4013 // TODO(rossberg): Once we optimize proxies, think about a scheme to share | 4021 // TODO(rossberg): Once we optimize proxies, think about a scheme to share |
| 4014 // maps. Will probably depend on the identity of the handler object, too. | 4022 // maps. Will probably depend on the identity of the handler object, too. |
| 4015 Map* map; | 4023 Map* map; |
| 4016 MaybeObject* maybe_map_obj = AllocateMap(JS_PROXY_TYPE, JSProxy::kSize); | 4024 MaybeObject* maybe_map_obj = AllocateMap(JS_PROXY_TYPE, JSProxy::kSize); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4527 return result; | 4535 return result; |
| 4528 } | 4536 } |
| 4529 | 4537 |
| 4530 | 4538 |
| 4531 MaybeObject* Heap::AllocateJSArray( | 4539 MaybeObject* Heap::AllocateJSArray( |
| 4532 ElementsKind elements_kind, | 4540 ElementsKind elements_kind, |
| 4533 PretenureFlag pretenure) { | 4541 PretenureFlag pretenure) { |
| 4534 Context* global_context = isolate()->context()->global_context(); | 4542 Context* global_context = isolate()->context()->global_context(); |
| 4535 JSFunction* array_function = global_context->array_function(); | 4543 JSFunction* array_function = global_context->array_function(); |
| 4536 Map* map = array_function->initial_map(); | 4544 Map* map = array_function->initial_map(); |
| 4537 if (elements_kind == FAST_DOUBLE_ELEMENTS) { | 4545 Object* maybe_map_array = global_context->js_array_maps(); |
| 4538 map = Map::cast(global_context->double_js_array_map()); | 4546 if (!maybe_map_array->IsUndefined()) { |
| 4539 } else if (elements_kind == FAST_ELEMENTS || !FLAG_smi_only_arrays) { | 4547 Object* maybe_transitioned_map = |
| 4540 map = Map::cast(global_context->object_js_array_map()); | 4548 FixedArray::cast(maybe_map_array)->get(elements_kind); |
| 4541 } else { | 4549 if (!maybe_transitioned_map->IsUndefined()) { |
| 4542 ASSERT(elements_kind == FAST_SMI_ONLY_ELEMENTS); | 4550 map = Map::cast(maybe_transitioned_map); |
| 4543 ASSERT(map == global_context->smi_js_array_map()); | 4551 } |
| 4544 } | 4552 } |
| 4545 | 4553 |
| 4546 return AllocateJSObjectFromMap(map, pretenure); | 4554 return AllocateJSObjectFromMap(map, pretenure); |
| 4547 } | 4555 } |
| 4548 | 4556 |
| 4549 | 4557 |
| 4550 MaybeObject* Heap::AllocateEmptyFixedArray() { | 4558 MaybeObject* Heap::AllocateEmptyFixedArray() { |
| 4551 int size = FixedArray::SizeFor(0); | 4559 int size = FixedArray::SizeFor(0); |
| 4552 Object* result; | 4560 Object* result; |
| 4553 { MaybeObject* maybe_result = | 4561 { MaybeObject* maybe_result = |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4688 MaybeObject* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) { | 4696 MaybeObject* Heap::AllocateFixedArray(int length, PretenureFlag pretenure) { |
| 4689 return AllocateFixedArrayWithFiller(this, | 4697 return AllocateFixedArrayWithFiller(this, |
| 4690 length, | 4698 length, |
| 4691 pretenure, | 4699 pretenure, |
| 4692 undefined_value()); | 4700 undefined_value()); |
| 4693 } | 4701 } |
| 4694 | 4702 |
| 4695 | 4703 |
| 4696 MaybeObject* Heap::AllocateFixedArrayWithHoles(int length, | 4704 MaybeObject* Heap::AllocateFixedArrayWithHoles(int length, |
| 4697 PretenureFlag pretenure) { | 4705 PretenureFlag pretenure) { |
| 4698 return AllocateFixedArrayWithFiller(this, | 4706 return AllocateFixedArrayWithFiller(this, |
| 4699 length, | 4707 length, |
| 4700 pretenure, | 4708 pretenure, |
| 4701 the_hole_value()); | 4709 the_hole_value()); |
| 4702 } | 4710 } |
| 4703 | 4711 |
| 4704 | 4712 |
| 4705 MaybeObject* Heap::AllocateUninitializedFixedArray(int length) { | 4713 MaybeObject* Heap::AllocateUninitializedFixedArray(int length) { |
| 4706 if (length == 0) return empty_fixed_array(); | 4714 if (length == 0) return empty_fixed_array(); |
| 4707 | 4715 |
| 4708 Object* obj; | 4716 Object* obj; |
| 4709 { MaybeObject* maybe_obj = AllocateRawFixedArray(length); | 4717 { MaybeObject* maybe_obj = AllocateRawFixedArray(length); |
| 4710 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 4718 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
| 4711 } | 4719 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4818 | 4826 |
| 4819 | 4827 |
| 4820 MaybeObject* Heap::AllocateGlobalContext() { | 4828 MaybeObject* Heap::AllocateGlobalContext() { |
| 4821 Object* result; | 4829 Object* result; |
| 4822 { MaybeObject* maybe_result = | 4830 { MaybeObject* maybe_result = |
| 4823 AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS); | 4831 AllocateFixedArray(Context::GLOBAL_CONTEXT_SLOTS); |
| 4824 if (!maybe_result->ToObject(&result)) return maybe_result; | 4832 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 4825 } | 4833 } |
| 4826 Context* context = reinterpret_cast<Context*>(result); | 4834 Context* context = reinterpret_cast<Context*>(result); |
| 4827 context->set_map_no_write_barrier(global_context_map()); | 4835 context->set_map_no_write_barrier(global_context_map()); |
| 4828 context->set_smi_js_array_map(undefined_value()); | 4836 context->set_js_array_maps(undefined_value()); |
| 4829 context->set_double_js_array_map(undefined_value()); | |
| 4830 context->set_object_js_array_map(undefined_value()); | |
| 4831 ASSERT(context->IsGlobalContext()); | 4837 ASSERT(context->IsGlobalContext()); |
| 4832 ASSERT(result->IsContext()); | 4838 ASSERT(result->IsContext()); |
| 4833 return result; | 4839 return result; |
| 4834 } | 4840 } |
| 4835 | 4841 |
| 4836 | 4842 |
| 4837 MaybeObject* Heap::AllocateModuleContext(Context* previous, | 4843 MaybeObject* Heap::AllocateModuleContext(Context* previous, |
| 4838 ScopeInfo* scope_info) { | 4844 ScopeInfo* scope_info) { |
| 4839 Object* result; | 4845 Object* result; |
| 4840 { MaybeObject* maybe_result = | 4846 { MaybeObject* maybe_result = |
| (...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7134 } else { | 7140 } else { |
| 7135 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. | 7141 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. |
| 7136 } | 7142 } |
| 7137 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = | 7143 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = |
| 7138 reinterpret_cast<Address>(p); | 7144 reinterpret_cast<Address>(p); |
| 7139 remembered_unmapped_pages_index_++; | 7145 remembered_unmapped_pages_index_++; |
| 7140 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; | 7146 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; |
| 7141 } | 7147 } |
| 7142 | 7148 |
| 7143 } } // namespace v8::internal | 7149 } } // namespace v8::internal |
| OLD | NEW |