OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 3321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3332 Label* if_false = NULL; | 3332 Label* if_false = NULL; |
3333 Label* fall_through = NULL; | 3333 Label* fall_through = NULL; |
3334 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3334 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3335 &if_false, &fall_through); | 3335 &if_false, &fall_through); |
3336 | 3336 |
3337 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3337 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3338 __ TestIfSmi(r3, r0); | 3338 __ TestIfSmi(r3, r0); |
3339 Split(eq, if_true, if_false, fall_through, cr0); | 3339 Split(eq, if_true, if_false, fall_through, cr0); |
3340 | 3340 |
3341 context()->Plug(if_true, if_false); | 3341 context()->Plug(if_true, if_false); |
| 3342 } |
| 3343 |
| 3344 |
| 3345 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { |
| 3346 ZoneList<Expression*>* args = expr->arguments(); |
| 3347 DCHECK(args->length() == 1); |
| 3348 |
| 3349 VisitForAccumulatorValue(args->at(0)); |
| 3350 |
| 3351 Label materialize_true, materialize_false; |
| 3352 Label* if_true = NULL; |
| 3353 Label* if_false = NULL; |
| 3354 Label* fall_through = NULL; |
| 3355 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3356 &if_false, &fall_through); |
| 3357 |
| 3358 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3359 __ TestIfPositiveSmi(r3, r0); |
| 3360 Split(eq, if_true, if_false, fall_through, cr0); |
| 3361 |
| 3362 context()->Plug(if_true, if_false); |
3342 } | 3363 } |
3343 | 3364 |
3344 | 3365 |
3345 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 3366 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
3346 ZoneList<Expression*>* args = expr->arguments(); | 3367 ZoneList<Expression*>* args = expr->arguments(); |
3347 DCHECK(args->length() == 1); | 3368 DCHECK(args->length() == 1); |
3348 | 3369 |
3349 VisitForAccumulatorValue(args->at(0)); | 3370 VisitForAccumulatorValue(args->at(0)); |
3350 | 3371 |
3351 Label materialize_true, materialize_false; | 3372 Label materialize_true, materialize_false; |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5104 Label* if_false = NULL; | 5125 Label* if_false = NULL; |
5105 Label* fall_through = NULL; | 5126 Label* fall_through = NULL; |
5106 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 5127 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
5107 &if_false, &fall_through); | 5128 &if_false, &fall_through); |
5108 | 5129 |
5109 Token::Value op = expr->op(); | 5130 Token::Value op = expr->op(); |
5110 VisitForStackValue(expr->left()); | 5131 VisitForStackValue(expr->left()); |
5111 switch (op) { | 5132 switch (op) { |
5112 case Token::IN: | 5133 case Token::IN: |
5113 VisitForStackValue(expr->right()); | 5134 VisitForStackValue(expr->right()); |
5114 __ CallRuntime(Runtime::kHasProperty, 2); | 5135 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); |
5115 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5136 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
5116 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 5137 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
5117 __ cmp(r3, ip); | 5138 __ cmp(r3, ip); |
5118 Split(eq, if_true, if_false, fall_through); | 5139 Split(eq, if_true, if_false, fall_through); |
5119 break; | 5140 break; |
5120 | 5141 |
5121 case Token::INSTANCEOF: { | 5142 case Token::INSTANCEOF: { |
5122 VisitForStackValue(expr->right()); | 5143 VisitForStackValue(expr->right()); |
5123 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 5144 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); |
5124 __ CallStub(&stub); | 5145 __ CallStub(&stub); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5368 return ON_STACK_REPLACEMENT; | 5389 return ON_STACK_REPLACEMENT; |
5369 } | 5390 } |
5370 | 5391 |
5371 DCHECK(interrupt_address == | 5392 DCHECK(interrupt_address == |
5372 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5373 return OSR_AFTER_STACK_CHECK; | 5394 return OSR_AFTER_STACK_CHECK; |
5374 } | 5395 } |
5375 } // namespace internal | 5396 } // namespace internal |
5376 } // namespace v8 | 5397 } // namespace v8 |
5377 #endif // V8_TARGET_ARCH_PPC | 5398 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |