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

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

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug-mode Arm issue. Created 5 years, 6 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/arm/frames-arm.cc ('k') | src/arm/lithium-codegen-arm.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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 90
91 // Generate code for a JS function. On entry to the function the receiver 91 // Generate code for a JS function. On entry to the function the receiver
92 // and arguments have been pushed on the stack left to right. The actual 92 // and arguments have been pushed on the stack left to right. The actual
93 // argument count matches the formal parameter count expected by the 93 // argument count matches the formal parameter count expected by the
94 // function. 94 // function.
95 // 95 //
96 // The live registers are: 96 // The live registers are:
97 // o r1: the JS function object being called (i.e., ourselves) 97 // o r1: the JS function object being called (i.e., ourselves)
98 // o cp: our context 98 // o cp: our context
99 // o pp: our caller's constant pool pointer (if FLAG_enable_ool_constant_pool) 99 // o pp: our caller's constant pool pointer (if enabled)
100 // o fp: our caller's frame pointer 100 // o fp: our caller's frame pointer
101 // o sp: stack pointer 101 // o sp: stack pointer
102 // o lr: return address 102 // o lr: return address
103 // 103 //
104 // The function builds a JS frame. Please see JavaScriptFrameConstants in 104 // The function builds a JS frame. Please see JavaScriptFrameConstants in
105 // frames-arm.h for its layout. 105 // frames-arm.h for its layout.
106 void FullCodeGenerator::Generate() { 106 void FullCodeGenerator::Generate() {
107 CompilationInfo* info = info_; 107 CompilationInfo* info = info_;
108 handler_table_ = 108 handler_table_ =
109 Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray( 109 Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray(
(...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 2312
2313 // Enter a new JavaScript frame, and initialize its slots as they were when 2313 // Enter a new JavaScript frame, and initialize its slots as they were when
2314 // the generator was suspended. 2314 // the generator was suspended.
2315 Label resume_frame, done; 2315 Label resume_frame, done;
2316 __ bind(&push_frame); 2316 __ bind(&push_frame);
2317 __ bl(&resume_frame); 2317 __ bl(&resume_frame);
2318 __ jmp(&done); 2318 __ jmp(&done);
2319 __ bind(&resume_frame); 2319 __ bind(&resume_frame);
2320 // lr = return address. 2320 // lr = return address.
2321 // fp = caller's frame pointer. 2321 // fp = caller's frame pointer.
2322 // pp = caller's constant pool (if FLAG_enable_ool_constant_pool), 2322 // pp = caller's constant pool (if FLAG_enable_embedded_constant_pool),
2323 // cp = callee's context, 2323 // cp = callee's context,
2324 // r4 = callee's JS function. 2324 // r4 = callee's JS function.
2325 __ PushFixedFrame(r4); 2325 __ PushFixedFrame(r4);
2326 // Adjust FP to point to saved FP. 2326 // Adjust FP to point to saved FP.
2327 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 2327 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
2328 2328
2329 // Load the operand stack size. 2329 // Load the operand stack size.
2330 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); 2330 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset));
2331 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); 2331 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset));
2332 __ SmiUntag(r3); 2332 __ SmiUntag(r3);
2333 2333
2334 // If we are sending a value and there is no operand stack, we can jump back 2334 // If we are sending a value and there is no operand stack, we can jump back
2335 // in directly. 2335 // in directly.
2336 if (resume_mode == JSGeneratorObject::NEXT) { 2336 if (resume_mode == JSGeneratorObject::NEXT) {
2337 Label slow_resume; 2337 Label slow_resume;
2338 __ cmp(r3, Operand(0)); 2338 __ cmp(r3, Operand(0));
2339 __ b(ne, &slow_resume); 2339 __ b(ne, &slow_resume);
2340 __ ldr(r3, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); 2340 __ ldr(r3, FieldMemOperand(r4, JSFunction::kCodeEntryOffset));
2341 2341
2342 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); 2342 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_);
2343 if (FLAG_enable_ool_constant_pool) { 2343 if (FLAG_enable_embedded_constant_pool) {
2344 // Load the new code object's constant pool pointer. 2344 // Load the new code object's constant pool pointer.
2345 __ ldr(pp, 2345 __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r3);
2346 MemOperand(r3, Code::kConstantPoolOffset - Code::kHeaderSize));
2347 } 2346 }
2348 2347
2349 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); 2348 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset));
2350 __ SmiUntag(r2); 2349 __ SmiUntag(r2);
2351 __ add(r3, r3, r2); 2350 __ add(r3, r3, r2);
2352 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); 2351 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)));
2353 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); 2352 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset));
2354 __ Jump(r3); 2353 __ Jump(r3);
2355 } 2354 }
2356 __ bind(&slow_resume); 2355 __ bind(&slow_resume);
(...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after
5433 __ mov(VectorStoreICTrampolineDescriptor::SlotRegister(), 5432 __ mov(VectorStoreICTrampolineDescriptor::SlotRegister(),
5434 Operand(SmiFromSlot(slot))); 5433 Operand(SmiFromSlot(slot)));
5435 } 5434 }
5436 5435
5437 5436
5438 #undef __ 5437 #undef __
5439 5438
5440 5439
5441 static Address GetInterruptImmediateLoadAddress(Address pc) { 5440 static Address GetInterruptImmediateLoadAddress(Address pc) {
5442 Address load_address = pc - 2 * Assembler::kInstrSize; 5441 Address load_address = pc - 2 * Assembler::kInstrSize;
5443 if (!FLAG_enable_ool_constant_pool) { 5442 if (!FLAG_enable_embedded_constant_pool) {
5444 DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(load_address))); 5443 DCHECK(Assembler::IsLdrPcImmediateOffset(Memory::int32_at(load_address)));
5445 } else if (Assembler::IsLdrPpRegOffset(Memory::int32_at(load_address))) { 5444 } else if (Assembler::IsLdrPpRegOffset(Memory::int32_at(load_address))) {
5446 // This is an extended constant pool lookup. 5445 // This is an extended constant pool lookup.
5447 if (CpuFeatures::IsSupported(ARMv7)) { 5446 if (CpuFeatures::IsSupported(ARMv7)) {
5448 load_address -= 2 * Assembler::kInstrSize; 5447 load_address -= 2 * Assembler::kInstrSize;
5449 DCHECK(Assembler::IsMovW(Memory::int32_at(load_address))); 5448 DCHECK(Assembler::IsMovW(Memory::int32_at(load_address)));
5450 DCHECK(Assembler::IsMovT( 5449 DCHECK(Assembler::IsMovT(
5451 Memory::int32_at(load_address + Assembler::kInstrSize))); 5450 Memory::int32_at(load_address + Assembler::kInstrSize)));
5452 } else { 5451 } else {
5453 load_address -= 4 * Assembler::kInstrSize; 5452 load_address -= 4 * Assembler::kInstrSize;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5574 DCHECK(interrupt_address == 5573 DCHECK(interrupt_address ==
5575 isolate->builtins()->OsrAfterStackCheck()->entry()); 5574 isolate->builtins()->OsrAfterStackCheck()->entry());
5576 return OSR_AFTER_STACK_CHECK; 5575 return OSR_AFTER_STACK_CHECK;
5577 } 5576 }
5578 5577
5579 5578
5580 } // namespace internal 5579 } // namespace internal
5581 } // namespace v8 5580 } // namespace v8
5582 5581
5583 #endif // V8_TARGET_ARCH_ARM 5582 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/frames-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698