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

Side by Side Diff: src/api.cc

Issue 196139: X64: Convert smis to holding 32 bits of payload. (Closed)
Patch Set: Addressed review comments. Forwarded to head. Created 11 years, 2 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
« no previous file with comments | « include/v8.h ('k') | src/execution.cc » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props)); 2283 i::Handle<i::JSObject> js_obj(i::JSObject::cast(*hidden_props));
2284 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); 2284 i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
2285 return i::DeleteProperty(js_obj, key_obj)->IsTrue(); 2285 return i::DeleteProperty(js_obj, key_obj)->IsTrue();
2286 } 2286 }
2287 2287
2288 2288
2289 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { 2289 void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
2290 ON_BAILOUT("v8::SetElementsToPixelData()", return); 2290 ON_BAILOUT("v8::SetElementsToPixelData()", return);
2291 ENTER_V8; 2291 ENTER_V8;
2292 HandleScope scope; 2292 HandleScope scope;
2293 if (!ApiCheck(i::Smi::IsValid(length), 2293 if (!ApiCheck(length <= i::PixelArray::kMaxLength,
2294 "v8::Object::SetIndexedPropertiesToPixelData()", 2294 "v8::Object::SetIndexedPropertiesToPixelData()",
2295 "length exceeds max acceptable value")) { 2295 "length exceeds max acceptable value")) {
2296 return; 2296 return;
2297 } 2297 }
2298 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 2298 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
2299 if (!ApiCheck(!self->IsJSArray(), 2299 if (!ApiCheck(!self->IsJSArray(),
2300 "v8::Object::SetIndexedPropertiesToPixelData()", 2300 "v8::Object::SetIndexedPropertiesToPixelData()",
2301 "JSArray is not supported")) { 2301 "JSArray is not supported")) {
2302 return; 2302 return;
2303 } 2303 }
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2842 Local<Value> v8::External::Wrap(void* data) { 2842 Local<Value> v8::External::Wrap(void* data) {
2843 STATIC_ASSERT(sizeof(data) == sizeof(i::Address)); 2843 STATIC_ASSERT(sizeof(data) == sizeof(i::Address));
2844 LOG_API("External::Wrap"); 2844 LOG_API("External::Wrap");
2845 EnsureInitialized("v8::External::Wrap()"); 2845 EnsureInitialized("v8::External::Wrap()");
2846 ENTER_V8; 2846 ENTER_V8;
2847 if ((reinterpret_cast<intptr_t>(data) & kAlignedPointerMask) == 0) { 2847 if ((reinterpret_cast<intptr_t>(data) & kAlignedPointerMask) == 0) {
2848 uintptr_t data_ptr = reinterpret_cast<uintptr_t>(data); 2848 uintptr_t data_ptr = reinterpret_cast<uintptr_t>(data);
2849 intptr_t data_value = 2849 intptr_t data_value =
2850 static_cast<intptr_t>(data_ptr >> i::Internals::kAlignedPointerShift); 2850 static_cast<intptr_t>(data_ptr >> i::Internals::kAlignedPointerShift);
2851 STATIC_ASSERT(sizeof(data_ptr) == sizeof(data_value)); 2851 STATIC_ASSERT(sizeof(data_ptr) == sizeof(data_value));
2852 if (i::Smi::IsIntptrValid(data_value)) { 2852 if (i::Smi::IsValid(data_value)) {
2853 i::Handle<i::Object> obj(i::Smi::FromIntptr(data_value)); 2853 i::Handle<i::Object> obj(i::Smi::FromIntptr(data_value));
2854 return Utils::ToLocal(obj); 2854 return Utils::ToLocal(obj);
2855 } 2855 }
2856 } 2856 }
2857 return ExternalNewImpl(data); 2857 return ExternalNewImpl(data);
2858 } 2858 }
2859 2859
2860 2860
2861 void* v8::External::FullUnwrap(v8::Handle<v8::Value> wrapper) { 2861 void* v8::External::FullUnwrap(v8::Handle<v8::Value> wrapper) {
2862 if (IsDeadCheck("v8::External::Unwrap()")) return 0; 2862 if (IsDeadCheck("v8::External::Unwrap()")) return 0;
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
3766 3766
3767 3767
3768 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3768 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3769 HandleScopeImplementer* thread_local = 3769 HandleScopeImplementer* thread_local =
3770 reinterpret_cast<HandleScopeImplementer*>(storage); 3770 reinterpret_cast<HandleScopeImplementer*>(storage);
3771 thread_local->IterateThis(v); 3771 thread_local->IterateThis(v);
3772 return storage + ArchiveSpacePerThread(); 3772 return storage + ArchiveSpacePerThread();
3773 } 3773 }
3774 3774
3775 } } // namespace v8::internal 3775 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698