| 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 3324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } | 3342 } |
| 3343 | 3343 |
| 3344 | 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); | |
| 3363 } | |
| 3364 | |
| 3365 | |
| 3366 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 3345 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
| 3367 ZoneList<Expression*>* args = expr->arguments(); | 3346 ZoneList<Expression*>* args = expr->arguments(); |
| 3368 DCHECK(args->length() == 1); | 3347 DCHECK(args->length() == 1); |
| 3369 | 3348 |
| 3370 VisitForAccumulatorValue(args->at(0)); | 3349 VisitForAccumulatorValue(args->at(0)); |
| 3371 | 3350 |
| 3372 Label materialize_true, materialize_false; | 3351 Label materialize_true, materialize_false; |
| 3373 Label* if_true = NULL; | 3352 Label* if_true = NULL; |
| 3374 Label* if_false = NULL; | 3353 Label* if_false = NULL; |
| 3375 Label* fall_through = NULL; | 3354 Label* fall_through = NULL; |
| (...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5125 Label* if_false = NULL; | 5104 Label* if_false = NULL; |
| 5126 Label* fall_through = NULL; | 5105 Label* fall_through = NULL; |
| 5127 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 5106 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 5128 &if_false, &fall_through); | 5107 &if_false, &fall_through); |
| 5129 | 5108 |
| 5130 Token::Value op = expr->op(); | 5109 Token::Value op = expr->op(); |
| 5131 VisitForStackValue(expr->left()); | 5110 VisitForStackValue(expr->left()); |
| 5132 switch (op) { | 5111 switch (op) { |
| 5133 case Token::IN: | 5112 case Token::IN: |
| 5134 VisitForStackValue(expr->right()); | 5113 VisitForStackValue(expr->right()); |
| 5135 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION); | 5114 __ CallRuntime(Runtime::kHasProperty, 2); |
| 5136 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); | 5115 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); |
| 5137 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 5116 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 5138 __ cmp(r3, ip); | 5117 __ cmp(r3, ip); |
| 5139 Split(eq, if_true, if_false, fall_through); | 5118 Split(eq, if_true, if_false, fall_through); |
| 5140 break; | 5119 break; |
| 5141 | 5120 |
| 5142 case Token::INSTANCEOF: { | 5121 case Token::INSTANCEOF: { |
| 5143 VisitForStackValue(expr->right()); | 5122 VisitForStackValue(expr->right()); |
| 5144 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); | 5123 InstanceofStub stub(isolate(), InstanceofStub::kNoFlags); |
| 5145 __ CallStub(&stub); | 5124 __ CallStub(&stub); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5389 return ON_STACK_REPLACEMENT; | 5368 return ON_STACK_REPLACEMENT; |
| 5390 } | 5369 } |
| 5391 | 5370 |
| 5392 DCHECK(interrupt_address == | 5371 DCHECK(interrupt_address == |
| 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5372 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5394 return OSR_AFTER_STACK_CHECK; | 5373 return OSR_AFTER_STACK_CHECK; |
| 5395 } | 5374 } |
| 5396 } // namespace internal | 5375 } // namespace internal |
| 5397 } // namespace v8 | 5376 } // namespace v8 |
| 5398 #endif // V8_TARGET_ARCH_PPC | 5377 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |