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

Side by Side Diff: src/objects-inl.h

Issue 15001041: Externalization API for ArrayBuffer (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
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 5285 matching lines...) Expand 10 before | Expand all | Expand 10 after
5296 } 5296 }
5297 5297
5298 5298
5299 void JSArrayBuffer::set_backing_store(void* value, WriteBarrierMode mode) { 5299 void JSArrayBuffer::set_backing_store(void* value, WriteBarrierMode mode) {
5300 intptr_t ptr = reinterpret_cast<intptr_t>(value); 5300 intptr_t ptr = reinterpret_cast<intptr_t>(value);
5301 WRITE_INTPTR_FIELD(this, kBackingStoreOffset, ptr); 5301 WRITE_INTPTR_FIELD(this, kBackingStoreOffset, ptr);
5302 } 5302 }
5303 5303
5304 5304
5305 ACCESSORS(JSArrayBuffer, byte_length, Object, kByteLengthOffset) 5305 ACCESSORS(JSArrayBuffer, byte_length, Object, kByteLengthOffset)
5306 ACCESSORS_TO_SMI(JSArrayBuffer, flag, kFlagOffset)
5307
5308
5309 bool JSArrayBuffer::is_external() {
5310 return BooleanBit::get(flag(), kIsExternalBit);
5311 }
5312
5313
5314 void JSArrayBuffer::set_is_external(bool value) {
5315 set_flag(BooleanBit::set(flag(), kIsExternalBit, value));
5316 }
5306 5317
5307 5318
5308 ACCESSORS(JSTypedArray, buffer, Object, kBufferOffset) 5319 ACCESSORS(JSTypedArray, buffer, Object, kBufferOffset)
5309 ACCESSORS(JSTypedArray, byte_offset, Object, kByteOffsetOffset) 5320 ACCESSORS(JSTypedArray, byte_offset, Object, kByteOffsetOffset)
5310 ACCESSORS(JSTypedArray, byte_length, Object, kByteLengthOffset) 5321 ACCESSORS(JSTypedArray, byte_length, Object, kByteLengthOffset)
5311 ACCESSORS(JSTypedArray, length, Object, kLengthOffset) 5322 ACCESSORS(JSTypedArray, length, Object, kLengthOffset)
5312 5323
5313
5314 ACCESSORS(JSRegExp, data, Object, kDataOffset) 5324 ACCESSORS(JSRegExp, data, Object, kDataOffset)
5315 5325
5316 5326
5317 JSRegExp::Type JSRegExp::TypeTag() { 5327 JSRegExp::Type JSRegExp::TypeTag() {
5318 Object* data = this->data(); 5328 Object* data = this->data();
5319 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED; 5329 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED;
5320 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); 5330 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex));
5321 return static_cast<JSRegExp::Type>(smi->value()); 5331 return static_cast<JSRegExp::Type>(smi->value());
5322 } 5332 }
5323 5333
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
6202 #undef WRITE_UINT32_FIELD 6212 #undef WRITE_UINT32_FIELD
6203 #undef READ_SHORT_FIELD 6213 #undef READ_SHORT_FIELD
6204 #undef WRITE_SHORT_FIELD 6214 #undef WRITE_SHORT_FIELD
6205 #undef READ_BYTE_FIELD 6215 #undef READ_BYTE_FIELD
6206 #undef WRITE_BYTE_FIELD 6216 #undef WRITE_BYTE_FIELD
6207 6217
6208 6218
6209 } } // namespace v8::internal 6219 } } // namespace v8::internal
6210 6220
6211 #endif // V8_OBJECTS_INL_H_ 6221 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698