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

Side by Side Diff: src/deoptimizer.cc

Issue 70203002: Simplify Hydrogen code stubs with variable argument count (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed smi-ification of variable arg count Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/code-stubs-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 value = frame_ptr + StandardFrameConstants::kCallerSPOffset - 1531 value = frame_ptr + StandardFrameConstants::kCallerSPOffset -
1532 (output_frame_size - output_frame_offset) + kPointerSize; 1532 (output_frame_size - output_frame_offset) + kPointerSize;
1533 output_frame->SetFrameSlot(output_frame_offset, value); 1533 output_frame->SetFrameSlot(output_frame_offset, value);
1534 if (trace_) { 1534 if (trace_) {
1535 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1535 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1536 V8PRIxPTR " ; args*\n", 1536 V8PRIxPTR " ; args*\n",
1537 top_address + output_frame_offset, output_frame_offset, value); 1537 top_address + output_frame_offset, output_frame_offset, value);
1538 } 1538 }
1539 1539
1540 // Copy the register parameters to the failure frame. 1540 // Copy the register parameters to the failure frame.
1541 int arguments_length_offset = -1;
1541 for (int i = 0; i < descriptor->register_param_count_; ++i) { 1542 for (int i = 0; i < descriptor->register_param_count_; ++i) {
1542 output_frame_offset -= kPointerSize; 1543 output_frame_offset -= kPointerSize;
1543 DoTranslateCommand(iterator, 0, output_frame_offset); 1544 DoTranslateCommand(iterator, 0, output_frame_offset);
1545
1546 if (!arg_count_known && descriptor->IsParameterCountRegister(i)) {
1547 arguments_length_offset = output_frame_offset;
1548 }
1544 } 1549 }
1545 1550
1551 ASSERT(0 == output_frame_offset);
1552
1546 if (!arg_count_known) { 1553 if (!arg_count_known) {
1547 DoTranslateCommand(iterator, 0, length_frame_offset, 1554 ASSERT(arguments_length_offset >= 0);
1548 TRANSLATED_VALUE_IS_NATIVE); 1555 // We know it's a smi because 1) the code stub guarantees the stack
Toon Verwaest 2013/11/12 15:43:06 Now we can get rid of TRANSLATED_VALUE_IS_NATIVE I
1549 caller_arg_count = output_frame->GetFrameSlot(length_frame_offset); 1556 // parameter count is in smi range, and 2) the DoTranslateCommand in the
1557 // parameter loop above translated that to a tagged value.
1558 Smi* smi_caller_arg_count = reinterpret_cast<Smi*>(
1559 output_frame->GetFrameSlot(arguments_length_offset));
1560 caller_arg_count = smi_caller_arg_count->value();
1561 output_frame->SetFrameSlot(length_frame_offset, caller_arg_count);
1562 if (trace_) {
1563 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1564 V8PRIxPTR " ; args.length\n",
1565 top_address + length_frame_offset, length_frame_offset,
1566 caller_arg_count);
1567 }
1550 value = frame_ptr + StandardFrameConstants::kCallerSPOffset + 1568 value = frame_ptr + StandardFrameConstants::kCallerSPOffset +
1551 (caller_arg_count - 1) * kPointerSize; 1569 (caller_arg_count - 1) * kPointerSize;
1552 output_frame->SetFrameSlot(args_arguments_offset, value); 1570 output_frame->SetFrameSlot(args_arguments_offset, value);
1553 if (trace_) { 1571 if (trace_) {
1554 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" 1572 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08"
1555 V8PRIxPTR " ; args.arguments\n", 1573 V8PRIxPTR " ; args.arguments\n",
1556 top_address + args_arguments_offset, args_arguments_offset, value); 1574 top_address + args_arguments_offset, args_arguments_offset,
1575 value);
1557 } 1576 }
1558 } 1577 }
1559 1578
1560 ASSERT(0 == output_frame_offset);
1561
1562 // Copy the double registers from the input into the output frame. 1579 // Copy the double registers from the input into the output frame.
1563 CopyDoubleRegisters(output_frame); 1580 CopyDoubleRegisters(output_frame);
1564 1581
1565 // Fill registers containing handler and number of parameters. 1582 // Fill registers containing handler and number of parameters.
1566 SetPlatformCompiledStubRegisters(output_frame, descriptor); 1583 SetPlatformCompiledStubRegisters(output_frame, descriptor);
1567 1584
1568 // Compute this frame's PC, state, and continuation. 1585 // Compute this frame's PC, state, and continuation.
1569 Code* trampoline = NULL; 1586 Code* trampoline = NULL;
1570 StubFunctionMode function_mode = descriptor->function_mode_; 1587 StubFunctionMode function_mode = descriptor->function_mode_;
1571 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline, 1588 StubFailureTrampolineStub(function_mode).FindCodeInCache(&trampoline,
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
2948 2965
2949 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 2966 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
2950 v->VisitPointer(BitCast<Object**>(&function_)); 2967 v->VisitPointer(BitCast<Object**>(&function_));
2951 v->VisitPointers(parameters_, parameters_ + parameters_count_); 2968 v->VisitPointers(parameters_, parameters_ + parameters_count_);
2952 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 2969 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
2953 } 2970 }
2954 2971
2955 #endif // ENABLE_DEBUGGER_SUPPORT 2972 #endif // ENABLE_DEBUGGER_SUPPORT
2956 2973
2957 } } // namespace v8::internal 2974 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698