OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/elements.h" | 8 #include "src/elements.h" |
9 #include "src/messages.h" | 9 #include "src/messages.h" |
10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 initial_map = Map::AsElementsKind(initial_map, to_kind); | 1106 initial_map = Map::AsElementsKind(initial_map, to_kind); |
1107 } | 1107 } |
1108 | 1108 |
1109 // If we don't care to track arrays of to_kind ElementsKind, then | 1109 // If we don't care to track arrays of to_kind ElementsKind, then |
1110 // don't emit a memento for them. | 1110 // don't emit a memento for them. |
1111 Handle<AllocationSite> allocation_site; | 1111 Handle<AllocationSite> allocation_site; |
1112 if (AllocationSite::GetMode(to_kind) == TRACK_ALLOCATION_SITE) { | 1112 if (AllocationSite::GetMode(to_kind) == TRACK_ALLOCATION_SITE) { |
1113 allocation_site = site; | 1113 allocation_site = site; |
1114 } | 1114 } |
1115 | 1115 |
1116 array = Handle<JSArray>::cast(factory->NewJSObjectFromMap( | 1116 array = Handle<JSArray>::cast( |
1117 initial_map, NOT_TENURED, true, allocation_site)); | 1117 factory->NewJSObjectFromMap(initial_map, NOT_TENURED, allocation_site)); |
1118 } else { | 1118 } else { |
1119 array = Handle<JSArray>::cast(factory->NewJSObject(constructor)); | 1119 array = Handle<JSArray>::cast(factory->NewJSObject(constructor)); |
1120 | 1120 |
1121 // We might need to transition to holey | 1121 // We might need to transition to holey |
1122 ElementsKind kind = constructor->initial_map()->elements_kind(); | 1122 ElementsKind kind = constructor->initial_map()->elements_kind(); |
1123 if (holey && !IsFastHoleyElementsKind(kind)) { | 1123 if (holey && !IsFastHoleyElementsKind(kind)) { |
1124 kind = GetHoleyElementsKind(kind); | 1124 kind = GetHoleyElementsKind(kind); |
1125 JSObject::TransitionElementsKind(array, kind); | 1125 JSObject::TransitionElementsKind(array, kind); |
1126 } | 1126 } |
1127 } | 1127 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 | 1320 |
1321 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { | 1321 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { |
1322 SealHandleScope shs(isolate); | 1322 SealHandleScope shs(isolate); |
1323 DCHECK(args.length() == 2); | 1323 DCHECK(args.length() == 2); |
1324 // Returning undefined means that this fast path fails and one has to resort | 1324 // Returning undefined means that this fast path fails and one has to resort |
1325 // to a slow path. | 1325 // to a slow path. |
1326 return isolate->heap()->undefined_value(); | 1326 return isolate->heap()->undefined_value(); |
1327 } | 1327 } |
1328 } // namespace internal | 1328 } // namespace internal |
1329 } // namespace v8 | 1329 } // namespace v8 |
OLD | NEW |