Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils-gen.h" | 5 #include "src/builtins/builtins-utils-gen.h" |
| 6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
| 9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 Label return_true(this), return_false(this); | 242 Label return_true(this), return_false(this); |
| 243 BranchIfToBooleanIsTrue(value, &return_true, &return_false); | 243 BranchIfToBooleanIsTrue(value, &return_true, &return_false); |
| 244 | 244 |
| 245 BIND(&return_true); | 245 BIND(&return_true); |
| 246 Return(BooleanConstant(true)); | 246 Return(BooleanConstant(true)); |
| 247 | 247 |
| 248 BIND(&return_false); | 248 BIND(&return_false); |
| 249 Return(BooleanConstant(false)); | 249 Return(BooleanConstant(false)); |
| 250 } | 250 } |
| 251 | 251 |
| 252 // ES6 section 7.1.2 ToBoolean ( argument ) | |
| 253 // Requires parameter on stack to that it can be used as a continuation from a | |
| 254 // LAZY deopt. | |
| 255 TF_BUILTIN(ToBooleanLazyDeoptContinuation, CodeStubAssembler) { | |
|
Benedikt Meurer
2017/05/18 06:32:52
That should be in a separate follow-up CL.
danno
2017/05/22 10:28:10
Done.
| |
| 256 Node* value = Parameter(Descriptor::kArgument); | |
| 257 | |
| 258 Label return_true(this), return_false(this); | |
| 259 BranchIfToBooleanIsTrue(value, &return_true, &return_false); | |
| 260 | |
| 261 BIND(&return_true); | |
| 262 Return(BooleanConstant(true)); | |
| 263 | |
| 264 BIND(&return_false); | |
| 265 Return(BooleanConstant(false)); | |
| 266 } | |
| 267 | |
| 252 TF_BUILTIN(ToLength, CodeStubAssembler) { | 268 TF_BUILTIN(ToLength, CodeStubAssembler) { |
| 253 Node* context = Parameter(Descriptor::kContext); | 269 Node* context = Parameter(Descriptor::kContext); |
| 254 | 270 |
| 255 // We might need to loop once for ToNumber conversion. | 271 // We might need to loop once for ToNumber conversion. |
| 256 VARIABLE(var_len, MachineRepresentation::kTagged, | 272 VARIABLE(var_len, MachineRepresentation::kTagged, |
| 257 Parameter(Descriptor::kArgument)); | 273 Parameter(Descriptor::kArgument)); |
| 258 Label loop(this, &var_len); | 274 Label loop(this, &var_len); |
| 259 Goto(&loop); | 275 Goto(&loop); |
| 260 BIND(&loop); | 276 BIND(&loop); |
| 261 { | 277 { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 | 406 |
| 391 // ES6 section 12.5.5 typeof operator | 407 // ES6 section 12.5.5 typeof operator |
| 392 TF_BUILTIN(Typeof, CodeStubAssembler) { | 408 TF_BUILTIN(Typeof, CodeStubAssembler) { |
| 393 Node* object = Parameter(TypeofDescriptor::kObject); | 409 Node* object = Parameter(TypeofDescriptor::kObject); |
| 394 | 410 |
| 395 Return(Typeof(object)); | 411 Return(Typeof(object)); |
| 396 } | 412 } |
| 397 | 413 |
| 398 } // namespace internal | 414 } // namespace internal |
| 399 } // namespace v8 | 415 } // namespace v8 |
| OLD | NEW |