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

Side by Side Diff: src/objects.cc

Issue 1122973002: Move more parts of stack trace formatting to runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 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 | « src/objects.h ('k') | src/runtime/runtime.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 6222 matching lines...) Expand 10 before | Expand all | Expand 10 after
6233 DCHECK(array->length() >= length); 6233 DCHECK(array->length() >= length);
6234 if (array->length() == length) return array; 6234 if (array->length() == length) return array;
6235 6235
6236 Handle<FixedArray> new_array = 6236 Handle<FixedArray> new_array =
6237 array->GetIsolate()->factory()->NewFixedArray(length); 6237 array->GetIsolate()->factory()->NewFixedArray(length);
6238 for (int i = 0; i < length; ++i) new_array->set(i, array->get(i)); 6238 for (int i = 0; i < length; ++i) new_array->set(i, array->get(i));
6239 return new_array; 6239 return new_array;
6240 } 6240 }
6241 6241
6242 6242
6243 static Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, 6243 Handle<FixedArray> JSObject::GetEnumPropertyKeys(Handle<JSObject> object,
6244 bool cache_result) { 6244 bool cache_result) {
6245 Isolate* isolate = object->GetIsolate(); 6245 Isolate* isolate = object->GetIsolate();
6246 if (object->HasFastProperties()) { 6246 if (object->HasFastProperties()) {
6247 int own_property_count = object->map()->EnumLength(); 6247 int own_property_count = object->map()->EnumLength();
6248 // If the enum length of the given map is set to kInvalidEnumCache, this 6248 // If the enum length of the given map is set to kInvalidEnumCache, this
6249 // means that the map itself has never used the present enum cache. The 6249 // means that the map itself has never used the present enum cache. The
6250 // first step to using the cache is to set the enum length of the map by 6250 // first step to using the cache is to set the enum length of the map by
6251 // counting the number of own descriptors that are not DONT_ENUM or 6251 // counting the number of own descriptors that are not DONT_ENUM or
6252 // SYMBOLIC. 6252 // SYMBOLIC.
6253 if (own_property_count == kInvalidEnumCacheSentinel) { 6253 if (own_property_count == kInvalidEnumCacheSentinel) {
6254 own_property_count = object->map()->NumberOfDescribedProperties( 6254 own_property_count = object->map()->NumberOfDescribedProperties(
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
6415 // array or dictionary. So the fast inline test for whether to 6415 // array or dictionary. So the fast inline test for whether to
6416 // use the cache says yes, so we should not create a cache. 6416 // use the cache says yes, so we should not create a cache.
6417 bool cache_enum_keys = 6417 bool cache_enum_keys =
6418 ((current->map()->GetConstructor() != *arguments_function) && 6418 ((current->map()->GetConstructor() != *arguments_function) &&
6419 !current->IsJSValue() && !current->IsAccessCheckNeeded() && 6419 !current->IsJSValue() && !current->IsAccessCheckNeeded() &&
6420 !current->HasNamedInterceptor() && !current->HasIndexedInterceptor()); 6420 !current->HasNamedInterceptor() && !current->HasIndexedInterceptor());
6421 // Compute the property keys and cache them if possible. 6421 // Compute the property keys and cache them if possible.
6422 ASSIGN_RETURN_ON_EXCEPTION( 6422 ASSIGN_RETURN_ON_EXCEPTION(
6423 isolate, content, 6423 isolate, content,
6424 FixedArray::UnionOfKeys( 6424 FixedArray::UnionOfKeys(
6425 content, GetEnumPropertyKeys(current, cache_enum_keys)), 6425 content, JSObject::GetEnumPropertyKeys(current, cache_enum_keys)),
6426 FixedArray); 6426 FixedArray);
6427 DCHECK(ContainsOnlyValidKeys(content)); 6427 DCHECK(ContainsOnlyValidKeys(content));
6428 6428
6429 // Add the non-symbol property keys from the interceptor. 6429 // Add the non-symbol property keys from the interceptor.
6430 if (current->HasNamedInterceptor()) { 6430 if (current->HasNamedInterceptor()) {
6431 Handle<JSObject> result; 6431 Handle<JSObject> result;
6432 if (JSObject::GetKeysForNamedInterceptor( 6432 if (JSObject::GetKeysForNamedInterceptor(
6433 current, object).ToHandle(&result)) { 6433 current, object).ToHandle(&result)) {
6434 ASSIGN_RETURN_ON_EXCEPTION( 6434 ASSIGN_RETURN_ON_EXCEPTION(
6435 isolate, content, FixedArray::AddKeysFromArrayLike( 6435 isolate, content, FixedArray::AddKeysFromArrayLike(
(...skipping 10803 matching lines...) Expand 10 before | Expand all | Expand 10 after
17239 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17239 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17240 Handle<Object> new_value) { 17240 Handle<Object> new_value) {
17241 if (cell->value() != *new_value) { 17241 if (cell->value() != *new_value) {
17242 cell->set_value(*new_value); 17242 cell->set_value(*new_value);
17243 Isolate* isolate = cell->GetIsolate(); 17243 Isolate* isolate = cell->GetIsolate();
17244 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17244 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17245 isolate, DependentCode::kPropertyCellChangedGroup); 17245 isolate, DependentCode::kPropertyCellChangedGroup);
17246 } 17246 }
17247 } 17247 }
17248 } } // namespace v8::internal 17248 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698