OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 | 2580 |
2581 | 2581 |
2582 int JSFunction::NumberOfLiterals() { | 2582 int JSFunction::NumberOfLiterals() { |
2583 ASSERT(!IsBoilerplate()); | 2583 ASSERT(!IsBoilerplate()); |
2584 return literals()->length(); | 2584 return literals()->length(); |
2585 } | 2585 } |
2586 | 2586 |
2587 | 2587 |
2588 Object* JSBuiltinsObject::javascript_builtin(Builtins::JavaScript id) { | 2588 Object* JSBuiltinsObject::javascript_builtin(Builtins::JavaScript id) { |
2589 ASSERT(0 <= id && id < kJSBuiltinsCount); | 2589 ASSERT(0 <= id && id < kJSBuiltinsCount); |
2590 return READ_FIELD(this, kJSBuiltinsOffset + (id * kPointerSize)); | 2590 return READ_FIELD(this, OffsetOfFunctionWithId(id)); |
2591 } | 2591 } |
2592 | 2592 |
2593 | 2593 |
2594 void JSBuiltinsObject::set_javascript_builtin(Builtins::JavaScript id, | 2594 void JSBuiltinsObject::set_javascript_builtin(Builtins::JavaScript id, |
2595 Object* value) { | 2595 Object* value) { |
2596 ASSERT(0 <= id && id < kJSBuiltinsCount); | 2596 ASSERT(0 <= id && id < kJSBuiltinsCount); |
2597 WRITE_FIELD(this, kJSBuiltinsOffset + (id * kPointerSize), value); | 2597 WRITE_FIELD(this, OffsetOfFunctionWithId(id), value); |
2598 WRITE_BARRIER(this, kJSBuiltinsOffset + (id * kPointerSize)); | 2598 WRITE_BARRIER(this, OffsetOfFunctionWithId(id)); |
2599 } | 2599 } |
2600 | 2600 |
2601 | 2601 |
| 2602 Code* JSBuiltinsObject::javascript_builtin_code(Builtins::JavaScript id) { |
| 2603 ASSERT(0 <= id && id < kJSBuiltinsCount); |
| 2604 return Code::cast(READ_FIELD(this, OffsetOfCodeWithId(id))); |
| 2605 } |
| 2606 |
| 2607 |
| 2608 void JSBuiltinsObject::set_javascript_builtin_code(Builtins::JavaScript id, |
| 2609 Code* value) { |
| 2610 ASSERT(0 <= id && id < kJSBuiltinsCount); |
| 2611 WRITE_FIELD(this, OffsetOfCodeWithId(id), value); |
| 2612 ASSERT(!Heap::InNewSpace(value)); |
| 2613 } |
| 2614 |
| 2615 |
2602 Address Proxy::proxy() { | 2616 Address Proxy::proxy() { |
2603 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset)); | 2617 return AddressFrom<Address>(READ_INTPTR_FIELD(this, kProxyOffset)); |
2604 } | 2618 } |
2605 | 2619 |
2606 | 2620 |
2607 void Proxy::set_proxy(Address value) { | 2621 void Proxy::set_proxy(Address value) { |
2608 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value)); | 2622 WRITE_INTPTR_FIELD(this, kProxyOffset, OffsetFrom(value)); |
2609 } | 2623 } |
2610 | 2624 |
2611 | 2625 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3096 #undef WRITE_INT_FIELD | 3110 #undef WRITE_INT_FIELD |
3097 #undef READ_SHORT_FIELD | 3111 #undef READ_SHORT_FIELD |
3098 #undef WRITE_SHORT_FIELD | 3112 #undef WRITE_SHORT_FIELD |
3099 #undef READ_BYTE_FIELD | 3113 #undef READ_BYTE_FIELD |
3100 #undef WRITE_BYTE_FIELD | 3114 #undef WRITE_BYTE_FIELD |
3101 | 3115 |
3102 | 3116 |
3103 } } // namespace v8::internal | 3117 } } // namespace v8::internal |
3104 | 3118 |
3105 #endif // V8_OBJECTS_INL_H_ | 3119 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |