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 8027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8038 | 8038 |
8039 | 8039 |
8040 static MaybeObject* Runtime_SetNewFunctionAttributes(Arguments args) { | 8040 static MaybeObject* Runtime_SetNewFunctionAttributes(Arguments args) { |
8041 // This utility adjusts the property attributes for newly created Function | 8041 // This utility adjusts the property attributes for newly created Function |
8042 // object ("new Function(...)") by changing the map. | 8042 // object ("new Function(...)") by changing the map. |
8043 // All it does is changing the prototype property to enumerable | 8043 // All it does is changing the prototype property to enumerable |
8044 // as specified in ECMA262, 15.3.5.2. | 8044 // as specified in ECMA262, 15.3.5.2. |
8045 HandleScope scope; | 8045 HandleScope scope; |
8046 ASSERT(args.length() == 1); | 8046 ASSERT(args.length() == 1); |
8047 CONVERT_ARG_CHECKED(JSFunction, func, 0); | 8047 CONVERT_ARG_CHECKED(JSFunction, func, 0); |
8048 ASSERT(func->map()->instance_type() == | 8048 |
8049 Top::function_instance_map()->instance_type()); | 8049 Handle<Map> map = func->shared()->strict_mode() |
8050 ASSERT(func->map()->instance_size() == | 8050 ? Top::function_instance_map_strict() |
8051 Top::function_instance_map()->instance_size()); | 8051 : Top::function_instance_map(); |
8052 func->set_map(*Top::function_instance_map()); | 8052 |
| 8053 ASSERT(func->map()->instance_type() == map->instance_type()); |
| 8054 ASSERT(func->map()->instance_size() == map->instance_size()); |
| 8055 func->set_map(*map); |
8053 return *func; | 8056 return *func; |
8054 } | 8057 } |
8055 | 8058 |
8056 | 8059 |
8057 static MaybeObject* Runtime_AllocateInNewSpace(Arguments args) { | 8060 static MaybeObject* Runtime_AllocateInNewSpace(Arguments args) { |
8058 // Allocate a block of memory in NewSpace (filled with a filler). | 8061 // Allocate a block of memory in NewSpace (filled with a filler). |
8059 // Use as fallback for allocation in generated code when NewSpace | 8062 // Use as fallback for allocation in generated code when NewSpace |
8060 // is full. | 8063 // is full. |
8061 ASSERT(args.length() == 1); | 8064 ASSERT(args.length() == 1); |
8062 CONVERT_ARG_CHECKED(Smi, size_smi, 0); | 8065 CONVERT_ARG_CHECKED(Smi, size_smi, 0); |
(...skipping 3570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11633 } else { | 11636 } else { |
11634 // Handle last resort GC and make sure to allow future allocations | 11637 // Handle last resort GC and make sure to allow future allocations |
11635 // to grow the heap without causing GCs (if possible). | 11638 // to grow the heap without causing GCs (if possible). |
11636 Counters::gc_last_resort_from_js.Increment(); | 11639 Counters::gc_last_resort_from_js.Increment(); |
11637 Heap::CollectAllGarbage(false); | 11640 Heap::CollectAllGarbage(false); |
11638 } | 11641 } |
11639 } | 11642 } |
11640 | 11643 |
11641 | 11644 |
11642 } } // namespace v8::internal | 11645 } } // namespace v8::internal |
OLD | NEW |