| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 8019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8030 | 8030 |
| 8031 | 8031 |
| 8032 static MaybeObject* Runtime_SetNewFunctionAttributes(Arguments args) { | 8032 static MaybeObject* Runtime_SetNewFunctionAttributes(Arguments args) { |
| 8033 // This utility adjusts the property attributes for newly created Function | 8033 // This utility adjusts the property attributes for newly created Function |
| 8034 // object ("new Function(...)") by changing the map. | 8034 // object ("new Function(...)") by changing the map. |
| 8035 // All it does is changing the prototype property to enumerable | 8035 // All it does is changing the prototype property to enumerable |
| 8036 // as specified in ECMA262, 15.3.5.2. | 8036 // as specified in ECMA262, 15.3.5.2. |
| 8037 HandleScope scope; | 8037 HandleScope scope; |
| 8038 ASSERT(args.length() == 1); | 8038 ASSERT(args.length() == 1); |
| 8039 CONVERT_ARG_CHECKED(JSFunction, func, 0); | 8039 CONVERT_ARG_CHECKED(JSFunction, func, 0); |
| 8040 ASSERT(func->map()->instance_type() == | 8040 |
| 8041 Top::function_instance_map()->instance_type()); | 8041 Handle<Map> map = func->shared()->strict_mode() |
| 8042 ASSERT(func->map()->instance_size() == | 8042 ? Top::function_instance_map_strict() |
| 8043 Top::function_instance_map()->instance_size()); | 8043 : Top::function_instance_map(); |
| 8044 func->set_map(*Top::function_instance_map()); | 8044 |
| 8045 ASSERT(func->map()->instance_type() == map->instance_type()); |
| 8046 ASSERT(func->map()->instance_size() == map->instance_size()); |
| 8047 func->set_map(*map); |
| 8045 return *func; | 8048 return *func; |
| 8046 } | 8049 } |
| 8047 | 8050 |
| 8048 | 8051 |
| 8049 static MaybeObject* Runtime_AllocateInNewSpace(Arguments args) { | 8052 static MaybeObject* Runtime_AllocateInNewSpace(Arguments args) { |
| 8050 // Allocate a block of memory in NewSpace (filled with a filler). | 8053 // Allocate a block of memory in NewSpace (filled with a filler). |
| 8051 // Use as fallback for allocation in generated code when NewSpace | 8054 // Use as fallback for allocation in generated code when NewSpace |
| 8052 // is full. | 8055 // is full. |
| 8053 ASSERT(args.length() == 1); | 8056 ASSERT(args.length() == 1); |
| 8054 CONVERT_ARG_CHECKED(Smi, size_smi, 0); | 8057 CONVERT_ARG_CHECKED(Smi, size_smi, 0); |
| (...skipping 3570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11625 } else { | 11628 } else { |
| 11626 // Handle last resort GC and make sure to allow future allocations | 11629 // Handle last resort GC and make sure to allow future allocations |
| 11627 // to grow the heap without causing GCs (if possible). | 11630 // to grow the heap without causing GCs (if possible). |
| 11628 Counters::gc_last_resort_from_js.Increment(); | 11631 Counters::gc_last_resort_from_js.Increment(); |
| 11629 Heap::CollectAllGarbage(false); | 11632 Heap::CollectAllGarbage(false); |
| 11630 } | 11633 } |
| 11631 } | 11634 } |
| 11632 | 11635 |
| 11633 | 11636 |
| 11634 } } // namespace v8::internal | 11637 } } // namespace v8::internal |
| OLD | NEW |