| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
| 9 #include "src/elements.h" | 9 #include "src/elements.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 static void SetImpl(FixedArrayBase* store, uint32_t index, Object* value) { | 1481 static void SetImpl(FixedArrayBase* store, uint32_t index, Object* value) { |
| 1482 FixedArray* parameter_map = FixedArray::cast(store); | 1482 FixedArray* parameter_map = FixedArray::cast(store); |
| 1483 Object* probe = GetParameterMapArg(parameter_map, index); | 1483 Object* probe = GetParameterMapArg(parameter_map, index); |
| 1484 if (!probe->IsTheHole()) { | 1484 if (!probe->IsTheHole()) { |
| 1485 Context* context = Context::cast(parameter_map->get(0)); | 1485 Context* context = Context::cast(parameter_map->get(0)); |
| 1486 int context_entry = Smi::cast(probe)->value(); | 1486 int context_entry = Smi::cast(probe)->value(); |
| 1487 DCHECK(!context->get(context_entry)->IsTheHole()); | 1487 DCHECK(!context->get(context_entry)->IsTheHole()); |
| 1488 context->set(context_entry, value); | 1488 context->set(context_entry, value); |
| 1489 } else { | 1489 } else { |
| 1490 FixedArray* arguments = FixedArray::cast(parameter_map->get(1)); | 1490 FixedArray* arguments = FixedArray::cast(parameter_map->get(1)); |
| 1491 ArgumentsAccessor::SetImpl(arguments, index, value); | 1491 SeededNumberDictionary* backing_store = |
| 1492 SeededNumberDictionary::cast(arguments); |
| 1493 int entry = backing_store->FindEntry(index); |
| 1494 DCHECK_NE(entry, SeededNumberDictionary::kNotFound); |
| 1495 Object* current_value = backing_store->ValueAt(entry); |
| 1496 if (current_value->IsAliasedArgumentsEntry()) { |
| 1497 DisallowHeapAllocation no_gc; |
| 1498 AliasedArgumentsEntry* alias = |
| 1499 AliasedArgumentsEntry::cast(current_value); |
| 1500 Context* context = Context::cast(parameter_map->get(0)); |
| 1501 int context_entry = alias->aliased_context_slot(); |
| 1502 DCHECK(!context->get(context_entry)->IsTheHole()); |
| 1503 context->set(context_entry, value); |
| 1504 } else { |
| 1505 ArgumentsAccessor::SetImpl(arguments, index, value); |
| 1506 } |
| 1492 } | 1507 } |
| 1493 } | 1508 } |
| 1494 | 1509 |
| 1495 static void SetLengthImpl(Handle<JSArray> array, uint32_t length, | 1510 static void SetLengthImpl(Handle<JSArray> array, uint32_t length, |
| 1496 Handle<FixedArrayBase> parameter_map) { | 1511 Handle<FixedArrayBase> parameter_map) { |
| 1497 // Sloppy arguments objects are not arrays. | 1512 // Sloppy arguments objects are not arrays. |
| 1498 UNREACHABLE(); | 1513 UNREACHABLE(); |
| 1499 } | 1514 } |
| 1500 | 1515 |
| 1501 static uint32_t GetCapacityImpl(JSObject* holder, | 1516 static uint32_t GetCapacityImpl(JSObject* holder, |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; | 1950 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; |
| 1936 ELEMENTS_LIST(ACCESSOR_DELETE) | 1951 ELEMENTS_LIST(ACCESSOR_DELETE) |
| 1937 #undef ACCESSOR_DELETE | 1952 #undef ACCESSOR_DELETE |
| 1938 elements_accessors_ = NULL; | 1953 elements_accessors_ = NULL; |
| 1939 } | 1954 } |
| 1940 | 1955 |
| 1941 | 1956 |
| 1942 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; | 1957 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; |
| 1943 } // namespace internal | 1958 } // namespace internal |
| 1944 } // namespace v8 | 1959 } // namespace v8 |
| OLD | NEW |