Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: src/objects.cc

Issue 2855133006: Fix FastAssign for self-assignment (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-716520.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 if (!it.IsFound()) continue; 2055 if (!it.IsFound()) continue;
2056 DCHECK(it.state() == LookupIterator::DATA || 2056 DCHECK(it.state() == LookupIterator::DATA ||
2057 it.state() == LookupIterator::ACCESSOR); 2057 it.state() == LookupIterator::ACCESSOR);
2058 if (!it.IsEnumerable()) continue; 2058 if (!it.IsEnumerable()) continue;
2059 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 2059 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
2060 isolate, prop_value, Object::GetProperty(&it), Nothing<bool>()); 2060 isolate, prop_value, Object::GetProperty(&it), Nothing<bool>());
2061 } 2061 }
2062 2062
2063 if (use_set) { 2063 if (use_set) {
2064 LookupIterator it(target, next_key, target); 2064 LookupIterator it(target, next_key, target);
2065 bool call_to_js = it.IsFound() && it.state() != LookupIterator::DATA;
2066 Maybe<bool> result = Object::SetProperty( 2065 Maybe<bool> result = Object::SetProperty(
2067 &it, prop_value, STRICT, Object::CERTAINLY_NOT_STORE_FROM_KEYED); 2066 &it, prop_value, STRICT, Object::CERTAINLY_NOT_STORE_FROM_KEYED);
2068 if (result.IsNothing()) return result; 2067 if (result.IsNothing()) return result;
2069 if (stable && call_to_js) stable = from->map() == *map; 2068 if (stable) stable = from->map() == *map;
2070 } else { 2069 } else {
2071 if (excluded_properties != nullptr && 2070 if (excluded_properties != nullptr &&
2072 HasExcludedProperty(excluded_properties, next_key)) { 2071 HasExcludedProperty(excluded_properties, next_key)) {
2073 continue; 2072 continue;
2074 } 2073 }
2075 2074
2076 // 4a ii 2. Perform ? CreateDataProperty(target, nextKey, propValue). 2075 // 4a ii 2. Perform ? CreateDataProperty(target, nextKey, propValue).
2077 bool success; 2076 bool success;
2078 LookupIterator it = LookupIterator::PropertyOrElement( 2077 LookupIterator it = LookupIterator::PropertyOrElement(
2079 isolate, target, next_key, &success, LookupIterator::OWN); 2078 isolate, target, next_key, &success, LookupIterator::OWN);
(...skipping 18584 matching lines...) Expand 10 before | Expand all | Expand 10 after
20664 // depend on this. 20663 // depend on this.
20665 return DICTIONARY_ELEMENTS; 20664 return DICTIONARY_ELEMENTS;
20666 } 20665 }
20667 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20666 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20668 return kind; 20667 return kind;
20669 } 20668 }
20670 } 20669 }
20671 20670
20672 } // namespace internal 20671 } // namespace internal
20673 } // namespace v8 20672 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-716520.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698