Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: src/runtime/runtime-interpreter.cc

Issue 1390483002: [Interpreter] Unary operators - typeof, void, and logical not. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase and incorporate feedback on patch set 2. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/isolate-inl.h" 8 #include "src/isolate-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 115
116 RUNTIME_FUNCTION(Runtime_InterpreterToBoolean) { 116 RUNTIME_FUNCTION(Runtime_InterpreterToBoolean) {
117 SealHandleScope scope(isolate); 117 SealHandleScope scope(isolate);
118 DCHECK_EQ(1, args.length()); 118 DCHECK_EQ(1, args.length());
119 CONVERT_ARG_CHECKED(Object, x, 0); 119 CONVERT_ARG_CHECKED(Object, x, 0);
120 return isolate->heap()->ToBoolean(x->BooleanValue()); 120 return isolate->heap()->ToBoolean(x->BooleanValue());
121 } 121 }
122 122
123 123
124 RUNTIME_FUNCTION(Runtime_InterpreterLogicalNot) {
125 HandleScope scope(isolate);
Toon Verwaest 2015/10/06 13:25:27 SealHandleScope shs(isolate); ?
oth 2015/10/06 13:52:10 Done.
126 DCHECK_EQ(1, args.length());
127 CONVERT_ARG_CHECKED(Object, x, 0);
128 return isolate->heap()->ToBoolean(!x->BooleanValue());
129 }
130
131
132 RUNTIME_FUNCTION(Runtime_InterpreterTypeOf) {
133 HandleScope scope(isolate);
134 DCHECK_EQ(1, args.length());
135 CONVERT_ARG_CHECKED(Object, x, 0);
Toon Verwaest 2015/10/06 13:25:27 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0); avoids r
oth 2015/10/06 13:52:09 Done.
136 return Object::cast(*Object::TypeOf(isolate, handle(x, isolate)));
137 }
138
139
124 } // namespace internal 140 } // namespace internal
125 } // namespace v8 141 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698