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

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

Issue 1307743011: Adding GetMoreGeneralElementsKind in elements-kind.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix? Created 5 years, 3 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/runtime/runtime-array.cc ('k') | no next file » | 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/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 DCHECK(IsFastDoubleElementsKind(object->GetElementsKind())); 417 DCHECK(IsFastDoubleElementsKind(object->GetElementsKind()));
418 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements()); 418 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements());
419 HeapNumber* number = HeapNumber::cast(*value); 419 HeapNumber* number = HeapNumber::cast(*value);
420 double_array->set(store_index, number->Number()); 420 double_array->set(store_index, number->Number());
421 } else { 421 } else {
422 if (!IsFastObjectElementsKind(elements_kind)) { 422 if (!IsFastObjectElementsKind(elements_kind)) {
423 ElementsKind transitioned_kind = IsFastHoleyElementsKind(elements_kind) 423 ElementsKind transitioned_kind = IsFastHoleyElementsKind(elements_kind)
424 ? FAST_HOLEY_ELEMENTS 424 ? FAST_HOLEY_ELEMENTS
425 : FAST_ELEMENTS; 425 : FAST_ELEMENTS;
426 JSObject::TransitionElementsKind(object, transitioned_kind); 426 JSObject::TransitionElementsKind(object, transitioned_kind);
427 ElementsKind boilerplate_elements_kind = 427 if (IsMoreGeneralElementsKindTransition(
428 boilerplate_object->GetElementsKind(); 428 boilerplate_object->GetElementsKind(), transitioned_kind)) {
429 if (IsMoreGeneralElementsKindTransition(boilerplate_elements_kind,
430 transitioned_kind)) {
431 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); 429 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind);
432 } 430 }
433 } 431 }
434 FixedArray* object_array = FixedArray::cast(object->elements()); 432 FixedArray* object_array = FixedArray::cast(object->elements());
435 object_array->set(store_index, *value); 433 object_array->set(store_index, *value);
436 } 434 }
437 return *object; 435 return *object;
438 } 436 }
439 } // namespace internal 437 } // namespace internal
440 } // namespace v8 438 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698