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

Side by Side Diff: src/objects.cc

Issue 7618012: Change AddElementsToFixedArray to work on FixedArrayBase rather than JSObject (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/elements.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4619 matching lines...) Expand 10 before | Expand all | Expand 10 after
4630 if (!maybe_obj->ToObject(&obj)) return maybe_obj; 4630 if (!maybe_obj->ToObject(&obj)) return maybe_obj;
4631 } 4631 }
4632 cache->set(EntryToIndex(entry), obj); 4632 cache->set(EntryToIndex(entry), obj);
4633 cache->set(EntryToIndex(entry) + 1, code); 4633 cache->set(EntryToIndex(entry) + 1, code);
4634 cache->ElementAdded(); 4634 cache->ElementAdded();
4635 return cache; 4635 return cache;
4636 } 4636 }
4637 4637
4638 4638
4639 MaybeObject* FixedArray::AddKeysFromJSArray(JSArray* array) { 4639 MaybeObject* FixedArray::AddKeysFromJSArray(JSArray* array) {
4640 return array->GetElementsAccessor()->AddJSArrayKeysToFixedArray(array, this); 4640 ElementsAccessor* accessor = array->GetElementsAccessor();
4641 MaybeObject* maybe_result =
4642 accessor->AddElementsToFixedArray(array->elements(), this);
4643 FixedArray* result;
4644 if (!maybe_result->To<FixedArray>(&result)) return maybe_result;
4645 #ifdef DEBUG
4646 if (FLAG_enable_slow_asserts) {
4647 for (int i = 0; i < result->length(); i++) {
4648 Object* current = result->get(i);
4649 ASSERT(current->IsNumber() || current->IsString());
4650 }
4651 }
4652 #endif
4653 return result;
4641 } 4654 }
4642 4655
4643 4656
4644 MaybeObject* FixedArray::UnionOfKeys(FixedArray* other) { 4657 MaybeObject* FixedArray::UnionOfKeys(FixedArray* other) {
4645 int len0 = length(); 4658 int len0 = length();
4646 #ifdef DEBUG 4659 #ifdef DEBUG
4647 if (FLAG_enable_slow_asserts) { 4660 if (FLAG_enable_slow_asserts) {
4648 for (int i = 0; i < len0; i++) { 4661 for (int i = 0; i < len0; i++) {
4649 ASSERT(get(i)->IsString() || get(i)->IsNumber()); 4662 ASSERT(get(i)->IsString() || get(i)->IsNumber());
4650 } 4663 }
(...skipping 6935 matching lines...) Expand 10 before | Expand all | Expand 10 after
11586 if (break_point_objects()->IsUndefined()) return 0; 11599 if (break_point_objects()->IsUndefined()) return 0;
11587 // Single break point. 11600 // Single break point.
11588 if (!break_point_objects()->IsFixedArray()) return 1; 11601 if (!break_point_objects()->IsFixedArray()) return 1;
11589 // Multiple break points. 11602 // Multiple break points.
11590 return FixedArray::cast(break_point_objects())->length(); 11603 return FixedArray::cast(break_point_objects())->length();
11591 } 11604 }
11592 #endif 11605 #endif
11593 11606
11594 11607
11595 } } // namespace v8::internal 11608 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698