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

Side by Side Diff: src/factory.cc

Issue 813023002: Make sure backing store pointer in handles get cleared after use in factory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « no previous file | test/cctest/test-heap.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/conversions.h" 9 #include "src/conversions.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 int capacity, 1675 int capacity,
1676 ArrayStorageAllocationMode mode) { 1676 ArrayStorageAllocationMode mode) {
1677 DCHECK(capacity >= length); 1677 DCHECK(capacity >= length);
1678 1678
1679 if (capacity == 0) { 1679 if (capacity == 0) {
1680 array->set_length(Smi::FromInt(0)); 1680 array->set_length(Smi::FromInt(0));
1681 array->set_elements(*empty_fixed_array()); 1681 array->set_elements(*empty_fixed_array());
1682 return; 1682 return;
1683 } 1683 }
1684 1684
1685 HandleScope inner_scope(isolate());
1685 Handle<FixedArrayBase> elms; 1686 Handle<FixedArrayBase> elms;
1686 ElementsKind elements_kind = array->GetElementsKind(); 1687 ElementsKind elements_kind = array->GetElementsKind();
1687 if (IsFastDoubleElementsKind(elements_kind)) { 1688 if (IsFastDoubleElementsKind(elements_kind)) {
1688 if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) { 1689 if (mode == DONT_INITIALIZE_ARRAY_ELEMENTS) {
1689 elms = NewFixedDoubleArray(capacity); 1690 elms = NewFixedDoubleArray(capacity);
1690 } else { 1691 } else {
1691 DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); 1692 DCHECK(mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE);
1692 elms = NewFixedDoubleArrayWithHoles(capacity); 1693 elms = NewFixedDoubleArrayWithHoles(capacity);
1693 } 1694 }
1694 } else { 1695 } else {
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 return Handle<Object>::null(); 2522 return Handle<Object>::null();
2522 } 2523 }
2523 2524
2524 2525
2525 Handle<Object> Factory::ToBoolean(bool value) { 2526 Handle<Object> Factory::ToBoolean(bool value) {
2526 return value ? true_value() : false_value(); 2527 return value ? true_value() : false_value();
2527 } 2528 }
2528 2529
2529 2530
2530 } } // namespace v8::internal 2531 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698