OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 | 305 |
306 int JavaScriptFrame::ComputeParametersCount() const { | 306 int JavaScriptFrame::ComputeParametersCount() const { |
307 Address base = pp() + JavaScriptFrameConstants::kReceiverOffset; | 307 Address base = pp() + JavaScriptFrameConstants::kReceiverOffset; |
308 Address limit = fp() + JavaScriptFrameConstants::kSavedRegistersOffset; | 308 Address limit = fp() + JavaScriptFrameConstants::kSavedRegistersOffset; |
309 return (base - limit) / kPointerSize; | 309 return (base - limit) / kPointerSize; |
310 } | 310 } |
311 | 311 |
312 | 312 |
313 bool JavaScriptFrame::IsConstructor() const { | 313 bool JavaScriptFrame::IsConstructor() const { |
314 Address pc = has_adapted_arguments() | 314 Address fp = caller_fp(); |
315 ? Memory::Address_at(ComputePCAddress(caller_fp())) | 315 if (has_adapted_arguments()) { |
316 : caller_pc(); | 316 // Skip the arguments adaptor frame and look at the real caller. |
317 return IsConstructTrampolineFrame(pc); | 317 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); |
| 318 } |
| 319 return IsConstructFrame(fp); |
318 } | 320 } |
319 | 321 |
320 | 322 |
321 Code* ArgumentsAdaptorFrame::FindCode() const { | 323 Code* ArgumentsAdaptorFrame::FindCode() const { |
322 return Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline); | 324 return Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline); |
323 } | 325 } |
324 | 326 |
325 | 327 |
326 Code* InternalFrame::FindCode() const { | 328 Code* InternalFrame::FindCode() const { |
327 const int offset = InternalFrameConstants::kCodeOffset; | 329 const int offset = InternalFrameConstants::kCodeOffset; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 reg_code[i++] = r; | 580 reg_code[i++] = r; |
579 | 581 |
580 ASSERT(i == kNumJSCallerSaved); | 582 ASSERT(i == kNumJSCallerSaved); |
581 } | 583 } |
582 ASSERT(0 <= n && n < kNumJSCallerSaved); | 584 ASSERT(0 <= n && n < kNumJSCallerSaved); |
583 return reg_code[n]; | 585 return reg_code[n]; |
584 } | 586 } |
585 | 587 |
586 | 588 |
587 } } // namespace v8::internal | 589 } } // namespace v8::internal |
OLD | NEW |