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

Side by Side Diff: src/api.cc

Issue 218583008: Use JSObject::SetMapAndElements rather than set_map + set_elements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | 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 3718 matching lines...) Expand 10 before | Expand all | Expand 10 after
3729 int length) { 3729 int length) {
3730 i::Isolate* isolate = object->GetIsolate(); 3730 i::Isolate* isolate = object->GetIsolate();
3731 i::Handle<i::ExternalArray> array = 3731 i::Handle<i::ExternalArray> array =
3732 isolate->factory()->NewExternalArray(length, array_type, data); 3732 isolate->factory()->NewExternalArray(length, array_type, data);
3733 3733
3734 i::Handle<i::Map> external_array_map = 3734 i::Handle<i::Map> external_array_map =
3735 i::JSObject::GetElementsTransitionMap( 3735 i::JSObject::GetElementsTransitionMap(
3736 object, 3736 object,
3737 GetElementsKindFromExternalArrayType(array_type)); 3737 GetElementsKindFromExternalArrayType(array_type));
3738 3738
3739 object->set_map(*external_array_map); 3739 i::JSObject::SetMapAndElements(object, external_array_map, array);
3740 object->set_elements(*array);
3741 } 3740 }
3742 3741
3743 } // namespace 3742 } // namespace
3744 3743
3745 3744
3746 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { 3745 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
3747 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3746 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3748 ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return); 3747 ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return);
3749 ENTER_V8(isolate); 3748 ENTER_V8(isolate);
3750 i::HandleScope scope(isolate); 3749 i::HandleScope scope(isolate);
(...skipping 3902 matching lines...) Expand 10 before | Expand all | Expand 10 after
7653 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7652 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7654 Address callback_address = 7653 Address callback_address =
7655 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7654 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7656 VMState<EXTERNAL> state(isolate); 7655 VMState<EXTERNAL> state(isolate);
7657 ExternalCallbackScope call_scope(isolate, callback_address); 7656 ExternalCallbackScope call_scope(isolate, callback_address);
7658 callback(info); 7657 callback(info);
7659 } 7658 }
7660 7659
7661 7660
7662 } } // namespace v8::internal 7661 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698