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

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: Incorporate review comments on patch set 3. 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 Maybe<bool> result = Object::GreaterThanOrEqual(x, y); 89 Maybe<bool> result = Object::GreaterThanOrEqual(x, y);
90 if (result.IsJust()) { 90 if (result.IsJust()) {
91 return isolate->heap()->ToBoolean(result.FromJust()); 91 return isolate->heap()->ToBoolean(result.FromJust());
92 } else { 92 } else {
93 return isolate->heap()->exception(); 93 return isolate->heap()->exception();
94 } 94 }
95 } 95 }
96 96
97 97
98 RUNTIME_FUNCTION(Runtime_InterpreterStrictEquals) { 98 RUNTIME_FUNCTION(Runtime_InterpreterStrictEquals) {
99 SealHandleScope scope(isolate); 99 SealHandleScope shs(isolate);
100 DCHECK_EQ(2, args.length()); 100 DCHECK_EQ(2, args.length());
101 CONVERT_ARG_CHECKED(Object, x, 0); 101 CONVERT_ARG_CHECKED(Object, x, 0);
102 CONVERT_ARG_CHECKED(Object, y, 1); 102 CONVERT_ARG_CHECKED(Object, y, 1);
103 return isolate->heap()->ToBoolean(x->StrictEquals(y)); 103 return isolate->heap()->ToBoolean(x->StrictEquals(y));
104 } 104 }
105 105
106 106
107 RUNTIME_FUNCTION(Runtime_InterpreterStrictNotEquals) { 107 RUNTIME_FUNCTION(Runtime_InterpreterStrictNotEquals) {
108 SealHandleScope scope(isolate); 108 SealHandleScope shs(isolate);
109 DCHECK_EQ(2, args.length()); 109 DCHECK_EQ(2, args.length());
110 CONVERT_ARG_CHECKED(Object, x, 0); 110 CONVERT_ARG_CHECKED(Object, x, 0);
111 CONVERT_ARG_CHECKED(Object, y, 1); 111 CONVERT_ARG_CHECKED(Object, y, 1);
112 return isolate->heap()->ToBoolean(!x->StrictEquals(y)); 112 return isolate->heap()->ToBoolean(!x->StrictEquals(y));
113 } 113 }
114 114
115 115
116 RUNTIME_FUNCTION(Runtime_InterpreterToBoolean) { 116 RUNTIME_FUNCTION(Runtime_InterpreterToBoolean) {
117 SealHandleScope scope(isolate); 117 SealHandleScope shs(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 SealHandleScope shs(isolate);
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 SealHandleScope shs(isolate);
134 DCHECK_EQ(1, args.length());
135 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0);
136 return Object::cast(*Object::TypeOf(isolate, x));
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