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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // o fp: our caller's frame pointer | 98 // o fp: our caller's frame pointer |
99 // o sp: stack pointer | 99 // o sp: stack pointer |
100 // o lr: return address | 100 // o lr: return address |
101 // | 101 // |
102 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 102 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
103 // frames-arm.h for its layout. | 103 // frames-arm.h for its layout. |
104 void FullCodeGenerator::Generate() { | 104 void FullCodeGenerator::Generate() { |
105 CompilationInfo* info = info_; | 105 CompilationInfo* info = info_; |
106 profiling_counter_ = isolate()->factory()->NewCell( | 106 profiling_counter_ = isolate()->factory()->NewCell( |
107 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 107 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
108 SetFunctionPosition(function()); | 108 SetFunctionPosition(literal()); |
109 Comment cmnt(masm_, "[ function compiled by full code generator"); | 109 Comment cmnt(masm_, "[ function compiled by full code generator"); |
110 | 110 |
111 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 111 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
112 | 112 |
113 #ifdef DEBUG | 113 #ifdef DEBUG |
114 if (strlen(FLAG_stop_at) > 0 && | 114 if (strlen(FLAG_stop_at) > 0 && |
115 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 115 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
116 __ stop("stop-at"); | 116 __ stop("stop-at"); |
117 } | 117 } |
118 #endif | 118 #endif |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 __ mov(r1, Operand(Smi::FromInt(num_parameters))); | 311 __ mov(r1, Operand(Smi::FromInt(num_parameters))); |
312 __ Push(r3, r2, r1); | 312 __ Push(r3, r2, r1); |
313 | 313 |
314 // Arguments to ArgumentsAccessStub: | 314 // Arguments to ArgumentsAccessStub: |
315 // function, receiver address, parameter count. | 315 // function, receiver address, parameter count. |
316 // The stub will rewrite receiver and parameter count if the previous | 316 // The stub will rewrite receiver and parameter count if the previous |
317 // stack frame was an arguments adapter frame. | 317 // stack frame was an arguments adapter frame. |
318 ArgumentsAccessStub::Type type; | 318 ArgumentsAccessStub::Type type; |
319 if (is_strict(language_mode()) || !has_simple_parameters()) { | 319 if (is_strict(language_mode()) || !has_simple_parameters()) { |
320 type = ArgumentsAccessStub::NEW_STRICT; | 320 type = ArgumentsAccessStub::NEW_STRICT; |
321 } else if (function()->has_duplicate_parameters()) { | 321 } else if (literal()->has_duplicate_parameters()) { |
322 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | 322 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
323 } else { | 323 } else { |
324 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | 324 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
325 } | 325 } |
326 ArgumentsAccessStub stub(isolate(), type); | 326 ArgumentsAccessStub stub(isolate(), type); |
327 __ CallStub(&stub); | 327 __ CallStub(&stub); |
328 | 328 |
329 SetVar(arguments, r0, r1, r2); | 329 SetVar(arguments, r0, r1, r2); |
330 } | 330 } |
331 | 331 |
(...skipping 28 matching lines...) Expand all Loading... |
360 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); | 360 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); |
361 PredictableCodeSizeScope predictable(masm_); | 361 PredictableCodeSizeScope predictable(masm_); |
362 predictable.ExpectSize( | 362 predictable.ExpectSize( |
363 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); | 363 masm_->CallSize(stack_check, RelocInfo::CODE_TARGET)); |
364 __ Call(stack_check, RelocInfo::CODE_TARGET); | 364 __ Call(stack_check, RelocInfo::CODE_TARGET); |
365 __ bind(&ok); | 365 __ bind(&ok); |
366 } | 366 } |
367 | 367 |
368 { Comment cmnt(masm_, "[ Body"); | 368 { Comment cmnt(masm_, "[ Body"); |
369 DCHECK(loop_depth() == 0); | 369 DCHECK(loop_depth() == 0); |
370 VisitStatements(function()->body()); | 370 VisitStatements(literal()->body()); |
371 DCHECK(loop_depth() == 0); | 371 DCHECK(loop_depth() == 0); |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 // Always emit a 'return undefined' in case control fell off the end of | 375 // Always emit a 'return undefined' in case control fell off the end of |
376 // the body. | 376 // the body. |
377 { Comment cmnt(masm_, "[ return <undefined>;"); | 377 { Comment cmnt(masm_, "[ return <undefined>;"); |
378 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 378 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
379 } | 379 } |
380 EmitReturnSequence(); | 380 EmitReturnSequence(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 RelocInfo::CODE_TARGET); | 487 RelocInfo::CODE_TARGET); |
488 __ pop(r0); | 488 __ pop(r0); |
489 EmitProfilingCounterReset(); | 489 EmitProfilingCounterReset(); |
490 __ bind(&ok); | 490 __ bind(&ok); |
491 | 491 |
492 // Make sure that the constant pool is not emitted inside of the return | 492 // Make sure that the constant pool is not emitted inside of the return |
493 // sequence. | 493 // sequence. |
494 { Assembler::BlockConstPoolScope block_const_pool(masm_); | 494 { Assembler::BlockConstPoolScope block_const_pool(masm_); |
495 int32_t arg_count = info_->scope()->num_parameters() + 1; | 495 int32_t arg_count = info_->scope()->num_parameters() + 1; |
496 int32_t sp_delta = arg_count * kPointerSize; | 496 int32_t sp_delta = arg_count * kPointerSize; |
497 SetReturnPosition(function()); | 497 SetReturnPosition(literal()); |
498 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! | 498 // TODO(svenpanne) The code below is sometimes 4 words, sometimes 5! |
499 PredictableCodeSizeScope predictable(masm_, -1); | 499 PredictableCodeSizeScope predictable(masm_, -1); |
500 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 500 int no_frame_start = __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
501 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); | 501 { ConstantPoolUnavailableScope constant_pool_unavailable(masm_); |
502 __ add(sp, sp, Operand(sp_delta)); | 502 __ add(sp, sp, Operand(sp_delta)); |
503 __ Jump(lr); | 503 __ Jump(lr); |
504 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 504 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
505 } | 505 } |
506 } | 506 } |
507 } | 507 } |
(...skipping 4906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5414 DCHECK(interrupt_address == | 5414 DCHECK(interrupt_address == |
5415 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5415 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5416 return OSR_AFTER_STACK_CHECK; | 5416 return OSR_AFTER_STACK_CHECK; |
5417 } | 5417 } |
5418 | 5418 |
5419 | 5419 |
5420 } // namespace internal | 5420 } // namespace internal |
5421 } // namespace v8 | 5421 } // namespace v8 |
5422 | 5422 |
5423 #endif // V8_TARGET_ARCH_ARM | 5423 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |