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

Unified Diff: src/heap/heap-inl.h

Issue 1371893002: objects-inl.h: Remove ACCESSORS_TO_SMI macro (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: undo last_script_id storage change Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index 6f7c060d70c9e53f41fd9802f21389920d2aec2b..aa087a9e1f03017a02db4c297636c0b9a6667d43 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -684,12 +684,15 @@ uint32_t Heap::HashSeed() {
}
-Smi* Heap::NextScriptId() {
- int next_id = last_script_id()->value() + 1;
- if (!Smi::IsValid(next_id) || next_id < 0) next_id = 1;
- Smi* next_id_smi = Smi::FromInt(next_id);
- set_last_script_id(next_id_smi);
- return next_id_smi;
+int Heap::NextScriptId() {
+ int last_id = last_script_id()->value();
+ if (last_id == Smi::kMaxValue) {
+ last_id = 1;
+ } else {
+ last_id++;
+ }
+ set_last_script_id(Smi::FromInt(last_id));
+ return last_id;
}
« no previous file with comments | « src/heap/heap.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698