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

Side by Side Diff: src/runtime/runtime-array.cc

Issue 2166963004: [runtime] %TransitionElementsKind works for any kind of JSObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | test/mjsunit/regress/regress-crbug-629823.js » ('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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/elements.h" 10 #include "src/elements.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 CONVERT_SMI_ARG_CHECKED(index, 1); 80 CONVERT_SMI_ARG_CHECKED(index, 1);
81 CONVERT_ARG_CHECKED(Object, value, 2); 81 CONVERT_ARG_CHECKED(Object, value, 2);
82 object->set(index, value); 82 object->set(index, value);
83 return isolate->heap()->undefined_value(); 83 return isolate->heap()->undefined_value();
84 } 84 }
85 85
86 86
87 RUNTIME_FUNCTION(Runtime_TransitionElementsKind) { 87 RUNTIME_FUNCTION(Runtime_TransitionElementsKind) {
88 HandleScope scope(isolate); 88 HandleScope scope(isolate);
89 DCHECK_EQ(2, args.length()); 89 DCHECK_EQ(2, args.length());
90 CONVERT_ARG_HANDLE_CHECKED(JSArray, object, 0); 90 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
91 CONVERT_ARG_HANDLE_CHECKED(Map, to_map, 1); 91 CONVERT_ARG_HANDLE_CHECKED(Map, to_map, 1);
92 ElementsKind to_kind = to_map->elements_kind(); 92 ElementsKind to_kind = to_map->elements_kind();
93 ElementsAccessor::ForKind(to_kind)->TransitionElementsKind(object, to_map); 93 ElementsAccessor::ForKind(to_kind)->TransitionElementsKind(object, to_map);
94 return *object; 94 return *object;
95 } 95 }
96 96
97 97
98 // Moves all own elements of an object, that are below a limit, to positions 98 // Moves all own elements of an object, that are below a limit, to positions
99 // starting at zero. All undefined values are placed after non-undefined values, 99 // starting at zero. All undefined values are placed after non-undefined values,
100 // and are followed by non-existing element. Does not change the length 100 // and are followed by non-existing element. Does not change the length
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 RUNTIME_FUNCTION(Runtime_ArraySpeciesConstructor) { 434 RUNTIME_FUNCTION(Runtime_ArraySpeciesConstructor) {
435 HandleScope scope(isolate); 435 HandleScope scope(isolate);
436 DCHECK(args.length() == 1); 436 DCHECK(args.length() == 1);
437 CONVERT_ARG_HANDLE_CHECKED(Object, original_array, 0); 437 CONVERT_ARG_HANDLE_CHECKED(Object, original_array, 0);
438 RETURN_RESULT_OR_FAILURE( 438 RETURN_RESULT_OR_FAILURE(
439 isolate, Object::ArraySpeciesConstructor(isolate, original_array)); 439 isolate, Object::ArraySpeciesConstructor(isolate, original_array));
440 } 440 }
441 441
442 } // namespace internal 442 } // namespace internal
443 } // namespace v8 443 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-629823.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698