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

Side by Side Diff: src/objects.cc

Issue 11413142: Fix array concat for holey arrays and concat of double to object arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 10471 matching lines...) Expand 10 before | Expand all | Expand 10 after
10482 } 10482 }
10483 10483
10484 10484
10485 MaybeObject* JSObject::TransitionElementsKind(ElementsKind to_kind) { 10485 MaybeObject* JSObject::TransitionElementsKind(ElementsKind to_kind) {
10486 ElementsKind from_kind = map()->elements_kind(); 10486 ElementsKind from_kind = map()->elements_kind();
10487 10487
10488 if (IsFastHoleyElementsKind(from_kind)) { 10488 if (IsFastHoleyElementsKind(from_kind)) {
10489 to_kind = GetHoleyElementsKind(to_kind); 10489 to_kind = GetHoleyElementsKind(to_kind);
10490 } 10490 }
10491 10491
10492 if (from_kind == to_kind) return this;
10493
10492 Isolate* isolate = GetIsolate(); 10494 Isolate* isolate = GetIsolate();
10493 if (elements() == isolate->heap()->empty_fixed_array() || 10495 if (elements() == isolate->heap()->empty_fixed_array() ||
10494 (IsFastSmiOrObjectElementsKind(from_kind) && 10496 (IsFastSmiOrObjectElementsKind(from_kind) &&
10495 IsFastSmiOrObjectElementsKind(to_kind)) || 10497 IsFastSmiOrObjectElementsKind(to_kind)) ||
10496 (from_kind == FAST_DOUBLE_ELEMENTS && 10498 (from_kind == FAST_DOUBLE_ELEMENTS &&
10497 to_kind == FAST_HOLEY_DOUBLE_ELEMENTS)) { 10499 to_kind == FAST_HOLEY_DOUBLE_ELEMENTS)) {
10498 ASSERT(from_kind != TERMINAL_FAST_ELEMENTS_KIND); 10500 ASSERT(from_kind != TERMINAL_FAST_ELEMENTS_KIND);
10499 // No change is needed to the elements() buffer, the transition 10501 // No change is needed to the elements() buffer, the transition
10500 // only requires a map change. 10502 // only requires a map change.
10501 MaybeObject* maybe_new_map = GetElementsTransitionMap(isolate, to_kind); 10503 MaybeObject* maybe_new_map = GetElementsTransitionMap(isolate, to_kind);
(...skipping 3377 matching lines...) Expand 10 before | Expand all | Expand 10 after
13879 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13881 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13880 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13882 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13881 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13883 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13882 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13884 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13883 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13885 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13884 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13886 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13885 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13887 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13886 } 13888 }
13887 13889
13888 } } // namespace v8::internal 13890 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698