OLD | NEW |
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 5014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5025 | 5025 |
5026 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) { | 5026 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) { |
5027 ASSERT(args.length() == 1); | 5027 ASSERT(args.length() == 1); |
5028 Object* object = args[0]; | 5028 Object* object = args[0]; |
5029 return (object->IsJSObject() && !object->IsGlobalObject()) | 5029 return (object->IsJSObject() && !object->IsGlobalObject()) |
5030 ? JSObject::cast(object)->TransformToFastProperties(0) | 5030 ? JSObject::cast(object)->TransformToFastProperties(0) |
5031 : object; | 5031 : object; |
5032 } | 5032 } |
5033 | 5033 |
5034 | 5034 |
5035 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToSlowProperties) { | |
5036 ASSERT(args.length() == 1); | |
5037 Object* obj = args[0]; | |
5038 return (obj->IsJSObject() && !obj->IsJSGlobalProxy()) | |
5039 ? JSObject::cast(obj)->NormalizeProperties(CLEAR_INOBJECT_PROPERTIES, 0) | |
5040 : obj; | |
5041 } | |
5042 | |
5043 | |
5044 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToBool) { | 5035 RUNTIME_FUNCTION(MaybeObject*, Runtime_ToBool) { |
5045 NoHandleAllocation ha; | 5036 NoHandleAllocation ha; |
5046 ASSERT(args.length() == 1); | 5037 ASSERT(args.length() == 1); |
5047 | 5038 |
5048 return args[0]->ToBoolean(); | 5039 return args[0]->ToBoolean(); |
5049 } | 5040 } |
5050 | 5041 |
5051 | 5042 |
5052 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47). | 5043 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47). |
5053 // Possible optimizations: put the type string into the oddballs. | 5044 // Possible optimizations: put the type string into the oddballs. |
(...skipping 8230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13284 // Handle last resort GC and make sure to allow future allocations | 13275 // Handle last resort GC and make sure to allow future allocations |
13285 // to grow the heap without causing GCs (if possible). | 13276 // to grow the heap without causing GCs (if possible). |
13286 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13277 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13287 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13278 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13288 "Runtime::PerformGC"); | 13279 "Runtime::PerformGC"); |
13289 } | 13280 } |
13290 } | 13281 } |
13291 | 13282 |
13292 | 13283 |
13293 } } // namespace v8::internal | 13284 } } // namespace v8::internal |
OLD | NEW |