OLD | NEW |
---|---|
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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1342 | 1342 |
1343 // The roots that have an index less than this are always in old space. | 1343 // The roots that have an index less than this are always in old space. |
1344 static const int kOldSpaceRoots = 0x20; | 1344 static const int kOldSpaceRoots = 0x20; |
1345 | 1345 |
1346 uint32_t HashSeed() { | 1346 uint32_t HashSeed() { |
1347 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); | 1347 uint32_t seed = static_cast<uint32_t>(hash_seed()->value()); |
1348 DCHECK(FLAG_randomize_hashes || seed == 0); | 1348 DCHECK(FLAG_randomize_hashes || seed == 0); |
1349 return seed; | 1349 return seed; |
1350 } | 1350 } |
1351 | 1351 |
1352 Smi* NextScriptId() { | |
1353 int next_id = last_script_id()->value() + 1; | |
1354 if (!Smi::IsValid(next_id) || next_id < 0) next_id = 1; | |
jochen (gone - plz use gerrit)
2015/03/26 08:00:22
when this happens, we're in trouble, right? maybe
| |
1355 Smi* next_id_smi = Smi::FromInt(next_id); | |
1356 set_last_script_id(next_id_smi); | |
1357 return next_id_smi; | |
1358 } | |
1359 | |
1352 void SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { | 1360 void SetArgumentsAdaptorDeoptPCOffset(int pc_offset) { |
1353 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); | 1361 DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0)); |
1354 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); | 1362 set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset)); |
1355 } | 1363 } |
1356 | 1364 |
1357 void SetConstructStubDeoptPCOffset(int pc_offset) { | 1365 void SetConstructStubDeoptPCOffset(int pc_offset) { |
1358 DCHECK(construct_stub_deopt_pc_offset() == Smi::FromInt(0)); | 1366 DCHECK(construct_stub_deopt_pc_offset() == Smi::FromInt(0)); |
1359 set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); | 1367 set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset)); |
1360 } | 1368 } |
1361 | 1369 |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2618 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2626 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2619 | 2627 |
2620 private: | 2628 private: |
2621 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2629 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2622 }; | 2630 }; |
2623 #endif // DEBUG | 2631 #endif // DEBUG |
2624 } | 2632 } |
2625 } // namespace v8::internal | 2633 } // namespace v8::internal |
2626 | 2634 |
2627 #endif // V8_HEAP_HEAP_H_ | 2635 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |