OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3356 &if_true, &if_false, &fall_through); | 3356 &if_true, &if_false, &fall_through); |
3357 | 3357 |
3358 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3358 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3359 __ NonNegativeSmiTst(v0, at); | 3359 __ NonNegativeSmiTst(v0, at); |
3360 Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through); | 3360 Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through); |
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, | |
3377 &if_true, &if_false, &fall_through); | |
3378 | |
3379 __ JumpIfSmi(v0, if_false); | |
3380 __ LoadRoot(at, Heap::kNullValueRootIndex); | |
3381 __ Branch(if_true, eq, v0, Operand(at)); | |
3382 __ ld(a2, FieldMemOperand(v0, HeapObject::kMapOffset)); | |
3383 // Undetectable objects behave like undefined when tested with typeof. | |
3384 __ lbu(a1, FieldMemOperand(a2, Map::kBitFieldOffset)); | |
3385 __ And(at, a1, Operand(1 << Map::kIsUndetectable)); | |
3386 __ Branch(if_false, ne, at, Operand(zero_reg)); | |
3387 __ lbu(a1, FieldMemOperand(a2, Map::kInstanceTypeOffset)); | |
3388 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
3389 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3390 Split(le, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE), | |
3391 if_true, if_false, fall_through); | |
3392 | |
3393 context()->Plug(if_true, if_false); | |
3394 } | |
3395 | |
3396 | |
3397 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { | 3366 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
3398 ZoneList<Expression*>* args = expr->arguments(); | 3367 ZoneList<Expression*>* args = expr->arguments(); |
3399 DCHECK(args->length() == 1); | 3368 DCHECK(args->length() == 1); |
3400 | 3369 |
3401 VisitForAccumulatorValue(args->at(0)); | 3370 VisitForAccumulatorValue(args->at(0)); |
3402 | 3371 |
3403 Label materialize_true, materialize_false; | 3372 Label materialize_true, materialize_false; |
3404 Label* if_true = NULL; | 3373 Label* if_true = NULL; |
3405 Label* if_false = NULL; | 3374 Label* if_false = NULL; |
3406 Label* fall_through = NULL; | 3375 Label* fall_through = NULL; |
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5384 reinterpret_cast<uint64_t>( | 5353 reinterpret_cast<uint64_t>( |
5385 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5354 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5386 return OSR_AFTER_STACK_CHECK; | 5355 return OSR_AFTER_STACK_CHECK; |
5387 } | 5356 } |
5388 | 5357 |
5389 | 5358 |
5390 } // namespace internal | 5359 } // namespace internal |
5391 } // namespace v8 | 5360 } // namespace v8 |
5392 | 5361 |
5393 #endif // V8_TARGET_ARCH_MIPS64 | 5362 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |