| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 22f3813 commit 3fc6a22
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 5 | |
| 12 | 12 | #define V8_MINOR_VERSION 1 | |
| 13 | 13 | #define V8_BUILD_NUMBER 281 | |
| 14 | - #define V8_PATCH_LEVEL 93 | ||
| 14 | + #define V8_PATCH_LEVEL 94 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3069,9 +3069,16 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map, | |||
| 3069 | 3069 | // Ensure that in-object space of slow-mode object does not contain random | |
| 3070 | 3070 | // garbage. | |
| 3071 | 3071 | int inobject_properties = new_map->GetInObjectProperties(); | |
| 3072 | - for (int i = 0; i < inobject_properties; i++) { | ||
| 3073 | - FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); | ||
| 3074 | - object->RawFastPropertyAtPut(index, Smi::FromInt(0)); | ||
| 3072 | + if (inobject_properties) { | ||
| 3073 | + Heap* heap = isolate->heap(); | ||
| 3074 | + heap->ClearRecordedSlotRange( | ||
| 3075 | + object->address() + map->GetInObjectPropertyOffset(0), | ||
| 3076 | + object->address() + new_instance_size); | ||
| 3077 | + | ||
| 3078 | + for (int i = 0; i < inobject_properties; i++) { | ||
| 3079 | + FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); | ||
| 3080 | + object->RawFastPropertyAtPut(index, Smi::FromInt(0)); | ||
| 3081 | + } | ||
| 3075 | 3082 | } | |
| 3076 | 3083 | ||
| 3077 | 3084 | isolate->counters()->props_to_dictionary()->Increment(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,57 @@ | |||
| 1 | + // Copyright 2016 the V8 project authors. All rights reserved. | ||
| 2 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + // found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + // Flags: --allow-natives-syntax --expose-gc | ||
| 6 | + | ||
| 7 | + function P() { | ||
| 8 | + this.a0 = {}; | ||
| 9 | + this.a1 = {}; | ||
| 10 | + this.a2 = {}; | ||
| 11 | + this.a3 = {}; | ||
| 12 | + this.a4 = {}; | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + function A() { | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + var proto = new P(); | ||
| 19 | + A.prototype = proto; | ||
| 20 | + | ||
| 21 | + function foo(o) { | ||
| 22 | + return o.a0; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + // Ensure |proto| is in old space. | ||
| 26 | + gc(); | ||
| 27 | + gc(); | ||
| 28 | + gc(); | ||
| 29 | + | ||
| 30 | + // Ensure |proto| is marked as "should be fast". | ||
| 31 | + var o = new A(); | ||
| 32 | + foo(o); | ||
| 33 | + foo(o); | ||
| 34 | + foo(o); | ||
| 35 | + assertTrue(%HasFastProperties(proto)); | ||
| 36 | + | ||
| 37 | + // Contruct a double value that looks like a tagged pointer. | ||
| 38 | + var buffer = new ArrayBuffer(8); | ||
| 39 | + var int32view = new Int32Array(buffer); | ||
| 40 | + var float64view = new Float64Array(buffer); | ||
| 41 | + int32view[0] = int32view[1] = 0x40000001; | ||
| 42 | + var boom = float64view[0]; | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + // Write new space object. | ||
| 46 | + proto.a4 = {a: 0}; | ||
| 47 | + // Immediately delete the field. | ||
| 48 | + delete proto.a4; | ||
| 49 | + | ||
| 50 | + // |proto| must sill be fast. | ||
| 51 | + assertTrue(%HasFastProperties(proto)); | ||
| 52 | + | ||
| 53 | + // Add a double field instead of deleted a4 that looks like a tagged pointer. | ||
| 54 | + proto.boom = boom; | ||
| 55 | + | ||
| 56 | + // Boom! | ||
| 57 | + gc(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments