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

Side by Side Diff: src/objects.cc

Issue 7617010: Change JSObject elements to be of type FixedArrayBase (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/objects.h ('k') | src/objects-inl.h » ('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 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 8389 matching lines...) Expand 10 before | Expand all | Expand 10 after
8400 } else { 8400 } else {
8401 Handle<Object> number = isolate->factory()->NewNumberFromUint(index); 8401 Handle<Object> number = isolate->factory()->NewNumberFromUint(index);
8402 Handle<String> name = isolate->factory()->NumberToString(number); 8402 Handle<String> name = isolate->factory()->NumberToString(number);
8403 Handle<Object> args[1] = { name }; 8403 Handle<Object> args[1] = { name };
8404 Handle<Object> error = 8404 Handle<Object> error =
8405 isolate->factory()->NewTypeError("object_not_extensible", 8405 isolate->factory()->NewTypeError("object_not_extensible",
8406 HandleVector(args, 1)); 8406 HandleVector(args, 1));
8407 return isolate->Throw(*error); 8407 return isolate->Throw(*error);
8408 } 8408 }
8409 } 8409 }
8410 Object* new_dictionary; 8410 FixedArrayBase* new_dictionary;
8411 MaybeObject* maybe = dictionary->AtNumberPut(index, value); 8411 MaybeObject* maybe = dictionary->AtNumberPut(index, value);
8412 if (!maybe->ToObject(&new_dictionary)) return maybe; 8412 if (!maybe->To<FixedArrayBase>(&new_dictionary)) return maybe;
8413 if (dictionary != NumberDictionary::cast(new_dictionary)) { 8413 if (dictionary != NumberDictionary::cast(new_dictionary)) {
8414 if (is_arguments) { 8414 if (is_arguments) {
8415 elements->set(1, new_dictionary); 8415 elements->set(1, new_dictionary);
8416 } else { 8416 } else {
8417 set_elements(HeapObject::cast(new_dictionary)); 8417 set_elements(new_dictionary);
8418 } 8418 }
8419 dictionary = NumberDictionary::cast(new_dictionary); 8419 dictionary = NumberDictionary::cast(new_dictionary);
8420 } 8420 }
8421 } 8421 }
8422 8422
8423 // Update the array length if this JSObject is an array. 8423 // Update the array length if this JSObject is an array.
8424 if (IsJSArray()) { 8424 if (IsJSArray()) {
8425 MaybeObject* result = 8425 MaybeObject* result =
8426 JSArray::cast(this)->JSArrayUpdateLengthFromIndex(index, value); 8426 JSArray::cast(this)->JSArrayUpdateLengthFromIndex(index, value);
8427 if (result->IsFailure()) return result; 8427 if (result->IsFailure()) return result;
(...skipping 3158 matching lines...) Expand 10 before | Expand all | Expand 10 after
11586 if (break_point_objects()->IsUndefined()) return 0; 11586 if (break_point_objects()->IsUndefined()) return 0;
11587 // Single break point. 11587 // Single break point.
11588 if (!break_point_objects()->IsFixedArray()) return 1; 11588 if (!break_point_objects()->IsFixedArray()) return 1;
11589 // Multiple break points. 11589 // Multiple break points.
11590 return FixedArray::cast(break_point_objects())->length(); 11590 return FixedArray::cast(break_point_objects())->length();
11591 } 11591 }
11592 #endif 11592 #endif
11593 11593
11594 11594
11595 } } // namespace v8::internal 11595 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698