| 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-conversion-gen.h" | 5 #include "src/builtins/builtins-conversion-gen.h" | 
| 6 | 6 | 
| 7 #include "src/builtins/builtins-utils-gen.h" | 7 #include "src/builtins/builtins-utils-gen.h" | 
| 8 #include "src/builtins/builtins.h" | 8 #include "src/builtins/builtins.h" | 
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" | 
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" | 
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 249   Label return_true(this), return_false(this); | 249   Label return_true(this), return_false(this); | 
| 250   BranchIfToBooleanIsTrue(value, &return_true, &return_false); | 250   BranchIfToBooleanIsTrue(value, &return_true, &return_false); | 
| 251 | 251 | 
| 252   BIND(&return_true); | 252   BIND(&return_true); | 
| 253   Return(BooleanConstant(true)); | 253   Return(BooleanConstant(true)); | 
| 254 | 254 | 
| 255   BIND(&return_false); | 255   BIND(&return_false); | 
| 256   Return(BooleanConstant(false)); | 256   Return(BooleanConstant(false)); | 
| 257 } | 257 } | 
| 258 | 258 | 
|  | 259 // ES6 section 7.1.2 ToBoolean ( argument ) | 
|  | 260 // Requires parameter on stack so that it can be used as a continuation from a | 
|  | 261 // LAZY deopt. | 
|  | 262 TF_BUILTIN(ToBooleanLazyDeoptContinuation, CodeStubAssembler) { | 
|  | 263   Node* value = Parameter(Descriptor::kArgument); | 
|  | 264 | 
|  | 265   Label return_true(this), return_false(this); | 
|  | 266   BranchIfToBooleanIsTrue(value, &return_true, &return_false); | 
|  | 267 | 
|  | 268   BIND(&return_true); | 
|  | 269   Return(BooleanConstant(true)); | 
|  | 270 | 
|  | 271   BIND(&return_false); | 
|  | 272   Return(BooleanConstant(false)); | 
|  | 273 } | 
|  | 274 | 
| 259 TF_BUILTIN(ToLength, CodeStubAssembler) { | 275 TF_BUILTIN(ToLength, CodeStubAssembler) { | 
| 260   Node* context = Parameter(Descriptor::kContext); | 276   Node* context = Parameter(Descriptor::kContext); | 
| 261 | 277 | 
| 262   // We might need to loop once for ToNumber conversion. | 278   // We might need to loop once for ToNumber conversion. | 
| 263   VARIABLE(var_len, MachineRepresentation::kTagged, | 279   VARIABLE(var_len, MachineRepresentation::kTagged, | 
| 264            Parameter(Descriptor::kArgument)); | 280            Parameter(Descriptor::kArgument)); | 
| 265   Label loop(this, &var_len); | 281   Label loop(this, &var_len); | 
| 266   Goto(&loop); | 282   Goto(&loop); | 
| 267   BIND(&loop); | 283   BIND(&loop); | 
| 268   { | 284   { | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 397 | 413 | 
| 398 // ES6 section 12.5.5 typeof operator | 414 // ES6 section 12.5.5 typeof operator | 
| 399 TF_BUILTIN(Typeof, CodeStubAssembler) { | 415 TF_BUILTIN(Typeof, CodeStubAssembler) { | 
| 400   Node* object = Parameter(TypeofDescriptor::kObject); | 416   Node* object = Parameter(TypeofDescriptor::kObject); | 
| 401 | 417 | 
| 402   Return(Typeof(object)); | 418   Return(Typeof(object)); | 
| 403 } | 419 } | 
| 404 | 420 | 
| 405 }  // namespace internal | 421 }  // namespace internal | 
| 406 }  // namespace v8 | 422 }  // namespace v8 | 
| OLD | NEW | 
|---|