| Index: src/heap/heap-inl.h
|
| diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
|
| index 6f7c060d70c9e53f41fd9802f21389920d2aec2b..d706030c265f36765fb2e5fb8bc4c4aa40dfa66d 100644
|
| --- a/src/heap/heap-inl.h
|
| +++ b/src/heap/heap-inl.h
|
| @@ -684,12 +684,13 @@ 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() {
|
| + if (last_script_id_ == Smi::kMaxValue) {
|
| + last_script_id_ = 1;
|
| + } else {
|
| + last_script_id_++;
|
| + }
|
| + return last_script_id_;
|
| }
|
|
|
|
|
|
|