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

Side by Side Diff: src/objects.cc

Issue 8381040: Move some heap verification code in under the --verify-heap flag to speed (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/incremental-marking.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
3224 3224
3225 MaybeObject* NormalizedMapCache::Get(JSObject* obj, 3225 MaybeObject* NormalizedMapCache::Get(JSObject* obj,
3226 PropertyNormalizationMode mode) { 3226 PropertyNormalizationMode mode) {
3227 Isolate* isolate = obj->GetIsolate(); 3227 Isolate* isolate = obj->GetIsolate();
3228 Map* fast = obj->map(); 3228 Map* fast = obj->map();
3229 int index = fast->Hash() % kEntries; 3229 int index = fast->Hash() % kEntries;
3230 Object* result = get(index); 3230 Object* result = get(index);
3231 if (result->IsMap() && 3231 if (result->IsMap() &&
3232 Map::cast(result)->EquivalentToForNormalization(fast, mode)) { 3232 Map::cast(result)->EquivalentToForNormalization(fast, mode)) {
3233 #ifdef DEBUG 3233 #ifdef DEBUG
3234 Map::cast(result)->SharedMapVerify(); 3234 if (FLAG_verify_heap) {
3235 Map::cast(result)->SharedMapVerify();
3236 }
3235 if (FLAG_enable_slow_asserts) { 3237 if (FLAG_enable_slow_asserts) {
3236 // The cached map should match newly created normalized map bit-by-bit. 3238 // The cached map should match newly created normalized map bit-by-bit.
3237 Object* fresh; 3239 Object* fresh;
3238 { MaybeObject* maybe_fresh = 3240 { MaybeObject* maybe_fresh =
3239 fast->CopyNormalized(mode, SHARED_NORMALIZED_MAP); 3241 fast->CopyNormalized(mode, SHARED_NORMALIZED_MAP);
3240 if (maybe_fresh->ToObject(&fresh)) { 3242 if (maybe_fresh->ToObject(&fresh)) {
3241 ASSERT(memcmp(Map::cast(fresh)->address(), 3243 ASSERT(memcmp(Map::cast(fresh)->address(),
3242 Map::cast(result)->address(), 3244 Map::cast(result)->address(),
3243 Map::kSize) == 0); 3245 Map::kSize) == 0);
3244 } 3246 }
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
4720 Map::cast(result)->set_prototype(prototype()); 4722 Map::cast(result)->set_prototype(prototype());
4721 Map::cast(result)->set_constructor(constructor()); 4723 Map::cast(result)->set_constructor(constructor());
4722 4724
4723 Map::cast(result)->set_bit_field(bit_field()); 4725 Map::cast(result)->set_bit_field(bit_field());
4724 Map::cast(result)->set_bit_field2(bit_field2()); 4726 Map::cast(result)->set_bit_field2(bit_field2());
4725 Map::cast(result)->set_bit_field3(bit_field3()); 4727 Map::cast(result)->set_bit_field3(bit_field3());
4726 4728
4727 Map::cast(result)->set_is_shared(sharing == SHARED_NORMALIZED_MAP); 4729 Map::cast(result)->set_is_shared(sharing == SHARED_NORMALIZED_MAP);
4728 4730
4729 #ifdef DEBUG 4731 #ifdef DEBUG
4730 if (Map::cast(result)->is_shared()) { 4732 if (FLAG_verify_heap && Map::cast(result)->is_shared()) {
4731 Map::cast(result)->SharedMapVerify(); 4733 Map::cast(result)->SharedMapVerify();
4732 } 4734 }
4733 #endif 4735 #endif
4734 4736
4735 return result; 4737 return result;
4736 } 4738 }
4737 4739
4738 4740
4739 MaybeObject* Map::CopyDropTransitions() { 4741 MaybeObject* Map::CopyDropTransitions() {
4740 Object* new_map; 4742 Object* new_map;
(...skipping 7891 matching lines...) Expand 10 before | Expand all | Expand 10 after
12632 if (break_point_objects()->IsUndefined()) return 0; 12634 if (break_point_objects()->IsUndefined()) return 0;
12633 // Single break point. 12635 // Single break point.
12634 if (!break_point_objects()->IsFixedArray()) return 1; 12636 if (!break_point_objects()->IsFixedArray()) return 1;
12635 // Multiple break points. 12637 // Multiple break points.
12636 return FixedArray::cast(break_point_objects())->length(); 12638 return FixedArray::cast(break_point_objects())->length();
12637 } 12639 }
12638 #endif // ENABLE_DEBUGGER_SUPPORT 12640 #endif // ENABLE_DEBUGGER_SUPPORT
12639 12641
12640 12642
12641 } } // namespace v8::internal 12643 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/incremental-marking.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698