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 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 int continuation = generator->continuation(); | 3064 int continuation = generator->continuation(); |
3065 const char* message = continuation == JSGeneratorObject::kGeneratorClosed ? | 3065 const char* message = continuation == JSGeneratorObject::kGeneratorClosed ? |
3066 "generator_finished" : "generator_running"; | 3066 "generator_finished" : "generator_running"; |
3067 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0); | 3067 Vector< Handle<Object> > argv = HandleVector<Object>(NULL, 0); |
3068 Handle<Object> error = isolate->factory()->NewError(message, argv); | 3068 Handle<Object> error = isolate->factory()->NewError(message, argv); |
3069 return isolate->Throw(*error); | 3069 return isolate->Throw(*error); |
3070 } | 3070 } |
3071 | 3071 |
3072 | 3072 |
3073 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectFreeze) { | 3073 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectFreeze) { |
3074 SealHandleScope shs(isolate); | 3074 HandleScope scope(isolate); |
3075 ASSERT(args.length() == 1); | 3075 ASSERT(args.length() == 1); |
3076 CONVERT_ARG_CHECKED(JSObject, object, 0); | 3076 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
3077 return object->Freeze(isolate); | 3077 Handle<Object> result = JSObject::Freeze(object); |
| 3078 RETURN_IF_EMPTY_HANDLE(isolate, result); |
| 3079 return *result; |
3078 } | 3080 } |
3079 | 3081 |
3080 | 3082 |
3081 MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate, | 3083 MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate, |
3082 Object* char_code) { | 3084 Object* char_code) { |
3083 if (char_code->IsNumber()) { | 3085 if (char_code->IsNumber()) { |
3084 return isolate->heap()->LookupSingleCharacterStringFromCode( | 3086 return isolate->heap()->LookupSingleCharacterStringFromCode( |
3085 NumberToUint32(char_code) & 0xffff); | 3087 NumberToUint32(char_code) & 0xffff); |
3086 } | 3088 } |
3087 return isolate->heap()->empty_string(); | 3089 return isolate->heap()->empty_string(); |
(...skipping 11708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14796 // Handle last resort GC and make sure to allow future allocations | 14798 // Handle last resort GC and make sure to allow future allocations |
14797 // to grow the heap without causing GCs (if possible). | 14799 // to grow the heap without causing GCs (if possible). |
14798 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14800 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14799 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14801 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14800 "Runtime::PerformGC"); | 14802 "Runtime::PerformGC"); |
14801 } | 14803 } |
14802 } | 14804 } |
14803 | 14805 |
14804 | 14806 |
14805 } } // namespace v8::internal | 14807 } } // namespace v8::internal |
OLD | NEW |