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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 RUNTIME_ASSERT(offset > 0); | 329 RUNTIME_ASSERT(offset > 0); |
330 if (type == FUNCTION_TEMPLATE_INFO_TYPE) { | 330 if (type == FUNCTION_TEMPLATE_INFO_TYPE) { |
331 RUNTIME_ASSERT(offset < FunctionTemplateInfo::kSize); | 331 RUNTIME_ASSERT(offset < FunctionTemplateInfo::kSize); |
332 } else { | 332 } else { |
333 RUNTIME_ASSERT(offset < ObjectTemplateInfo::kSize); | 333 RUNTIME_ASSERT(offset < ObjectTemplateInfo::kSize); |
334 } | 334 } |
335 return *HeapObject::RawField(templ, offset); | 335 return *HeapObject::RawField(templ, offset); |
336 } | 336 } |
337 | 337 |
338 | 338 |
| 339 static Object* Runtime_DisableAccessChecks(Arguments args) { |
| 340 ASSERT(args.length() == 1); |
| 341 CONVERT_CHECKED(HeapObject, object, args[0]); |
| 342 bool needs_access_checks = object->map()->is_access_check_needed(); |
| 343 object->map()->set_is_access_check_needed(false); |
| 344 return needs_access_checks ? Heap::true_value() : Heap::false_value(); |
| 345 } |
| 346 |
| 347 |
| 348 static Object* Runtime_EnableAccessChecks(Arguments args) { |
| 349 ASSERT(args.length() == 1); |
| 350 CONVERT_CHECKED(HeapObject, object, args[0]); |
| 351 object->map()->set_is_access_check_needed(true); |
| 352 return Heap::undefined_value(); |
| 353 } |
| 354 |
| 355 |
339 static Object* ThrowRedeclarationError(const char* type, Handle<String> name) { | 356 static Object* ThrowRedeclarationError(const char* type, Handle<String> name) { |
340 HandleScope scope; | 357 HandleScope scope; |
341 Handle<Object> type_handle = Factory::NewStringFromAscii(CStrVector(type)); | 358 Handle<Object> type_handle = Factory::NewStringFromAscii(CStrVector(type)); |
342 Handle<Object> args[2] = { type_handle, name }; | 359 Handle<Object> args[2] = { type_handle, name }; |
343 Handle<Object> error = | 360 Handle<Object> error = |
344 Factory::NewTypeError("redeclaration", HandleVector(args, 2)); | 361 Factory::NewTypeError("redeclaration", HandleVector(args, 2)); |
345 return Top::Throw(*error); | 362 return Top::Throw(*error); |
346 } | 363 } |
347 | 364 |
348 | 365 |
(...skipping 5438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5787 } else { | 5804 } else { |
5788 // Handle last resort GC and make sure to allow future allocations | 5805 // Handle last resort GC and make sure to allow future allocations |
5789 // to grow the heap without causing GCs (if possible). | 5806 // to grow the heap without causing GCs (if possible). |
5790 Counters::gc_last_resort_from_js.Increment(); | 5807 Counters::gc_last_resort_from_js.Increment(); |
5791 Heap::CollectAllGarbage(); | 5808 Heap::CollectAllGarbage(); |
5792 } | 5809 } |
5793 } | 5810 } |
5794 | 5811 |
5795 | 5812 |
5796 } } // namespace v8::internal | 5813 } } // namespace v8::internal |
OLD | NEW |