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

Side by Side Diff: src/objects-debug.cc

Issue 1221713003: Distinguish slow from fast sloppy arguments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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.cc ('k') | src/objects-inl.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 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/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/jsregexp.h" 10 #include "src/jsregexp.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // pointer may point to a one pointer filler map. 250 // pointer may point to a one pointer filler map.
251 return reinterpret_cast<Map*>(elements()) != 251 return reinterpret_cast<Map*>(elements()) !=
252 GetHeap()->one_pointer_filler_map(); 252 GetHeap()->one_pointer_filler_map();
253 } 253 }
254 254
255 255
256 void JSObject::JSObjectVerify() { 256 void JSObject::JSObjectVerify() {
257 VerifyHeapPointer(properties()); 257 VerifyHeapPointer(properties());
258 VerifyHeapPointer(elements()); 258 VerifyHeapPointer(elements());
259 259
260 if (GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS) { 260 if (HasSloppyArgumentsElements()) {
261 CHECK(this->elements()->IsFixedArray()); 261 CHECK(this->elements()->IsFixedArray());
262 CHECK_GE(this->elements()->length(), 2); 262 CHECK_GE(this->elements()->length(), 2);
263 } 263 }
264 264
265 if (HasFastProperties()) { 265 if (HasFastProperties()) {
266 int actual_unused_property_fields = map()->inobject_properties() + 266 int actual_unused_property_fields = map()->inobject_properties() +
267 properties()->length() - 267 properties()->length() -
268 map()->NextFreePropertyIndex(); 268 map()->NextFreePropertyIndex();
269 if (map()->unused_property_fields() != actual_unused_property_fields) { 269 if (map()->unused_property_fields() != actual_unused_property_fields) {
270 // This could actually happen in the middle of StoreTransitionStub 270 // This could actually happen in the middle of StoreTransitionStub
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 info->number_of_fast_used_elements_ += e->length(); 1097 info->number_of_fast_used_elements_ += e->length();
1098 break; 1098 break;
1099 } 1099 }
1100 case DICTIONARY_ELEMENTS: { 1100 case DICTIONARY_ELEMENTS: {
1101 SeededNumberDictionary* dict = element_dictionary(); 1101 SeededNumberDictionary* dict = element_dictionary();
1102 info->number_of_slow_used_elements_ += dict->NumberOfElements(); 1102 info->number_of_slow_used_elements_ += dict->NumberOfElements();
1103 info->number_of_slow_unused_elements_ += 1103 info->number_of_slow_unused_elements_ +=
1104 dict->Capacity() - dict->NumberOfElements(); 1104 dict->Capacity() - dict->NumberOfElements();
1105 break; 1105 break;
1106 } 1106 }
1107 case SLOPPY_ARGUMENTS_ELEMENTS: 1107 case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
1108 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS:
1108 break; 1109 break;
1109 } 1110 }
1110 } 1111 }
1111 1112
1112 1113
1113 void JSObject::SpillInformation::Clear() { 1114 void JSObject::SpillInformation::Clear() {
1114 number_of_objects_ = 0; 1115 number_of_objects_ = 0;
1115 number_of_objects_with_fast_properties_ = 0; 1116 number_of_objects_with_fast_properties_ = 0;
1116 number_of_objects_with_fast_elements_ = 0; 1117 number_of_objects_with_fast_elements_ = 0;
1117 number_of_fast_used_fields_ = 0; 1118 number_of_fast_used_fields_ = 0;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 : it.rinfo()->target_object(); 1273 : it.rinfo()->target_object();
1273 CHECK(!CanLeak(target, heap, skip_weak_cell)); 1274 CHECK(!CanLeak(target, heap, skip_weak_cell));
1274 } 1275 }
1275 } 1276 }
1276 1277
1277 1278
1278 #endif // DEBUG 1279 #endif // DEBUG
1279 1280
1280 } // namespace internal 1281 } // namespace internal
1281 } // namespace v8 1282 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698