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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 void FullCodeGenerator::StackValueContext::Plug(Handle<Object> lit) const { | 507 void FullCodeGenerator::StackValueContext::Plug(Handle<Object> lit) const { |
508 // Immediates cannot be pushed directly. | 508 // Immediates cannot be pushed directly. |
509 __ mov(result_register(), Operand(lit)); | 509 __ mov(result_register(), Operand(lit)); |
510 __ push(result_register()); | 510 __ push(result_register()); |
511 } | 511 } |
512 | 512 |
513 | 513 |
514 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { | 514 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { |
515 codegen()->PrepareForBailoutBeforeSplit(condition(), true, true_label_, | 515 codegen()->PrepareForBailoutBeforeSplit(condition(), true, true_label_, |
516 false_label_); | 516 false_label_); |
517 DCHECK(!lit->IsUndetectableObject()); // There are no undetectable literals. | 517 DCHECK(lit->IsNull() || lit->IsUndefined() || !lit->IsUndetectableObject()); |
518 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { | 518 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { |
519 if (false_label_ != fall_through_) __ b(false_label_); | 519 if (false_label_ != fall_through_) __ b(false_label_); |
520 } else if (lit->IsTrue() || lit->IsJSObject()) { | 520 } else if (lit->IsTrue() || lit->IsJSObject()) { |
521 if (true_label_ != fall_through_) __ b(true_label_); | 521 if (true_label_ != fall_through_) __ b(true_label_); |
522 } else if (lit->IsString()) { | 522 } else if (lit->IsString()) { |
523 if (String::cast(*lit)->length() == 0) { | 523 if (String::cast(*lit)->length() == 0) { |
524 if (false_label_ != fall_through_) __ b(false_label_); | 524 if (false_label_ != fall_through_) __ b(false_label_); |
525 } else { | 525 } else { |
526 if (true_label_ != fall_through_) __ b(true_label_); | 526 if (true_label_ != fall_through_) __ b(true_label_); |
527 } | 527 } |
(...skipping 3760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4288 } else if (String::Equals(check, factory->symbol_string())) { | 4288 } else if (String::Equals(check, factory->symbol_string())) { |
4289 __ JumpIfSmi(r3, if_false); | 4289 __ JumpIfSmi(r3, if_false); |
4290 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); | 4290 __ CompareObjectType(r3, r3, r4, SYMBOL_TYPE); |
4291 Split(eq, if_true, if_false, fall_through); | 4291 Split(eq, if_true, if_false, fall_through); |
4292 } else if (String::Equals(check, factory->boolean_string())) { | 4292 } else if (String::Equals(check, factory->boolean_string())) { |
4293 __ CompareRoot(r3, Heap::kTrueValueRootIndex); | 4293 __ CompareRoot(r3, Heap::kTrueValueRootIndex); |
4294 __ beq(if_true); | 4294 __ beq(if_true); |
4295 __ CompareRoot(r3, Heap::kFalseValueRootIndex); | 4295 __ CompareRoot(r3, Heap::kFalseValueRootIndex); |
4296 Split(eq, if_true, if_false, fall_through); | 4296 Split(eq, if_true, if_false, fall_through); |
4297 } else if (String::Equals(check, factory->undefined_string())) { | 4297 } else if (String::Equals(check, factory->undefined_string())) { |
4298 __ CompareRoot(r3, Heap::kUndefinedValueRootIndex); | 4298 __ CompareRoot(r3, Heap::kNullValueRootIndex); |
4299 __ beq(if_true); | 4299 __ beq(if_false); |
4300 __ JumpIfSmi(r3, if_false); | 4300 __ JumpIfSmi(r3, if_false); |
4301 // Check for undetectable objects => true. | 4301 // Check for undetectable objects => true. |
4302 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 4302 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
4303 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); | 4303 __ lbz(r4, FieldMemOperand(r3, Map::kBitFieldOffset)); |
4304 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); | 4304 __ andi(r0, r4, Operand(1 << Map::kIsUndetectable)); |
4305 Split(ne, if_true, if_false, fall_through, cr0); | 4305 Split(ne, if_true, if_false, fall_through, cr0); |
4306 | 4306 |
4307 } else if (String::Equals(check, factory->function_string())) { | 4307 } else if (String::Equals(check, factory->function_string())) { |
4308 __ JumpIfSmi(r3, if_false); | 4308 __ JumpIfSmi(r3, if_false); |
4309 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 4309 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4623 return ON_STACK_REPLACEMENT; | 4623 return ON_STACK_REPLACEMENT; |
4624 } | 4624 } |
4625 | 4625 |
4626 DCHECK(interrupt_address == | 4626 DCHECK(interrupt_address == |
4627 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4627 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4628 return OSR_AFTER_STACK_CHECK; | 4628 return OSR_AFTER_STACK_CHECK; |
4629 } | 4629 } |
4630 } // namespace internal | 4630 } // namespace internal |
4631 } // namespace v8 | 4631 } // namespace v8 |
4632 #endif // V8_TARGET_ARCH_PPC | 4632 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |