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

Side by Side Diff: src/isolate.cc

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 years, 2 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/interpreter/interpreter.cc ('k') | src/keys.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 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after
3201 } 3201 }
3202 3202
3203 // Heap::detached_contexts tracks detached contexts as pairs 3203 // Heap::detached_contexts tracks detached contexts as pairs
3204 // (number of GC since the context was detached, the context). 3204 // (number of GC since the context was detached, the context).
3205 void Isolate::AddDetachedContext(Handle<Context> context) { 3205 void Isolate::AddDetachedContext(Handle<Context> context) {
3206 HandleScope scope(this); 3206 HandleScope scope(this);
3207 Handle<WeakCell> cell = factory()->NewWeakCell(context); 3207 Handle<WeakCell> cell = factory()->NewWeakCell(context);
3208 Handle<FixedArray> detached_contexts = factory()->detached_contexts(); 3208 Handle<FixedArray> detached_contexts = factory()->detached_contexts();
3209 int length = detached_contexts->length(); 3209 int length = detached_contexts->length();
3210 detached_contexts = factory()->CopyFixedArrayAndGrow(detached_contexts, 2); 3210 detached_contexts = factory()->CopyFixedArrayAndGrow(detached_contexts, 2);
3211 detached_contexts->set(length, Smi::FromInt(0)); 3211 detached_contexts->set(length, Smi::kZero);
3212 detached_contexts->set(length + 1, *cell); 3212 detached_contexts->set(length + 1, *cell);
3213 heap()->set_detached_contexts(*detached_contexts); 3213 heap()->set_detached_contexts(*detached_contexts);
3214 } 3214 }
3215 3215
3216 3216
3217 void Isolate::CheckDetachedContextsAfterGC() { 3217 void Isolate::CheckDetachedContextsAfterGC() {
3218 HandleScope scope(this); 3218 HandleScope scope(this);
3219 Handle<FixedArray> detached_contexts = factory()->detached_contexts(); 3219 Handle<FixedArray> detached_contexts = factory()->detached_contexts();
3220 int length = detached_contexts->length(); 3220 int length = detached_contexts->length();
3221 if (length == 0) return; 3221 if (length == 0) return;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
3315 // Then check whether this scope intercepts. 3315 // Then check whether this scope intercepts.
3316 if ((flag & intercept_mask_)) { 3316 if ((flag & intercept_mask_)) {
3317 intercepted_flags_ |= flag; 3317 intercepted_flags_ |= flag;
3318 return true; 3318 return true;
3319 } 3319 }
3320 return false; 3320 return false;
3321 } 3321 }
3322 3322
3323 } // namespace internal 3323 } // namespace internal
3324 } // namespace v8 3324 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | src/keys.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698