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

Side by Side Diff: src/objects.cc

Issue 227713003: Further ElementsAccessor handlification (Get(), AddElementsToFixedArray() and HasElement()). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 years, 8 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 11894 matching lines...) Expand 10 before | Expand all | Expand 10 after
11905 if (!result.IsEmpty()) return value; 11905 if (!result.IsEmpty()) return value;
11906 } 11906 }
11907 11907
11908 return SetElementWithoutInterceptor(object, index, value, attributes, 11908 return SetElementWithoutInterceptor(object, index, value, attributes,
11909 strict_mode, 11909 strict_mode,
11910 check_prototype, 11910 check_prototype,
11911 set_mode); 11911 set_mode);
11912 } 11912 }
11913 11913
11914 11914
11915 // TODO(ishell): Temporary wrapper until handlified.
11916 Handle<Object> JSObject::GetElementWithCallback(
11917 Handle<JSObject> object,
11918 Handle<Object> receiver,
11919 Handle<Object> structure,
11920 uint32_t index,
11921 Handle<Object> holder) {
11922 CALL_HEAP_FUNCTION(object->GetIsolate(),
11923 object->GetElementWithCallback(
11924 *receiver, *structure, index, *holder),
11925 Object);
11926 }
11927
11928
11915 MaybeObject* JSObject::GetElementWithCallback(Object* receiver, 11929 MaybeObject* JSObject::GetElementWithCallback(Object* receiver,
11916 Object* structure, 11930 Object* structure,
11917 uint32_t index, 11931 uint32_t index,
11918 Object* holder) { 11932 Object* holder) {
11919 Isolate* isolate = GetIsolate(); 11933 Isolate* isolate = GetIsolate();
11920 ASSERT(!structure->IsForeign()); 11934 ASSERT(!structure->IsForeign());
11921 11935
11922 // api style callbacks. 11936 // api style callbacks.
11923 if (structure->IsExecutableAccessorInfo()) { 11937 if (structure->IsExecutableAccessorInfo()) {
11924 Handle<ExecutableAccessorInfo> data( 11938 Handle<ExecutableAccessorInfo> data(
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
12591 PropertyAttributes attributes, 12605 PropertyAttributes attributes,
12592 StrictMode strict_mode, 12606 StrictMode strict_mode,
12593 bool check_prototype, 12607 bool check_prototype,
12594 SetPropertyMode set_mode) { 12608 SetPropertyMode set_mode) {
12595 ASSERT(object->HasDictionaryElements() || 12609 ASSERT(object->HasDictionaryElements() ||
12596 object->HasDictionaryArgumentsElements() || 12610 object->HasDictionaryArgumentsElements() ||
12597 (attributes & (DONT_DELETE | DONT_ENUM | READ_ONLY)) == 0); 12611 (attributes & (DONT_DELETE | DONT_ENUM | READ_ONLY)) == 0);
12598 Isolate* isolate = object->GetIsolate(); 12612 Isolate* isolate = object->GetIsolate();
12599 if (FLAG_trace_external_array_abuse && 12613 if (FLAG_trace_external_array_abuse &&
12600 IsExternalArrayElementsKind(object->GetElementsKind())) { 12614 IsExternalArrayElementsKind(object->GetElementsKind())) {
12601 CheckArrayAbuse(*object, "external elements write", index); 12615 CheckArrayAbuse(object, "external elements write", index);
12602 } 12616 }
12603 if (FLAG_trace_js_array_abuse && 12617 if (FLAG_trace_js_array_abuse &&
12604 !IsExternalArrayElementsKind(object->GetElementsKind())) { 12618 !IsExternalArrayElementsKind(object->GetElementsKind())) {
12605 if (object->IsJSArray()) { 12619 if (object->IsJSArray()) {
12606 CheckArrayAbuse(*object, "elements write", index, true); 12620 CheckArrayAbuse(object, "elements write", index, true);
12607 } 12621 }
12608 } 12622 }
12609 switch (object->GetElementsKind()) { 12623 switch (object->GetElementsKind()) {
12610 case FAST_SMI_ELEMENTS: 12624 case FAST_SMI_ELEMENTS:
12611 case FAST_ELEMENTS: 12625 case FAST_ELEMENTS:
12612 case FAST_HOLEY_SMI_ELEMENTS: 12626 case FAST_HOLEY_SMI_ELEMENTS:
12613 case FAST_HOLEY_ELEMENTS: 12627 case FAST_HOLEY_ELEMENTS:
12614 return SetFastElement(object, index, value, strict_mode, check_prototype); 12628 return SetFastElement(object, index, value, strict_mode, check_prototype);
12615 case FAST_DOUBLE_ELEMENTS: 12629 case FAST_DOUBLE_ELEMENTS:
12616 case FAST_HOLEY_DOUBLE_ELEMENTS: 12630 case FAST_HOLEY_DOUBLE_ELEMENTS:
(...skipping 4047 matching lines...) Expand 10 before | Expand all | Expand 10 after
16664 #define ERROR_MESSAGES_TEXTS(C, T) T, 16678 #define ERROR_MESSAGES_TEXTS(C, T) T,
16665 static const char* error_messages_[] = { 16679 static const char* error_messages_[] = {
16666 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16680 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16667 }; 16681 };
16668 #undef ERROR_MESSAGES_TEXTS 16682 #undef ERROR_MESSAGES_TEXTS
16669 return error_messages_[reason]; 16683 return error_messages_[reason];
16670 } 16684 }
16671 16685
16672 16686
16673 } } // namespace v8::internal 16687 } } // 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