| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <iomanip> | 7 #include <iomanip> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
| 11 #include "src/interpreter/bytecode-array-iterator.h" | 11 #include "src/interpreter/bytecode-array-iterator.h" |
| 12 #include "src/interpreter/bytecodes.h" | 12 #include "src/interpreter/bytecodes.h" |
| 13 #include "src/isolate-inl.h" | 13 #include "src/isolate-inl.h" |
| 14 #include "src/ostreams.h" | 14 #include "src/ostreams.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 RUNTIME_FUNCTION(Runtime_InterpreterToBoolean) { | |
| 20 SealHandleScope shs(isolate); | |
| 21 DCHECK_EQ(1, args.length()); | |
| 22 CONVERT_ARG_CHECKED(Object, x, 0); | |
| 23 return isolate->heap()->ToBoolean(x->BooleanValue()); | |
| 24 } | |
| 25 | |
| 26 | |
| 27 RUNTIME_FUNCTION(Runtime_InterpreterLogicalNot) { | |
| 28 SealHandleScope shs(isolate); | |
| 29 DCHECK_EQ(1, args.length()); | |
| 30 CONVERT_ARG_CHECKED(Object, x, 0); | |
| 31 return isolate->heap()->ToBoolean(!x->BooleanValue()); | |
| 32 } | |
| 33 | |
| 34 | |
| 35 RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) { | 19 RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) { |
| 36 HandleScope scope(isolate); | 20 HandleScope scope(isolate); |
| 37 DCHECK_EQ(2, args.length()); | 21 DCHECK_EQ(2, args.length()); |
| 38 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); | 22 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); |
| 39 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 1); | 23 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 1); |
| 40 Handle<Context> context(isolate->context(), isolate); | 24 Handle<Context> context(isolate->context(), isolate); |
| 41 return *isolate->factory()->NewFunctionFromSharedFunctionInfo( | 25 return *isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 42 shared, context, static_cast<PretenureFlag>(pretenured_flag)); | 26 shared, context, static_cast<PretenureFlag>(pretenured_flag)); |
| 43 } | 27 } |
| 44 | 28 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { | 138 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { |
| 155 SealHandleScope shs(isolate); | 139 SealHandleScope shs(isolate); |
| 156 DCHECK_EQ(1, args.length()); | 140 DCHECK_EQ(1, args.length()); |
| 157 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); | 141 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); |
| 158 isolate->thread_local_top()->pending_message_obj_ = *message; | 142 isolate->thread_local_top()->pending_message_obj_ = *message; |
| 159 return isolate->heap()->undefined_value(); | 143 return isolate->heap()->undefined_value(); |
| 160 } | 144 } |
| 161 | 145 |
| 162 } // namespace internal | 146 } // namespace internal |
| 163 } // namespace v8 | 147 } // namespace v8 |
| OLD | NEW |