| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 6293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6304 | 6304 |
| 6305 | 6305 |
| 6306 void JSBuiltinsObject::set_javascript_builtin(Builtins::JavaScript id, | 6306 void JSBuiltinsObject::set_javascript_builtin(Builtins::JavaScript id, |
| 6307 Object* value) { | 6307 Object* value) { |
| 6308 DCHECK(id < kJSBuiltinsCount); // id is unsigned. | 6308 DCHECK(id < kJSBuiltinsCount); // id is unsigned. |
| 6309 WRITE_FIELD(this, OffsetOfFunctionWithId(id), value); | 6309 WRITE_FIELD(this, OffsetOfFunctionWithId(id), value); |
| 6310 WRITE_BARRIER(GetHeap(), this, OffsetOfFunctionWithId(id), value); | 6310 WRITE_BARRIER(GetHeap(), this, OffsetOfFunctionWithId(id), value); |
| 6311 } | 6311 } |
| 6312 | 6312 |
| 6313 | 6313 |
| 6314 Code* JSBuiltinsObject::javascript_builtin_code(Builtins::JavaScript id) { | |
| 6315 DCHECK(id < kJSBuiltinsCount); // id is unsigned. | |
| 6316 return Code::cast(READ_FIELD(this, OffsetOfCodeWithId(id))); | |
| 6317 } | |
| 6318 | |
| 6319 | |
| 6320 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, | |
| 6321 Code* value) { | |
| 6322 DCHECK(id < kJSBuiltinsCount); // id is unsigned. | |
| 6323 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); | |
| 6324 DCHECK(!GetHeap()->InNewSpace(value)); | |
| 6325 } | |
| 6326 | |
| 6327 | |
| 6328 ACCESSORS(JSProxy, handler, Object, kHandlerOffset) | 6314 ACCESSORS(JSProxy, handler, Object, kHandlerOffset) |
| 6329 ACCESSORS(JSProxy, hash, Object, kHashOffset) | 6315 ACCESSORS(JSProxy, hash, Object, kHashOffset) |
| 6330 ACCESSORS(JSFunctionProxy, call_trap, Object, kCallTrapOffset) | 6316 ACCESSORS(JSFunctionProxy, call_trap, Object, kCallTrapOffset) |
| 6331 ACCESSORS(JSFunctionProxy, construct_trap, Object, kConstructTrapOffset) | 6317 ACCESSORS(JSFunctionProxy, construct_trap, Object, kConstructTrapOffset) |
| 6332 | 6318 |
| 6333 | 6319 |
| 6334 void JSProxy::InitializeBody(int object_size, Object* value) { | 6320 void JSProxy::InitializeBody(int object_size, Object* value) { |
| 6335 DCHECK(!value->IsHeapObject() || !GetHeap()->InNewSpace(value)); | 6321 DCHECK(!value->IsHeapObject() || !GetHeap()->InNewSpace(value)); |
| 6336 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) { | 6322 for (int offset = kHeaderSize; offset < object_size; offset += kPointerSize) { |
| 6337 WRITE_FIELD(this, offset, value); | 6323 WRITE_FIELD(this, offset, value); |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7655 #undef READ_SHORT_FIELD | 7641 #undef READ_SHORT_FIELD |
| 7656 #undef WRITE_SHORT_FIELD | 7642 #undef WRITE_SHORT_FIELD |
| 7657 #undef READ_BYTE_FIELD | 7643 #undef READ_BYTE_FIELD |
| 7658 #undef WRITE_BYTE_FIELD | 7644 #undef WRITE_BYTE_FIELD |
| 7659 #undef NOBARRIER_READ_BYTE_FIELD | 7645 #undef NOBARRIER_READ_BYTE_FIELD |
| 7660 #undef NOBARRIER_WRITE_BYTE_FIELD | 7646 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7661 | 7647 |
| 7662 } } // namespace v8::internal | 7648 } } // namespace v8::internal |
| 7663 | 7649 |
| 7664 #endif // V8_OBJECTS_INL_H_ | 7650 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |