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

Side by Side Diff: src/heap/heap.h

Issue 1035523005: Serializer: ensure unique script ids when deserializing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test Created 5 years, 9 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/factory.cc ('k') | src/runtime/runtime-debug.cc » ('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 #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
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;
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
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_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698