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 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2595 if (IsFastElementsKind(to_kind)) { | 2595 if (IsFastElementsKind(to_kind)) { |
2596 allow_store_transition &= | 2596 allow_store_transition &= |
2597 IsTransitionableFastElementsKind(from_kind) && | 2597 IsTransitionableFastElementsKind(from_kind) && |
2598 IsMoreGeneralElementsKindTransition(from_kind, to_kind); | 2598 IsMoreGeneralElementsKindTransition(from_kind, to_kind); |
2599 } | 2599 } |
2600 | 2600 |
2601 if (!allow_store_transition) { | 2601 if (!allow_store_transition) { |
2602 return start_map->CopyAsElementsKind(to_kind, OMIT_TRANSITION); | 2602 return start_map->CopyAsElementsKind(to_kind, OMIT_TRANSITION); |
2603 } | 2603 } |
2604 | 2604 |
2605 Map* closest_map = FindClosestElementsTransition(start_map, to_kind); | 2605 return start_map->AsElementsKind(to_kind); |
| 2606 } |
2606 | 2607 |
2607 if (closest_map->elements_kind() == to_kind) { | 2608 |
| 2609 MaybeObject* Map::AsElementsKind(ElementsKind kind) { |
| 2610 Map* closest_map = FindClosestElementsTransition(this, kind); |
| 2611 |
| 2612 if (closest_map->elements_kind() == kind) { |
2608 return closest_map; | 2613 return closest_map; |
2609 } | 2614 } |
2610 | 2615 |
2611 return AddMissingElementsTransitions(closest_map, to_kind); | 2616 return AddMissingElementsTransitions(closest_map, kind); |
2612 } | 2617 } |
2613 | 2618 |
2614 | 2619 |
2615 void JSObject::LocalLookupRealNamedProperty(Name* name, LookupResult* result) { | 2620 void JSObject::LocalLookupRealNamedProperty(Name* name, LookupResult* result) { |
2616 if (IsJSGlobalProxy()) { | 2621 if (IsJSGlobalProxy()) { |
2617 Object* proto = GetPrototype(); | 2622 Object* proto = GetPrototype(); |
2618 if (proto->IsNull()) return result->NotFound(); | 2623 if (proto->IsNull()) return result->NotFound(); |
2619 ASSERT(proto->IsJSGlobalObject()); | 2624 ASSERT(proto->IsJSGlobalObject()); |
2620 // A GlobalProxy's prototype should always be a proper JSObject. | 2625 // A GlobalProxy's prototype should always be a proper JSObject. |
2621 return JSObject::cast(proto)->LocalLookupRealNamedProperty(name, result); | 2626 return JSObject::cast(proto)->LocalLookupRealNamedProperty(name, result); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3066 | 3071 |
3067 | 3072 |
3068 void JSObject::AddFastPropertyUsingMap(Handle<JSObject> object, | 3073 void JSObject::AddFastPropertyUsingMap(Handle<JSObject> object, |
3069 Handle<Map> map) { | 3074 Handle<Map> map) { |
3070 CALL_HEAP_FUNCTION_VOID( | 3075 CALL_HEAP_FUNCTION_VOID( |
3071 object->GetIsolate(), | 3076 object->GetIsolate(), |
3072 object->AddFastPropertyUsingMap(*map)); | 3077 object->AddFastPropertyUsingMap(*map)); |
3073 } | 3078 } |
3074 | 3079 |
3075 | 3080 |
| 3081 void JSObject::TransitionToMap(Handle<JSObject> object, Handle<Map> map) { |
| 3082 CALL_HEAP_FUNCTION_VOID( |
| 3083 object->GetIsolate(), |
| 3084 object->TransitionToMap(*map)); |
| 3085 } |
| 3086 |
| 3087 |
3076 MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, | 3088 MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, |
3077 Name* name_raw, | 3089 Name* name_raw, |
3078 Object* value_raw, | 3090 Object* value_raw, |
3079 PropertyAttributes attributes, | 3091 PropertyAttributes attributes, |
3080 StrictModeFlag strict_mode, | 3092 StrictModeFlag strict_mode, |
3081 StoreFromKeyed store_mode) { | 3093 StoreFromKeyed store_mode) { |
3082 Heap* heap = GetHeap(); | 3094 Heap* heap = GetHeap(); |
3083 Isolate* isolate = heap->isolate(); | 3095 Isolate* isolate = heap->isolate(); |
3084 // Make sure that the top context does not change when doing callbacks or | 3096 // Make sure that the top context does not change when doing callbacks or |
3085 // interceptor calls. | 3097 // interceptor calls. |
(...skipping 11379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14465 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14477 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
14466 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14478 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
14467 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14479 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
14468 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14480 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
14469 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14481 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
14470 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14482 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
14471 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14483 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
14472 } | 14484 } |
14473 | 14485 |
14474 } } // namespace v8::internal | 14486 } } // namespace v8::internal |
OLD | NEW |