Changeset 253520 in webkit for trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
- Timestamp:
- Dec 13, 2019, 8:34:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r253458 r253520 55 55 #include "JSBigInt.h" 56 56 #include "JSCInlines.h" 57 #include "JSFixedArray.h"58 57 #include "JSGenericTypedArrayViewConstructorInlines.h" 59 58 #include "JSGlobalObjectFunctions.h" … … 3072 3071 for (unsigned i = 0; i < numItems; i++) { 3073 3072 JSValue value = JSValue::decode(values[i]); 3074 if (JS FixedArray* array = jsDynamicCast<JSFixedArray*>(vm, value))3075 checkedLength += array-> size();3073 if (JSImmutableButterfly* array = jsDynamicCast<JSImmutableButterfly*>(vm, value)) 3074 checkedLength += array->publicLength(); 3076 3075 else 3077 3076 ++checkedLength; … … 3101 3100 for (unsigned i = 0; i < numItems; i++) { 3102 3101 JSValue value = JSValue::decode(values[i]); 3103 if (JS FixedArray* array = jsDynamicCast<JSFixedArray*>(vm, value)) {3102 if (JSImmutableButterfly* array = jsDynamicCast<JSImmutableButterfly*>(vm, value)) { 3104 3103 // We are spreading. 3105 for (unsigned i = 0; i < array-> size(); i++) {3104 for (unsigned i = 0; i < array->publicLength(); i++) { 3106 3105 result->putDirectIndex(globalObject, index, array->get(i)); 3107 3106 RETURN_IF_EXCEPTION(scope, nullptr); … … 3119 3118 } 3120 3119 3121 JSCell* operationCreate FixedArray(JSGlobalObject* globalObject, unsigned length)3122 { 3123 VM& vm = globalObject->vm(); 3124 CallFrame* callFrame = DECLARE_CALL_FRAME(vm); 3125 JITOperationPrologueCallFrameTracer tracer(vm, callFrame); 3126 auto scope = DECLARE_THROW_SCOPE(vm); 3127 3128 if (JS FixedArray* result = JSFixedArray::tryCreate(vm, vm.fixedArrayStructure.get(), length))3120 JSCell* operationCreateImmutableButterfly(JSGlobalObject* globalObject, unsigned length) 3121 { 3122 VM& vm = globalObject->vm(); 3123 CallFrame* callFrame = DECLARE_CALL_FRAME(vm); 3124 JITOperationPrologueCallFrameTracer tracer(vm, callFrame); 3125 auto scope = DECLARE_THROW_SCOPE(vm); 3126 3127 if (JSImmutableButterfly* result = JSImmutableButterfly::tryCreate(vm, vm.immutableButterflyStructures[arrayIndexFromIndexingType(CopyOnWriteArrayWithContiguous) - NumberOfIndexingShapes].get(), length)) 3129 3128 return result; 3130 3129 … … 3144 3143 JSArray* array = jsCast<JSArray*>(iterable); 3145 3144 if (array->isIteratorProtocolFastAndNonObservable()) 3146 RELEASE_AND_RETURN(throwScope, JS FixedArray::createFromArray(globalObject, vm, array));3145 RELEASE_AND_RETURN(throwScope, JSImmutableButterfly::createFromArray(globalObject, vm, array)); 3147 3146 } 3148 3147 … … 3165 3164 } 3166 3165 3167 RELEASE_AND_RETURN(throwScope, JS FixedArray::createFromArray(globalObject, vm, array));3166 RELEASE_AND_RETURN(throwScope, JSImmutableButterfly::createFromArray(globalObject, vm, array)); 3168 3167 } 3169 3168 … … 3178 3177 ASSERT(array->isIteratorProtocolFastAndNonObservable()); 3179 3178 3180 return JS FixedArray::createFromArray(globalObject, vm, array);3179 return JSImmutableButterfly::createFromArray(globalObject, vm, array); 3181 3180 } 3182 3181
Note:
See TracChangeset
for help on using the changeset viewer.