Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/ppc/full-codegen-ppc.cc

Issue 965823002: Contribution of PowerPC port (continuation of 422063005) - currency (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/frames-ppc.cc ('k') | src/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_PPC 7 #if V8_TARGET_ARCH_PPC
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 arg_count++; 460 arg_count++;
461 } 461 }
462 int32_t sp_delta = arg_count * kPointerSize; 462 int32_t sp_delta = arg_count * kPointerSize;
463 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); 463 CodeGenerator::RecordPositions(masm_, function()->end_position() - 1);
464 __ RecordJSReturn(); 464 __ RecordJSReturn();
465 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); 465 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta);
466 #if V8_TARGET_ARCH_PPC64 466 #if V8_TARGET_ARCH_PPC64
467 // With 64bit we may need nop() instructions to ensure we have 467 // With 64bit we may need nop() instructions to ensure we have
468 // enough space to SetDebugBreakAtReturn() 468 // enough space to SetDebugBreakAtReturn()
469 if (is_int16(sp_delta)) { 469 if (is_int16(sp_delta)) {
470 #if !V8_OOL_CONSTANT_POOL
471 masm_->nop(); 470 masm_->nop();
472 #endif
473 masm_->nop(); 471 masm_->nop();
474 } 472 }
475 #endif 473 #endif
476 __ blr(); 474 __ blr();
477 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); 475 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
478 } 476 }
479 477
480 #ifdef DEBUG 478 #ifdef DEBUG
481 // Check that the size of the code used for returning is large enough 479 // Check that the size of the code used for returning is large enough
482 // for the debugger's requirements. 480 // for the debugger's requirements.
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2287 __ LoadP(r6, FieldMemOperand(r6, FixedArray::kLengthOffset)); 2285 __ LoadP(r6, FieldMemOperand(r6, FixedArray::kLengthOffset));
2288 __ SmiUntag(r6, SetRC); 2286 __ SmiUntag(r6, SetRC);
2289 2287
2290 // If we are sending a value and there is no operand stack, we can jump back 2288 // If we are sending a value and there is no operand stack, we can jump back
2291 // in directly. 2289 // in directly.
2292 Label call_resume; 2290 Label call_resume;
2293 if (resume_mode == JSGeneratorObject::NEXT) { 2291 if (resume_mode == JSGeneratorObject::NEXT) {
2294 Label slow_resume; 2292 Label slow_resume;
2295 __ bne(&slow_resume, cr0); 2293 __ bne(&slow_resume, cr0);
2296 __ LoadP(ip, FieldMemOperand(r7, JSFunction::kCodeEntryOffset)); 2294 __ LoadP(ip, FieldMemOperand(r7, JSFunction::kCodeEntryOffset));
2297 #if V8_OOL_CONSTANT_POOL
2298 { 2295 {
2299 ConstantPoolUnavailableScope constant_pool_unavailable(masm_);
2300 // Load the new code object's constant pool pointer.
2301 __ LoadP(kConstantPoolRegister,
2302 MemOperand(ip, Code::kConstantPoolOffset - Code::kHeaderSize));
2303 #endif
2304 __ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset)); 2296 __ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset));
2305 __ SmiUntag(r5); 2297 __ SmiUntag(r5);
2306 __ add(ip, ip, r5); 2298 __ add(ip, ip, r5);
2307 __ LoadSmiLiteral(r5, 2299 __ LoadSmiLiteral(r5,
2308 Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); 2300 Smi::FromInt(JSGeneratorObject::kGeneratorExecuting));
2309 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset), 2301 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset),
2310 r0); 2302 r0);
2311 __ Jump(ip); 2303 __ Jump(ip);
2312 __ bind(&slow_resume); 2304 __ bind(&slow_resume);
2313 #if V8_OOL_CONSTANT_POOL
2314 } 2305 }
2315 #endif
2316 } else { 2306 } else {
2317 __ beq(&call_resume, cr0); 2307 __ beq(&call_resume, cr0);
2318 } 2308 }
2319 2309
2320 // Otherwise, we push holes for the operand stack and call the runtime to fix 2310 // Otherwise, we push holes for the operand stack and call the runtime to fix
2321 // up the stack and the handlers. 2311 // up the stack and the handlers.
2322 Label operand_loop; 2312 Label operand_loop;
2323 __ mtctr(r6); 2313 __ mtctr(r6);
2324 __ bind(&operand_loop); 2314 __ bind(&operand_loop);
2325 __ push(r5); 2315 __ push(r5);
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after
3776 FIRST_SPEC_OBJECT_TYPE + 1); 3766 FIRST_SPEC_OBJECT_TYPE + 1);
3777 __ beq(&function); 3767 __ beq(&function);
3778 3768
3779 __ cmpi(r4, Operand(LAST_SPEC_OBJECT_TYPE)); 3769 __ cmpi(r4, Operand(LAST_SPEC_OBJECT_TYPE));
3780 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_SPEC_OBJECT_TYPE - 1); 3770 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_SPEC_OBJECT_TYPE - 1);
3781 __ beq(&function); 3771 __ beq(&function);
3782 // Assume that there is no larger type. 3772 // Assume that there is no larger type.
3783 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE - 1); 3773 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE - 1);
3784 3774
3785 // Check if the constructor in the map is a JS function. 3775 // Check if the constructor in the map is a JS function.
3786 __ LoadP(r3, FieldMemOperand(r3, Map::kConstructorOffset)); 3776 Register instance_type = r5;
3787 __ CompareObjectType(r3, r4, r4, JS_FUNCTION_TYPE); 3777 __ GetMapConstructor(r3, r3, r4, instance_type);
3778 __ cmpi(instance_type, Operand(JS_FUNCTION_TYPE));
3788 __ bne(&non_function_constructor); 3779 __ bne(&non_function_constructor);
3789 3780
3790 // r3 now contains the constructor function. Grab the 3781 // r3 now contains the constructor function. Grab the
3791 // instance class name from there. 3782 // instance class name from there.
3792 __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); 3783 __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
3793 __ LoadP(r3, 3784 __ LoadP(r3,
3794 FieldMemOperand(r3, SharedFunctionInfo::kInstanceClassNameOffset)); 3785 FieldMemOperand(r3, SharedFunctionInfo::kInstanceClassNameOffset));
3795 __ b(&done); 3786 __ b(&done);
3796 3787
3797 // Functions have class 'Function'. 3788 // Functions have class 'Function'.
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
5444 return ON_STACK_REPLACEMENT; 5435 return ON_STACK_REPLACEMENT;
5445 } 5436 }
5446 5437
5447 DCHECK(interrupt_address == 5438 DCHECK(interrupt_address ==
5448 isolate->builtins()->OsrAfterStackCheck()->entry()); 5439 isolate->builtins()->OsrAfterStackCheck()->entry());
5449 return OSR_AFTER_STACK_CHECK; 5440 return OSR_AFTER_STACK_CHECK;
5450 } 5441 }
5451 } 5442 }
5452 } // namespace v8::internal 5443 } // namespace v8::internal
5453 #endif // V8_TARGET_ARCH_PPC 5444 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/frames-ppc.cc ('k') | src/ppc/lithium-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698