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

Side by Side Diff: src/heap.cc

Issue 247263003: Hide heap methods where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | test/cctest/cctest.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 "v8.h" 5 #include "v8.h"
6 6
7 #include "accessors.h" 7 #include "accessors.h"
8 #include "api.h" 8 #include "api.h"
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "codegen.h" 10 #include "codegen.h"
(...skipping 4318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4329 Symbol::cast(result)->set_hash_field( 4329 Symbol::cast(result)->set_hash_field(
4330 Name::kIsNotArrayIndexMask | (hash << Name::kHashShift)); 4330 Name::kIsNotArrayIndexMask | (hash << Name::kHashShift));
4331 Symbol::cast(result)->set_name(undefined_value()); 4331 Symbol::cast(result)->set_name(undefined_value());
4332 Symbol::cast(result)->set_flags(Smi::FromInt(0)); 4332 Symbol::cast(result)->set_flags(Smi::FromInt(0));
4333 4333
4334 ASSERT(!Symbol::cast(result)->is_private()); 4334 ASSERT(!Symbol::cast(result)->is_private());
4335 return result; 4335 return result;
4336 } 4336 }
4337 4337
4338 4338
4339 MaybeObject* Heap::AllocatePrivateSymbol() {
4340 MaybeObject* maybe = AllocateSymbol();
4341 Symbol* symbol;
4342 if (!maybe->To(&symbol)) return maybe;
4343 symbol->set_is_private(true);
4344 return symbol;
4345 }
4346
4347
4348 MaybeObject* Heap::AllocateStruct(InstanceType type) { 4339 MaybeObject* Heap::AllocateStruct(InstanceType type) {
4349 Map* map; 4340 Map* map;
4350 switch (type) { 4341 switch (type) {
4351 #define MAKE_CASE(NAME, Name, name) \ 4342 #define MAKE_CASE(NAME, Name, name) \
4352 case NAME##_TYPE: map = name##_map(); break; 4343 case NAME##_TYPE: map = name##_map(); break;
4353 STRUCT_LIST(MAKE_CASE) 4344 STRUCT_LIST(MAKE_CASE)
4354 #undef MAKE_CASE 4345 #undef MAKE_CASE
4355 default: 4346 default:
4356 UNREACHABLE(); 4347 UNREACHABLE();
4357 return exception(); 4348 return exception();
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
6506 static_cast<int>(object_sizes_last_time_[index])); 6497 static_cast<int>(object_sizes_last_time_[index]));
6507 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6498 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6508 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6499 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6509 6500
6510 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6501 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6511 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6502 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6512 ClearObjectStats(); 6503 ClearObjectStats();
6513 } 6504 }
6514 6505
6515 } } // namespace v8::internal 6506 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | test/cctest/cctest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698