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 "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 DCHECK(args.length() == 1); | 1018 DCHECK(args.length() == 1); |
1019 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 1019 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
1020 if (object->IsJSObject() && !object->IsGlobalObject()) { | 1020 if (object->IsJSObject() && !object->IsGlobalObject()) { |
1021 JSObject::MigrateSlowToFast(Handle<JSObject>::cast(object), 0, | 1021 JSObject::MigrateSlowToFast(Handle<JSObject>::cast(object), 0, |
1022 "RuntimeToFastProperties"); | 1022 "RuntimeToFastProperties"); |
1023 } | 1023 } |
1024 return *object; | 1024 return *object; |
1025 } | 1025 } |
1026 | 1026 |
1027 | 1027 |
1028 RUNTIME_FUNCTION(Runtime_NewStringWrapper) { | |
1029 HandleScope scope(isolate); | |
1030 DCHECK(args.length() == 1); | |
1031 CONVERT_ARG_HANDLE_CHECKED(String, value, 0); | |
1032 return *Object::ToObject(isolate, value).ToHandleChecked(); | |
1033 } | |
1034 | |
1035 | |
1036 RUNTIME_FUNCTION(Runtime_AllocateHeapNumber) { | 1028 RUNTIME_FUNCTION(Runtime_AllocateHeapNumber) { |
1037 HandleScope scope(isolate); | 1029 HandleScope scope(isolate); |
1038 DCHECK(args.length() == 0); | 1030 DCHECK(args.length() == 0); |
1039 return *isolate->factory()->NewHeapNumber(0); | 1031 return *isolate->factory()->NewHeapNumber(0); |
1040 } | 1032 } |
1041 | 1033 |
1042 | 1034 |
1043 static Object* Runtime_NewObjectHelper(Isolate* isolate, | 1035 static Object* Runtime_NewObjectHelper(Isolate* isolate, |
1044 Handle<Object> constructor, | 1036 Handle<Object> constructor, |
1045 Handle<Object> original_constructor, | 1037 Handle<Object> original_constructor, |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) { | 1546 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) { |
1555 HandleScope scope(isolate); | 1547 HandleScope scope(isolate); |
1556 DCHECK_EQ(2, args.length()); | 1548 DCHECK_EQ(2, args.length()); |
1557 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); | 1549 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); |
1558 CONVERT_ARG_HANDLE_CHECKED(Object, done, 1); | 1550 CONVERT_ARG_HANDLE_CHECKED(Object, done, 1); |
1559 return *isolate->factory()->NewJSIteratorResult(value, done); | 1551 return *isolate->factory()->NewJSIteratorResult(value, done); |
1560 } | 1552 } |
1561 | 1553 |
1562 } // namespace internal | 1554 } // namespace internal |
1563 } // namespace v8 | 1555 } // namespace v8 |
OLD | NEW |