Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 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 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 } else { | 215 } else { |
| 216 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 216 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 217 } | 217 } |
| 218 // The receiver is just before the parameters on the caller's stack. | 218 // The receiver is just before the parameters on the caller's stack. |
| 219 int num_parameters = info->scope()->num_parameters(); | 219 int num_parameters = info->scope()->num_parameters(); |
| 220 int offset = num_parameters * kPointerSize; | 220 int offset = num_parameters * kPointerSize; |
| 221 __ lea(rdx, | 221 __ lea(rdx, |
| 222 Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); | 222 Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); |
| 223 __ push(rdx); | 223 __ push(rdx); |
| 224 __ Push(Smi::FromInt(num_parameters)); | 224 __ Push(Smi::FromInt(num_parameters)); |
| 225 // Arguments to ArgumentsAccessStub: | 225 // Arguments to ArgumentsAccessStub and/or New...: |
|
fschneider
2012/01/16 14:25:07
What's "New..."? I think the comment was fine as i
| |
| 226 // function, receiver address, parameter count. | 226 // function, receiver address, parameter count. |
| 227 // The stub will rewrite receiver and parameter count if the previous | 227 // The stub will rewrite receiver and parameter count if the previous |
| 228 // stack frame was an arguments adapter frame. | 228 // stack frame was an arguments adapter frame. |
| 229 ArgumentsAccessStub stub( | 229 ArgumentsAccessStub::Type type; |
| 230 is_classic_mode() ? ArgumentsAccessStub::NEW_NON_STRICT_SLOW | 230 if (!is_classic_mode()) { |
| 231 : ArgumentsAccessStub::NEW_STRICT); | 231 type = ArgumentsAccessStub::NEW_STRICT; |
| 232 } else if (function()->has_duplicate_parameters()) { | |
| 233 type = ArgumentsAccessStub::NEW_NON_STRICT_SLOW; | |
| 234 } else { | |
| 235 type = ArgumentsAccessStub::NEW_NON_STRICT_FAST; | |
| 236 } | |
| 237 ArgumentsAccessStub stub(type); | |
| 232 __ CallStub(&stub); | 238 __ CallStub(&stub); |
| 233 | 239 |
| 234 SetVar(arguments, rax, rbx, rdx); | 240 SetVar(arguments, rax, rbx, rdx); |
| 235 } | 241 } |
| 236 | 242 |
| 237 if (FLAG_trace) { | 243 if (FLAG_trace) { |
| 238 __ CallRuntime(Runtime::kTraceEnter, 0); | 244 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 239 } | 245 } |
| 240 | 246 |
| 241 // Visit the declarations and body unless there is an illegal | 247 // Visit the declarations and body unless there is an illegal |
| (...skipping 4104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4346 *context_length = 0; | 4352 *context_length = 0; |
| 4347 return previous_; | 4353 return previous_; |
| 4348 } | 4354 } |
| 4349 | 4355 |
| 4350 | 4356 |
| 4351 #undef __ | 4357 #undef __ |
| 4352 | 4358 |
| 4353 } } // namespace v8::internal | 4359 } } // namespace v8::internal |
| 4354 | 4360 |
| 4355 #endif // V8_TARGET_ARCH_X64 | 4361 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |