| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { | 227 RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { |
| 228 HandleScope scope(isolate); | 228 HandleScope scope(isolate); |
| 229 DCHECK(args.length() == 2); | 229 DCHECK(args.length() == 2); |
| 230 CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0); | 230 CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0); |
| 231 CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1); | 231 CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1); |
| 232 | 232 |
| 233 JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); | 233 JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); |
| 234 | 234 |
| 235 if (constructor->map()->is_strong()) { | 235 if (constructor->map()->is_strong()) { |
| 236 DCHECK(prototype->map()->is_strong()); | 236 DCHECK(prototype->map()->is_strong()); |
| 237 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::Freeze(prototype)); | 237 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(prototype, FROZEN, |
| 238 Handle<Object> result; | 238 Object::THROW_ON_ERROR), |
| 239 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 239 isolate->heap()->exception()); |
| 240 JSObject::Freeze(constructor)); | 240 MAYBE_RETURN(JSReceiver::SetIntegrityLevel(constructor, FROZEN, |
| 241 return *result; | 241 Object::THROW_ON_ERROR), |
| 242 isolate->heap()->exception()); |
| 242 } | 243 } |
| 243 return *constructor; | 244 return *constructor; |
| 244 } | 245 } |
| 245 | 246 |
| 246 | 247 |
| 247 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) { | 248 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) { |
| 248 HandleScope shs(isolate); | 249 HandleScope shs(isolate); |
| 249 DCHECK(args.length() == 1); | 250 DCHECK(args.length() == 1); |
| 250 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); | 251 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| 251 | 252 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 Handle<Object> result; | 504 Handle<Object> result; |
| 504 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 505 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 505 isolate, result, Execution::New(isolate, super_constructor, new_target, | 506 isolate, result, Execution::New(isolate, super_constructor, new_target, |
| 506 argument_count, arguments.get())); | 507 argument_count, arguments.get())); |
| 507 | 508 |
| 508 return *result; | 509 return *result; |
| 509 } | 510 } |
| 510 | 511 |
| 511 } // namespace internal | 512 } // namespace internal |
| 512 } // namespace v8 | 513 } // namespace v8 |
| OLD | NEW |