| 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 9198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9209 CONVERT_LANGUAGE_MODE_ARG(language_mode, 3); | 9209 CONVERT_LANGUAGE_MODE_ARG(language_mode, 3); |
| 9210 ASSERT(args[4]->IsSmi()); | 9210 ASSERT(args[4]->IsSmi()); |
| 9211 return CompileGlobalEval(isolate, | 9211 return CompileGlobalEval(isolate, |
| 9212 args.at<String>(1), | 9212 args.at<String>(1), |
| 9213 args.at<Object>(2), | 9213 args.at<Object>(2), |
| 9214 language_mode, | 9214 language_mode, |
| 9215 args.smi_at(4)); | 9215 args.smi_at(4)); |
| 9216 } | 9216 } |
| 9217 | 9217 |
| 9218 | 9218 |
| 9219 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetNewFunctionAttributes) { | |
| 9220 // This utility adjusts the property attributes for newly created Function | |
| 9221 // object ("new Function(...)") by changing the map. | |
| 9222 // All it does is changing the prototype property to enumerable | |
| 9223 // as specified in ECMA262, 15.3.5.2. | |
| 9224 HandleScope scope(isolate); | |
| 9225 ASSERT(args.length() == 1); | |
| 9226 CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0); | |
| 9227 | |
| 9228 Handle<Map> map = func->shared()->is_classic_mode() | |
| 9229 ? isolate->function_instance_map() | |
| 9230 : isolate->strict_mode_function_instance_map(); | |
| 9231 | |
| 9232 ASSERT(func->map()->instance_type() == map->instance_type()); | |
| 9233 ASSERT(func->map()->instance_size() == map->instance_size()); | |
| 9234 func->set_map(*map); | |
| 9235 return *func; | |
| 9236 } | |
| 9237 | |
| 9238 | |
| 9239 RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInNewSpace) { | 9219 RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInNewSpace) { |
| 9240 // Allocate a block of memory in NewSpace (filled with a filler). | 9220 // Allocate a block of memory in NewSpace (filled with a filler). |
| 9241 // Use as fallback for allocation in generated code when NewSpace | 9221 // Use as fallback for allocation in generated code when NewSpace |
| 9242 // is full. | 9222 // is full. |
| 9243 NoHandleAllocation ha(isolate); | 9223 NoHandleAllocation ha(isolate); |
| 9244 ASSERT(args.length() == 1); | 9224 ASSERT(args.length() == 1); |
| 9245 CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0); | 9225 CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0); |
| 9246 int size = size_smi->value(); | 9226 int size = size_smi->value(); |
| 9247 RUNTIME_ASSERT(IsAligned(size, kPointerSize)); | 9227 RUNTIME_ASSERT(IsAligned(size, kPointerSize)); |
| 9248 RUNTIME_ASSERT(size > 0); | 9228 RUNTIME_ASSERT(size > 0); |
| (...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13517 // Handle last resort GC and make sure to allow future allocations | 13497 // Handle last resort GC and make sure to allow future allocations |
| 13518 // to grow the heap without causing GCs (if possible). | 13498 // to grow the heap without causing GCs (if possible). |
| 13519 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13499 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13520 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13500 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13521 "Runtime::PerformGC"); | 13501 "Runtime::PerformGC"); |
| 13522 } | 13502 } |
| 13523 } | 13503 } |
| 13524 | 13504 |
| 13525 | 13505 |
| 13526 } } // namespace v8::internal | 13506 } } // namespace v8::internal |
| OLD | NEW |