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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 11342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11353 Handle<JSFunction> target = Handle<JSFunction>::cast(function); | 11353 Handle<JSFunction> target = Handle<JSFunction>::cast(function); |
11354 HInstanceOfKnownGlobal* result = | 11354 HInstanceOfKnownGlobal* result = |
11355 New<HInstanceOfKnownGlobal>(left, target); | 11355 New<HInstanceOfKnownGlobal>(left, target); |
11356 return ast_context()->ReturnInstruction(result, expr->id()); | 11356 return ast_context()->ReturnInstruction(result, expr->id()); |
11357 } | 11357 } |
11358 | 11358 |
11359 HInstanceOf* result = New<HInstanceOf>(left, right); | 11359 HInstanceOf* result = New<HInstanceOf>(left, right); |
11360 return ast_context()->ReturnInstruction(result, expr->id()); | 11360 return ast_context()->ReturnInstruction(result, expr->id()); |
11361 | 11361 |
11362 } else if (op == Token::IN) { | 11362 } else if (op == Token::IN) { |
| 11363 HValue* function = AddLoadJSBuiltin(Builtins::IN); |
11363 Add<HPushArguments>(left, right); | 11364 Add<HPushArguments>(left, right); |
11364 HInstruction* result = | 11365 // TODO(olivf) InvokeFunction produces a check for the parameter count, |
11365 New<HCallRuntime>(isolate()->factory()->empty_string(), | 11366 // even though we are certain to pass the correct number of arguments here. |
11366 Runtime::FunctionForId(Runtime::kHasProperty), 2); | 11367 HInstruction* result = New<HInvokeFunction>(function, 2); |
11367 return ast_context()->ReturnInstruction(result, expr->id()); | 11368 return ast_context()->ReturnInstruction(result, expr->id()); |
11368 } | 11369 } |
11369 | 11370 |
11370 PushBeforeSimulateBehavior push_behavior = | 11371 PushBeforeSimulateBehavior push_behavior = |
11371 ast_context()->IsEffect() ? NO_PUSH_BEFORE_SIMULATE | 11372 ast_context()->IsEffect() ? NO_PUSH_BEFORE_SIMULATE |
11372 : PUSH_BEFORE_SIMULATE; | 11373 : PUSH_BEFORE_SIMULATE; |
11373 HControlInstruction* compare = BuildCompareInstruction( | 11374 HControlInstruction* compare = BuildCompareInstruction( |
11374 op, left, right, left_type, right_type, combined_type, | 11375 op, left, right, left_type, right_type, combined_type, |
11375 ScriptPositionToSourcePosition(expr->left()->position()), | 11376 ScriptPositionToSourcePosition(expr->left()->position()), |
11376 ScriptPositionToSourcePosition(expr->right()->position()), | 11377 ScriptPositionToSourcePosition(expr->right()->position()), |
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13436 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13437 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13437 } | 13438 } |
13438 | 13439 |
13439 #ifdef DEBUG | 13440 #ifdef DEBUG |
13440 graph_->Verify(false); // No full verify. | 13441 graph_->Verify(false); // No full verify. |
13441 #endif | 13442 #endif |
13442 } | 13443 } |
13443 | 13444 |
13444 } // namespace internal | 13445 } // namespace internal |
13445 } // namespace v8 | 13446 } // namespace v8 |
OLD | NEW |