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 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3356 &if_false, &fall_through); | 3356 &if_false, &fall_through); |
3357 | 3357 |
3358 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3358 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3359 __ TestIfPositiveSmi(r3, r0); | 3359 __ TestIfPositiveSmi(r3, r0); |
3360 Split(eq, if_true, if_false, fall_through, cr0); | 3360 Split(eq, if_true, if_false, fall_through, cr0); |
3361 | 3361 |
3362 context()->Plug(if_true, if_false); | 3362 context()->Plug(if_true, if_false); |
3363 } | 3363 } |
3364 | 3364 |
3365 | 3365 |
3366 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | |
3367 ZoneList<Expression*>* args = expr->arguments(); | |
3368 DCHECK(args->length() == 1); | |
3369 | |
3370 VisitForAccumulatorValue(args->at(0)); | |
3371 | |
3372 Label materialize_true, materialize_false; | |
3373 Label* if_true = NULL; | |
3374 Label* if_false = NULL; | |
3375 Label* fall_through = NULL; | |
3376 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | |
3377 &if_false, &fall_through); | |
3378 | |
3379 __ JumpIfSmi(r3, if_false); | |
3380 __ LoadRoot(ip, Heap::kNullValueRootIndex); | |
3381 __ cmp(r3, ip); | |
3382 __ beq(if_true); | |
3383 __ LoadP(r5, FieldMemOperand(r3, HeapObject::kMapOffset)); | |
3384 // Undetectable objects behave like undefined when tested with typeof. | |
3385 __ lbz(r4, FieldMemOperand(r5, Map::kBitFieldOffset)); | |
3386 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | |
3387 __ bne(if_false, cr0); | |
3388 __ lbz(r4, FieldMemOperand(r5, Map::kInstanceTypeOffset)); | |
3389 __ cmpi(r4, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
3390 __ blt(if_false); | |
3391 __ cmpi(r4, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
3392 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3393 Split(le, if_true, if_false, fall_through); | |
3394 | |
3395 context()->Plug(if_true, if_false); | |
3396 } | |
3397 | |
3398 | |
3399 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { | 3366 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
3400 ZoneList<Expression*>* args = expr->arguments(); | 3367 ZoneList<Expression*>* args = expr->arguments(); |
3401 DCHECK(args->length() == 1); | 3368 DCHECK(args->length() == 1); |
3402 | 3369 |
3403 VisitForAccumulatorValue(args->at(0)); | 3370 VisitForAccumulatorValue(args->at(0)); |
3404 | 3371 |
3405 Label materialize_true, materialize_false; | 3372 Label materialize_true, materialize_false; |
3406 Label* if_true = NULL; | 3373 Label* if_true = NULL; |
3407 Label* if_false = NULL; | 3374 Label* if_false = NULL; |
3408 Label* fall_through = NULL; | 3375 Label* fall_through = NULL; |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5389 return ON_STACK_REPLACEMENT; | 5356 return ON_STACK_REPLACEMENT; |
5390 } | 5357 } |
5391 | 5358 |
5392 DCHECK(interrupt_address == | 5359 DCHECK(interrupt_address == |
5393 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5360 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5394 return OSR_AFTER_STACK_CHECK; | 5361 return OSR_AFTER_STACK_CHECK; |
5395 } | 5362 } |
5396 } // namespace internal | 5363 } // namespace internal |
5397 } // namespace v8 | 5364 } // namespace v8 |
5398 #endif // V8_TARGET_ARCH_PPC | 5365 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |