OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 int input_index = 0; | 1438 int input_index = 0; |
1439 | 1439 |
1440 CHECK(compiled_code_->is_hydrogen_stub()); | 1440 CHECK(compiled_code_->is_hydrogen_stub()); |
1441 int major_key = CodeStub::GetMajorKey(compiled_code_); | 1441 int major_key = CodeStub::GetMajorKey(compiled_code_); |
1442 CodeStubDescriptor descriptor(isolate_, compiled_code_->stub_key()); | 1442 CodeStubDescriptor descriptor(isolate_, compiled_code_->stub_key()); |
1443 | 1443 |
1444 // The output frame must have room for all pushed register parameters | 1444 // The output frame must have room for all pushed register parameters |
1445 // and the standard stack frame slots. Include space for an argument | 1445 // and the standard stack frame slots. Include space for an argument |
1446 // object to the callee and optionally the space to pass the argument | 1446 // object to the callee and optionally the space to pass the argument |
1447 // object to the stub failure handler. | 1447 // object to the stub failure handler. |
1448 int param_count = descriptor.GetEnvironmentParameterCount(); | 1448 int param_count = descriptor.GetRegisterParameterCount(); |
1449 CHECK_EQ(translated_frame->height(), param_count); | 1449 CHECK_EQ(translated_frame->height(), param_count); |
1450 CHECK_GE(param_count, 0); | 1450 CHECK_GE(param_count, 0); |
1451 | 1451 |
1452 int height_in_bytes = kPointerSize * param_count + sizeof(Arguments) + | 1452 int height_in_bytes = kPointerSize * param_count + sizeof(Arguments) + |
1453 kPointerSize; | 1453 kPointerSize; |
1454 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; | 1454 int fixed_frame_size = StandardFrameConstants::kFixedFrameSize; |
1455 int input_frame_size = input_->GetFrameSize(); | 1455 int input_frame_size = input_->GetFrameSize(); |
1456 int output_frame_size = height_in_bytes + fixed_frame_size; | 1456 int output_frame_size = height_in_bytes + fixed_frame_size; |
1457 if (trace_scope_ != NULL) { | 1457 if (trace_scope_ != NULL) { |
1458 PrintF(trace_scope_->file(), | 1458 PrintF(trace_scope_->file(), |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 output_frame->SetFrameSlot(output_frame_offset, value); | 1557 output_frame->SetFrameSlot(output_frame_offset, value); |
1558 DebugPrintOutputSlot(value, frame_index, output_frame_offset, "args*\n"); | 1558 DebugPrintOutputSlot(value, frame_index, output_frame_offset, "args*\n"); |
1559 | 1559 |
1560 // Copy the register parameters to the failure frame. | 1560 // Copy the register parameters to the failure frame. |
1561 int arguments_length_offset = -1; | 1561 int arguments_length_offset = -1; |
1562 for (int i = 0; i < param_count; ++i) { | 1562 for (int i = 0; i < param_count; ++i) { |
1563 output_frame_offset -= kPointerSize; | 1563 output_frame_offset -= kPointerSize; |
1564 WriteTranslatedValueToOutput(&value_iterator, &input_index, 0, | 1564 WriteTranslatedValueToOutput(&value_iterator, &input_index, 0, |
1565 output_frame_offset); | 1565 output_frame_offset); |
1566 | 1566 |
1567 if (!arg_count_known && descriptor.IsEnvironmentParameterCountRegister(i)) { | 1567 if (!arg_count_known && |
| 1568 descriptor.GetRegisterParameter(i) |
| 1569 .is(descriptor.stack_parameter_count())) { |
1568 arguments_length_offset = output_frame_offset; | 1570 arguments_length_offset = output_frame_offset; |
1569 } | 1571 } |
1570 } | 1572 } |
1571 | 1573 |
1572 CHECK_EQ(0u, output_frame_offset); | 1574 CHECK_EQ(0u, output_frame_offset); |
1573 | 1575 |
1574 if (!arg_count_known) { | 1576 if (!arg_count_known) { |
1575 CHECK_GE(arguments_length_offset, 0); | 1577 CHECK_GE(arguments_length_offset, 0); |
1576 // We know it's a smi because 1) the code stub guarantees the stack | 1578 // We know it's a smi because 1) the code stub guarantees the stack |
1577 // parameter count is in smi range, and 2) the DoTranslateCommand in the | 1579 // parameter count is in smi range, and 2) the DoTranslateCommand in the |
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3391 DCHECK(value_info->IsMaterializedObject()); | 3393 DCHECK(value_info->IsMaterializedObject()); |
3392 | 3394 |
3393 value_info->value_ = | 3395 value_info->value_ = |
3394 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3396 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3395 } | 3397 } |
3396 } | 3398 } |
3397 } | 3399 } |
3398 | 3400 |
3399 } // namespace internal | 3401 } // namespace internal |
3400 } // namespace v8 | 3402 } // namespace v8 |
OLD | NEW |