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

Side by Side Diff: src/api.cc

Issue 226063003: Revert "Compare external pixel data length against Smi::kMaxValue" (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 | src/objects.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 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 3723 matching lines...) Expand 10 before | Expand all | Expand 10 after
3734 } 3734 }
3735 3735
3736 } // namespace 3736 } // namespace
3737 3737
3738 3738
3739 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { 3739 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
3740 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3740 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3741 ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return); 3741 ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return);
3742 ENTER_V8(isolate); 3742 ENTER_V8(isolate);
3743 i::HandleScope scope(isolate); 3743 i::HandleScope scope(isolate);
3744 if (!Utils::ApiCheck(length >= 0 && length <= i::Smi::kMaxValue, 3744 if (!Utils::ApiCheck(length >= 0 &&
3745 length <= i::ExternalUint8ClampedArray::kMaxLength,
3745 "v8::Object::SetIndexedPropertiesToPixelData()", 3746 "v8::Object::SetIndexedPropertiesToPixelData()",
3746 "length exceeds max acceptable value")) { 3747 "length exceeds max acceptable value")) {
3747 return; 3748 return;
3748 } 3749 }
3749 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3750 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3750 if (!Utils::ApiCheck(!self->IsJSArray(), 3751 if (!Utils::ApiCheck(!self->IsJSArray(),
3751 "v8::Object::SetIndexedPropertiesToPixelData()", 3752 "v8::Object::SetIndexedPropertiesToPixelData()",
3752 "JSArray is not supported")) { 3753 "JSArray is not supported")) {
3753 return; 3754 return;
3754 } 3755 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3790 3791
3791 3792
3792 void v8::Object::SetIndexedPropertiesToExternalArrayData( 3793 void v8::Object::SetIndexedPropertiesToExternalArrayData(
3793 void* data, 3794 void* data,
3794 ExternalArrayType array_type, 3795 ExternalArrayType array_type,
3795 int length) { 3796 int length) {
3796 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3797 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3797 ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return); 3798 ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return);
3798 ENTER_V8(isolate); 3799 ENTER_V8(isolate);
3799 i::HandleScope scope(isolate); 3800 i::HandleScope scope(isolate);
3800 if (!Utils::ApiCheck(length >= 0 && length <= i::Smi::kMaxValue, 3801 if (!Utils::ApiCheck(length >= 0 && length <= i::ExternalArray::kMaxLength,
3801 "v8::Object::SetIndexedPropertiesToExternalArrayData()", 3802 "v8::Object::SetIndexedPropertiesToExternalArrayData()",
3802 "length exceeds max acceptable value")) { 3803 "length exceeds max acceptable value")) {
3803 return; 3804 return;
3804 } 3805 }
3805 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3806 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3806 if (!Utils::ApiCheck(!self->IsJSArray(), 3807 if (!Utils::ApiCheck(!self->IsJSArray(),
3807 "v8::Object::SetIndexedPropertiesToExternalArrayData()", 3808 "v8::Object::SetIndexedPropertiesToExternalArrayData()",
3808 "JSArray is not supported")) { 3809 "JSArray is not supported")) {
3809 return; 3810 return;
3810 } 3811 }
(...skipping 3850 matching lines...) Expand 10 before | Expand all | Expand 10 after
7661 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7662 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7662 Address callback_address = 7663 Address callback_address =
7663 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7664 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7664 VMState<EXTERNAL> state(isolate); 7665 VMState<EXTERNAL> state(isolate);
7665 ExternalCallbackScope call_scope(isolate, callback_address); 7666 ExternalCallbackScope call_scope(isolate, callback_address);
7666 callback(info); 7667 callback(info);
7667 } 7668 }
7668 7669
7669 7670
7670 } } // namespace v8::internal 7671 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698