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

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

Issue 8914: Add support for API accessors that prohibit overwriting by accessors... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 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 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 set_bit_field(bit_field() & ~(1 << kHasNonInstancePrototype)); 1670 set_bit_field(bit_field() & ~(1 << kHasNonInstancePrototype));
1671 } 1671 }
1672 } 1672 }
1673 1673
1674 1674
1675 bool Map::has_non_instance_prototype() { 1675 bool Map::has_non_instance_prototype() {
1676 return ((1 << kHasNonInstancePrototype) & bit_field()) != 0; 1676 return ((1 << kHasNonInstancePrototype) & bit_field()) != 0;
1677 } 1677 }
1678 1678
1679 1679
1680 void Map::set_is_access_check_needed(bool access_check_needed) {
1681 if (access_check_needed) {
1682 set_bit_field(bit_field() | (1 << kIsAccessCheckNeeded));
1683 } else {
1684 set_bit_field(bit_field() & ~(1 << kIsAccessCheckNeeded));
1685 }
1686 }
1687
1688
1689 bool Map::is_access_check_needed() {
1690 return ((1 << kIsAccessCheckNeeded) & bit_field()) != 0;
1691 }
1692
1693
1680 Code::Flags Code::flags() { 1694 Code::Flags Code::flags() {
1681 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset)); 1695 return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset));
1682 } 1696 }
1683 1697
1684 1698
1685 void Code::set_flags(Code::Flags flags) { 1699 void Code::set_flags(Code::Flags flags) {
1686 // Make sure that all call stubs have an arguments count. 1700 // Make sure that all call stubs have an arguments count.
1687 ASSERT(ExtractKindFromFlags(flags) != CALL_IC || 1701 ASSERT(ExtractKindFromFlags(flags) != CALL_IC ||
1688 ExtractArgumentsCountFromFlags(flags) >= 0); 1702 ExtractArgumentsCountFromFlags(flags) >= 0);
1689 WRITE_INT_FIELD(this, kFlagsOffset, flags); 1703 WRITE_INT_FIELD(this, kFlagsOffset, flags);
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 bool AccessorInfo::all_can_write() { 2305 bool AccessorInfo::all_can_write() {
2292 return BooleanBit::get(flag(), kAllCanWriteBit); 2306 return BooleanBit::get(flag(), kAllCanWriteBit);
2293 } 2307 }
2294 2308
2295 2309
2296 void AccessorInfo::set_all_can_write(bool value) { 2310 void AccessorInfo::set_all_can_write(bool value) {
2297 set_flag(BooleanBit::set(flag(), kAllCanWriteBit, value)); 2311 set_flag(BooleanBit::set(flag(), kAllCanWriteBit, value));
2298 } 2312 }
2299 2313
2300 2314
2315 bool AccessorInfo::prohibits_overwriting() {
2316 return BooleanBit::get(flag(), kProhibitsOverwritingBit);
2317 }
2318
2319
2320 void AccessorInfo::set_prohibits_overwriting(bool value) {
2321 set_flag(BooleanBit::set(flag(), kProhibitsOverwritingBit, value));
2322 }
2323
2324
2301 PropertyAttributes AccessorInfo::property_attributes() { 2325 PropertyAttributes AccessorInfo::property_attributes() {
2302 return AttributesField::decode(static_cast<uint32_t>(flag()->value())); 2326 return AttributesField::decode(static_cast<uint32_t>(flag()->value()));
2303 } 2327 }
2304 2328
2305 2329
2306 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) { 2330 void AccessorInfo::set_property_attributes(PropertyAttributes attributes) {
2307 ASSERT(AttributesField::is_valid(attributes)); 2331 ASSERT(AttributesField::is_valid(attributes));
2308 int rest_value = flag()->value() & ~AttributesField::mask(); 2332 int rest_value = flag()->value() & ~AttributesField::mask();
2309 set_flag(Smi::FromInt(rest_value | AttributesField::encode(attributes))); 2333 set_flag(Smi::FromInt(rest_value | AttributesField::encode(attributes)));
2310 } 2334 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 #undef WRITE_INT_FIELD 2384 #undef WRITE_INT_FIELD
2361 #undef READ_SHORT_FIELD 2385 #undef READ_SHORT_FIELD
2362 #undef WRITE_SHORT_FIELD 2386 #undef WRITE_SHORT_FIELD
2363 #undef READ_BYTE_FIELD 2387 #undef READ_BYTE_FIELD
2364 #undef WRITE_BYTE_FIELD 2388 #undef WRITE_BYTE_FIELD
2365 2389
2366 2390
2367 } } // namespace v8::internal 2391 } } // namespace v8::internal
2368 2392
2369 #endif // V8_OBJECTS_INL_H_ 2393 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698