OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <tuple> | 5 #include <tuple> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/execution.h" | 9 #include "src/execution.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 factory->NewStringFromStaticChars("1.112.5")}, | 406 factory->NewStringFromStaticChars("1.112.5")}, |
407 {factory->NewStringFromStaticChars("-1.11"), factory->NewHeapNumber(2.56), | 407 {factory->NewStringFromStaticChars("-1.11"), factory->NewHeapNumber(2.56), |
408 factory->NewStringFromStaticChars("-1.112.56")}, | 408 factory->NewStringFromStaticChars("-1.112.56")}, |
409 {factory->NewStringFromStaticChars(""), factory->NewHeapNumber(2.5), | 409 {factory->NewStringFromStaticChars(""), factory->NewHeapNumber(2.5), |
410 factory->NewStringFromStaticChars("2.5")}, | 410 factory->NewStringFromStaticChars("2.5")}, |
411 }; | 411 }; |
412 | 412 |
413 for (size_t i = 0; i < arraysize(test_cases); i++) { | 413 for (size_t i = 0; i < arraysize(test_cases); i++) { |
414 BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1); | 414 BytecodeArrayBuilder builder(isolate, handles.main_zone(), 1, 0, 1); |
415 FeedbackVectorSpec feedback_spec(&zone); | 415 FeedbackVectorSpec feedback_spec(&zone); |
416 FeedbackVectorSlot slot = feedback_spec.AddGeneralSlot(); | 416 FeedbackVectorSlot slot = feedback_spec.AddInterpreterBinaryOpICSlot(); |
417 Handle<i::TypeFeedbackVector> vector = | 417 Handle<i::TypeFeedbackVector> vector = |
418 NewTypeFeedbackVector(isolate, &feedback_spec); | 418 NewTypeFeedbackVector(isolate, &feedback_spec); |
419 | 419 |
420 Register reg(0); | 420 Register reg(0); |
421 builder.LoadLiteral(test_cases[i].lhs) | 421 builder.LoadLiteral(test_cases[i].lhs) |
422 .StoreAccumulatorInRegister(reg) | 422 .StoreAccumulatorInRegister(reg) |
423 .LoadLiteral(test_cases[i].rhs) | 423 .LoadLiteral(test_cases[i].rhs) |
424 .BinaryOperation(Token::Value::ADD, reg, vector->GetIndex(slot)) | 424 .BinaryOperation(Token::Value::ADD, reg, vector->GetIndex(slot)) |
425 .Return(); | 425 .Return(); |
426 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); | 426 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); |
(...skipping 4378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4805 auto callable = tester.GetCallable<>(); | 4805 auto callable = tester.GetCallable<>(); |
4806 | 4806 |
4807 Handle<i::Object> return_value = callable().ToHandleChecked(); | 4807 Handle<i::Object> return_value = callable().ToHandleChecked(); |
4808 CHECK(return_value->SameValue(*tests[i].second)); | 4808 CHECK(return_value->SameValue(*tests[i].second)); |
4809 } | 4809 } |
4810 } | 4810 } |
4811 | 4811 |
4812 } // namespace interpreter | 4812 } // namespace interpreter |
4813 } // namespace internal | 4813 } // namespace internal |
4814 } // namespace v8 | 4814 } // namespace v8 |
OLD | NEW |