| 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 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3131 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 3131 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
| 3132 int continuation = generator->continuation(); | 3132 int continuation = generator->continuation(); |
| 3133 const char* message = continuation == JSGeneratorObject::kGeneratorClosed ? | 3133 const char* message = continuation == JSGeneratorObject::kGeneratorClosed ? |
| 3134 "generator_finished" : "generator_running"; | 3134 "generator_finished" : "generator_running"; |
| 3135 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0); | 3135 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0); |
| 3136 Handle<Object> error = isolate->factory()->NewError(message, argv); | 3136 Handle<Object> error = isolate->factory()->NewError(message, argv); |
| 3137 return isolate->Throw(*error); | 3137 return isolate->Throw(*error); |
| 3138 } | 3138 } |
| 3139 | 3139 |
| 3140 | 3140 |
| 3141 RUNTIME_FUNCTION(MaybeObject*, Runtime_ThrowGeneratorStartError) { |
| 3142 HandleScope scope(isolate); |
| 3143 ASSERT(args.length() == 0); |
| 3144 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0); |
| 3145 Handle<Object> error = |
| 3146 isolate->factory()->NewTypeError("generator_start", argv); |
| 3147 return isolate->Throw(*error); |
| 3148 } |
| 3149 |
| 3150 |
| 3141 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectFreeze) { | 3151 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectFreeze) { |
| 3142 HandleScope scope(isolate); | 3152 HandleScope scope(isolate); |
| 3143 ASSERT(args.length() == 1); | 3153 ASSERT(args.length() == 1); |
| 3144 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 3154 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
| 3145 Handle<Object> result = JSObject::Freeze(object); | 3155 Handle<Object> result = JSObject::Freeze(object); |
| 3146 RETURN_IF_EMPTY_HANDLE(isolate, result); | 3156 RETURN_IF_EMPTY_HANDLE(isolate, result); |
| 3147 return *result; | 3157 return *result; |
| 3148 } | 3158 } |
| 3149 | 3159 |
| 3150 | 3160 |
| (...skipping 11713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14864 // Handle last resort GC and make sure to allow future allocations | 14874 // Handle last resort GC and make sure to allow future allocations |
| 14865 // to grow the heap without causing GCs (if possible). | 14875 // to grow the heap without causing GCs (if possible). |
| 14866 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14876 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14867 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14877 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14868 "Runtime::PerformGC"); | 14878 "Runtime::PerformGC"); |
| 14869 } | 14879 } |
| 14870 } | 14880 } |
| 14871 | 14881 |
| 14872 | 14882 |
| 14873 } } // namespace v8::internal | 14883 } } // namespace v8::internal |
| OLD | NEW |