Changeset 199699 in webkit for trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
- Timestamp:
- Apr 18, 2016, 6:38:30 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r199179 r199699 1159 1159 RefPtr<RegisterID> oldValue = emitPostIncOrDec(generator, generator.finalDestination(dst), value.get(), m_operator); 1160 1160 if (!var.isReadOnly()) { 1161 generator.emitPutToScope(scope.get(), var, value.get(), ThrowIfNotFound, NotInitialization);1161 generator.emitPutToScope(scope.get(), var, value.get(), ThrowIfNotFound, InitializationMode::NotInitialization); 1162 1162 generator.emitProfileType(value.get(), var, divotStart(), divotEnd()); 1163 1163 } … … 1359 1359 emitIncOrDec(generator, value.get(), m_operator); 1360 1360 if (!var.isReadOnly()) { 1361 generator.emitPutToScope(scope.get(), var, value.get(), ThrowIfNotFound, NotInitialization);1361 generator.emitPutToScope(scope.get(), var, value.get(), ThrowIfNotFound, InitializationMode::NotInitialization); 1362 1362 generator.emitProfileType(value.get(), var, divotStart(), divotEnd()); 1363 1363 } … … 1910 1910 RegisterID* returnResult = result.get(); 1911 1911 if (!var.isReadOnly()) { 1912 returnResult = generator.emitPutToScope(scope.get(), var, result.get(), ThrowIfNotFound, NotInitialization);1912 returnResult = generator.emitPutToScope(scope.get(), var, result.get(), ThrowIfNotFound, InitializationMode::NotInitialization); 1913 1913 generator.emitProfileType(result.get(), var, divotStart(), divotEnd()); 1914 1914 } 1915 1915 return returnResult; 1916 } 1917 1918 static InitializationMode initializationModeForAssignmentContext(AssignmentContext assignmentContext) 1919 { 1920 switch (assignmentContext) { 1921 case AssignmentContext::DeclarationStatement: 1922 return InitializationMode::Initialization; 1923 case AssignmentContext::ConstDeclarationStatement: 1924 return InitializationMode::ConstInitialization; 1925 case AssignmentContext::AssignmentExpression: 1926 return InitializationMode::NotInitialization; 1927 } 1928 1929 ASSERT_NOT_REACHED(); 1930 return InitializationMode::NotInitialization; 1916 1931 } 1917 1932 … … 1967 1982 RegisterID* returnResult = result.get(); 1968 1983 if (!isReadOnly) { 1969 returnResult = generator.emitPutToScope(scope.get(), var, result.get(), generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, 1970 m_assignmentContext == AssignmentContext::ConstDeclarationStatement || m_assignmentContext == AssignmentContext::DeclarationStatement ? Initialization : NotInitialization); 1984 returnResult = generator.emitPutToScope(scope.get(), var, result.get(), generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, initializationModeForAssignmentContext(m_assignmentContext)); 1971 1985 generator.emitProfileType(result.get(), var, divotStart(), divotEnd()); 1972 1986 } … … 2163 2177 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 2164 2178 RefPtr<RegisterID> value = generator.emitLoad(nullptr, jsUndefined()); 2165 generator.emitPutToScope(scope.get(), var, value.get(), generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, Initialization );2179 generator.emitPutToScope(scope.get(), var, value.get(), generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::Initialization); 2166 2180 generator.emitProfileType(value.get(), var, position(), JSTextPosition(-1, position().offset + m_ident.length(), -1)); 2167 2181 } … … 2371 2385 RegisterID* scope = generator.emitResolveScope(nullptr, var); 2372 2386 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); 2373 generator.emitPutToScope(scope, var, propertyName, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, NotInitialization);2387 generator.emitPutToScope(scope, var, propertyName, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization); 2374 2388 } 2375 2389 generator.emitProfileType(propertyName, var, m_lexpr->position(), JSTextPosition(-1, m_lexpr->position().offset + ident.length(), -1)); … … 2592 2606 RegisterID* scope = generator.emitResolveScope(nullptr, var); 2593 2607 generator.emitExpressionInfo(divot(), divotStart(), divotEnd()); 2594 generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, NotInitialization);2608 generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization); 2595 2609 } 2596 2610 generator.emitProfileType(value, var, m_lexpr->position(), JSTextPosition(-1, m_lexpr->position().offset + ident.length(), -1)); … … 3312 3326 RELEASE_ASSERT(classNameVar.isResolved()); 3313 3327 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, classNameVar); 3314 generator.emitPutToScope(scope.get(), classNameVar, constructor.get(), ThrowIfNotFound, Initialization );3328 generator.emitPutToScope(scope.get(), classNameVar, constructor.get(), ThrowIfNotFound, InitializationMode::Initialization); 3315 3329 generator.popLexicalScope(this); 3316 3330 } … … 3609 3623 return; 3610 3624 } 3611 generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, 3612 m_bindingContext == AssignmentContext::ConstDeclarationStatement || m_bindingContext == AssignmentContext::DeclarationStatement ? Initialization : NotInitialization); 3625 generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, initializationModeForAssignmentContext(m_bindingContext)); 3613 3626 generator.emitProfileType(value, var, divotStart(), divotEnd()); 3614 3627 if (m_bindingContext == AssignmentContext::DeclarationStatement || m_bindingContext == AssignmentContext::ConstDeclarationStatement) … … 3660 3673 generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd()); 3661 3674 if (!isReadOnly) { 3662 generator.emitPutToScope(scope.get(), var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, NotInitialization);3675 generator.emitPutToScope(scope.get(), var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization); 3663 3676 generator.emitProfileType(value, var, divotStart(), divotEnd()); 3664 3677 } … … 3711 3724 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 3712 3725 generator.emitExpressionInfo(m_divotEnd, m_divotStart, m_divotEnd); 3713 generator.emitPutToScope(scope.get(), var, restParameterArray.get(), generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, Initialization );3726 generator.emitPutToScope(scope.get(), var, restParameterArray.get(), generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::Initialization); 3714 3727 } 3715 3728
Note:
See TracChangeset
for help on using the changeset viewer.