| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
| (...skipping 12336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12347 if_fast_packed.Or(); | 12347 if_fast_packed.Or(); |
| 12348 if_fast_packed.If<HCompareNumericAndBranch>( | 12348 if_fast_packed.If<HCompareNumericAndBranch>( |
| 12349 elements_kind, Add<HConstant>(FAST_DOUBLE_ELEMENTS), Token::EQ); | 12349 elements_kind, Add<HConstant>(FAST_DOUBLE_ELEMENTS), Token::EQ); |
| 12350 if_fast_packed.JoinContinuation(&continuation); | 12350 if_fast_packed.JoinContinuation(&continuation); |
| 12351 } | 12351 } |
| 12352 if_not_smi.JoinContinuation(&continuation); | 12352 if_not_smi.JoinContinuation(&continuation); |
| 12353 return ast_context()->ReturnContinuation(&continuation, call->id()); | 12353 return ast_context()->ReturnContinuation(&continuation, call->id()); |
| 12354 } | 12354 } |
| 12355 | 12355 |
| 12356 | 12356 |
| 12357 // Support for construct call checks. | |
| 12358 void HOptimizedGraphBuilder::GenerateIsConstructCall(CallRuntime* call) { | |
| 12359 DCHECK(call->arguments()->length() == 0); | |
| 12360 if (function_state()->outer() != NULL) { | |
| 12361 // We are generating graph for inlined function. | |
| 12362 HValue* value = function_state()->inlining_kind() == CONSTRUCT_CALL_RETURN | |
| 12363 ? graph()->GetConstantTrue() | |
| 12364 : graph()->GetConstantFalse(); | |
| 12365 return ast_context()->ReturnValue(value); | |
| 12366 } else { | |
| 12367 return ast_context()->ReturnControl(New<HIsConstructCallAndBranch>(), | |
| 12368 call->id()); | |
| 12369 } | |
| 12370 } | |
| 12371 | |
| 12372 | |
| 12373 // Support for arguments.length and arguments[?]. | 12357 // Support for arguments.length and arguments[?]. |
| 12374 void HOptimizedGraphBuilder::GenerateArgumentsLength(CallRuntime* call) { | 12358 void HOptimizedGraphBuilder::GenerateArgumentsLength(CallRuntime* call) { |
| 12375 DCHECK(call->arguments()->length() == 0); | 12359 DCHECK(call->arguments()->length() == 0); |
| 12376 HInstruction* result = NULL; | 12360 HInstruction* result = NULL; |
| 12377 if (function_state()->outer() == NULL) { | 12361 if (function_state()->outer() == NULL) { |
| 12378 HInstruction* elements = Add<HArgumentsElements>(false); | 12362 HInstruction* elements = Add<HArgumentsElements>(false); |
| 12379 result = New<HArgumentsLength>(elements); | 12363 result = New<HArgumentsLength>(elements); |
| 12380 } else { | 12364 } else { |
| 12381 // Number of arguments without receiver. | 12365 // Number of arguments without receiver. |
| 12382 int argument_count = environment()-> | 12366 int argument_count = environment()-> |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13627 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13611 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13628 } | 13612 } |
| 13629 | 13613 |
| 13630 #ifdef DEBUG | 13614 #ifdef DEBUG |
| 13631 graph_->Verify(false); // No full verify. | 13615 graph_->Verify(false); // No full verify. |
| 13632 #endif | 13616 #endif |
| 13633 } | 13617 } |
| 13634 | 13618 |
| 13635 } // namespace internal | 13619 } // namespace internal |
| 13636 } // namespace v8 | 13620 } // namespace v8 |
| OLD | NEW |