OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <stack> | 5 #include <stack> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/interpreter/register-translator.h" | 9 #include "src/interpreter/register-translator.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 TEST_F(RegisterTranslatorTest, TestFrameSizeAdjustmentsForTranslationWindow) { | 67 TEST_F(RegisterTranslatorTest, TestFrameSizeAdjustmentsForTranslationWindow) { |
68 EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(0, 0)); | 68 EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(0, 0)); |
69 EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(10, 10)); | 69 EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(10, 10)); |
70 EXPECT_EQ(window_width(), | 70 EXPECT_EQ(window_width(), |
71 RegisterTranslator::RegisterCountAdjustment(173, 0)); | 71 RegisterTranslator::RegisterCountAdjustment(173, 0)); |
72 EXPECT_EQ(window_width(), | 72 EXPECT_EQ(window_width(), |
73 RegisterTranslator::RegisterCountAdjustment(173, 137)); | 73 RegisterTranslator::RegisterCountAdjustment(173, 137)); |
74 EXPECT_EQ(window_width(), | 74 EXPECT_EQ(window_width(), |
75 RegisterTranslator::RegisterCountAdjustment(173, 137)); | 75 RegisterTranslator::RegisterCountAdjustment(173, 137)); |
76 EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(0, 120)); | 76 // TODO(oth): Add a kMaxParameters8 that derives this info from the frame. |
| 77 int param_limit = FLAG_enable_embedded_constant_pool ? 119 : 120; |
| 78 EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(0, param_limit)); |
77 EXPECT_EQ(window_limit(), | 79 EXPECT_EQ(window_limit(), |
78 RegisterTranslator::RegisterCountAdjustment(0, 128)); | 80 RegisterTranslator::RegisterCountAdjustment(0, 128)); |
79 EXPECT_EQ(window_limit(), | 81 EXPECT_EQ(window_limit(), |
80 RegisterTranslator::RegisterCountAdjustment(0, 129)); | 82 RegisterTranslator::RegisterCountAdjustment(0, 129)); |
81 EXPECT_EQ(window_limit() - 32, | 83 EXPECT_EQ(window_limit() - 32, |
82 RegisterTranslator::RegisterCountAdjustment(32, 129)); | 84 RegisterTranslator::RegisterCountAdjustment(32, 129)); |
83 } | 85 } |
84 | 86 |
85 TEST_F(RegisterTranslatorTest, TestInTranslationWindow) { | 87 TEST_F(RegisterTranslatorTest, TestInTranslationWindow) { |
86 EXPECT_GE(window_start(), 0); | 88 EXPECT_GE(window_start(), 0); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 uint32_t operands[] = {receiver.ToRawOperand(), index.ToRawOperand(), | 251 uint32_t operands[] = {receiver.ToRawOperand(), index.ToRawOperand(), |
250 cache_info_pair.ToRawOperand()}; | 252 cache_info_pair.ToRawOperand()}; |
251 ASSERT_DEATH_IF_SUPPORTED( | 253 ASSERT_DEATH_IF_SUPPORTED( |
252 translator()->TranslateInputRegisters(Bytecode::kForInNext, operands, 3), | 254 translator()->TranslateInputRegisters(Bytecode::kForInNext, operands, 3), |
253 kBadOperandRegex); | 255 kBadOperandRegex); |
254 } | 256 } |
255 | 257 |
256 } // namespace interpreter | 258 } // namespace interpreter |
257 } // namespace internal | 259 } // namespace internal |
258 } // namespace v8 | 260 } // namespace v8 |
OLD | NEW |