| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #include "code-stubs.h" | 32 #include "code-stubs.h" |
| 33 #include "codegen-inl.h" | 33 #include "codegen-inl.h" |
| 34 #include "compiler.h" | 34 #include "compiler.h" |
| 35 #include "debug.h" | 35 #include "debug.h" |
| 36 #include "full-codegen.h" | 36 #include "full-codegen.h" |
| 37 #include "parser.h" | 37 #include "parser.h" |
| 38 #include "scopes.h" | 38 #include "scopes.h" |
| 39 #include "stub-cache.h" | 39 #include "stub-cache.h" |
| 40 | 40 |
| 41 #include "arm/code-stubs-arm.h" |
| 42 |
| 41 namespace v8 { | 43 namespace v8 { |
| 42 namespace internal { | 44 namespace internal { |
| 43 | 45 |
| 44 #define __ ACCESS_MASM(masm_) | 46 #define __ ACCESS_MASM(masm_) |
| 45 | 47 |
| 46 // Generate code for a JS function. On entry to the function the receiver | 48 // Generate code for a JS function. On entry to the function the receiver |
| 47 // and arguments have been pushed on the stack left to right. The actual | 49 // and arguments have been pushed on the stack left to right. The actual |
| 48 // argument count matches the formal parameter count expected by the | 50 // argument count matches the formal parameter count expected by the |
| 49 // function. | 51 // function. |
| 50 // | 52 // |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 214 |
| 213 | 215 |
| 214 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) { | 216 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt) { |
| 215 Comment cmnt(masm_, "[ Stack check"); | 217 Comment cmnt(masm_, "[ Stack check"); |
| 216 Label ok; | 218 Label ok; |
| 217 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 219 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 218 __ cmp(sp, Operand(ip)); | 220 __ cmp(sp, Operand(ip)); |
| 219 __ b(hs, &ok); | 221 __ b(hs, &ok); |
| 220 StackCheckStub stub; | 222 StackCheckStub stub; |
| 221 __ CallStub(&stub); | 223 __ CallStub(&stub); |
| 224 // Record a mapping of this PC offset to the OSR id. This is used to find |
| 225 // the AST id from the unoptimized code in order to use it as a key into |
| 226 // the deoptimization input data found in the optimized code. |
| 227 RecordStackCheck(stmt->OsrEntryId()); |
| 228 |
| 222 __ bind(&ok); | 229 __ bind(&ok); |
| 223 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); | 230 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
| 231 // Record a mapping of the OSR id to this PC. This is used if the OSR |
| 232 // entry becomes the target of a bailout. We don't expect it to be, but |
| 233 // we want it to work if it is. |
| 224 PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS); | 234 PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS); |
| 225 RecordStackCheck(stmt->OsrEntryId()); | |
| 226 } | 235 } |
| 227 | 236 |
| 228 | 237 |
| 229 void FullCodeGenerator::EmitReturnSequence() { | 238 void FullCodeGenerator::EmitReturnSequence() { |
| 230 Comment cmnt(masm_, "[ Return sequence"); | 239 Comment cmnt(masm_, "[ Return sequence"); |
| 231 if (return_label_.is_bound()) { | 240 if (return_label_.is_bound()) { |
| 232 __ b(&return_label_); | 241 __ b(&return_label_); |
| 233 } else { | 242 } else { |
| 234 __ bind(&return_label_); | 243 __ bind(&return_label_); |
| 235 if (FLAG_trace) { | 244 if (FLAG_trace) { |
| (...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3619 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3628 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 3620 __ add(pc, r1, Operand(masm_->CodeObject())); | 3629 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 3621 } | 3630 } |
| 3622 | 3631 |
| 3623 | 3632 |
| 3624 #undef __ | 3633 #undef __ |
| 3625 | 3634 |
| 3626 } } // namespace v8::internal | 3635 } } // namespace v8::internal |
| 3627 | 3636 |
| 3628 #endif // V8_TARGET_ARCH_ARM | 3637 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |