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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/execution.h" | 7 #include "src/execution.h" |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/interpreter/bytecode-array-builder.h" | 9 #include "src/interpreter/bytecode-array-builder.h" |
10 #include "src/interpreter/interpreter.h" | 10 #include "src/interpreter/interpreter.h" |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1443 CHECK(return_value->IsBoolean()); | 1443 CHECK(return_value->IsBoolean()); |
1444 CHECK_EQ(return_value->BooleanValue(), | 1444 CHECK_EQ(return_value->BooleanValue(), |
1445 CompareC(Token::Value::NE_STRICT, inputs_number[i], | 1445 CompareC(Token::Value::NE_STRICT, inputs_number[i], |
1446 inputs_number[j])); | 1446 inputs_number[j])); |
1447 } | 1447 } |
1448 } | 1448 } |
1449 } | 1449 } |
1450 | 1450 |
1451 TEST(InterpreterInstanceOf) { | 1451 TEST(InterpreterInstanceOf) { |
1452 HandleAndZoneScope handles; | 1452 HandleAndZoneScope handles; |
1453 // TODO(4447): The new ES6 'instanceof' operator is fully desugared in the | |
1454 // parser and the Token::INSTANCEOF is not needed anymore. This test only | |
1455 // makes sense with --no-harmony-instanceof and can be removed once we | |
1456 // deprecate the ability to switch to old skool ES5 'instanceof' for good. | |
1457 FLAG_harmony_instanceof = false; | |
rmcilroy
2016/03/21 11:53:26
(fine to do this in a followup CL which removes th
Michael Starzinger
2016/03/21 12:00:08
Acknowledged. Yes, that would be another way to ad
| |
1453 i::Factory* factory = handles.main_isolate()->factory(); | 1458 i::Factory* factory = handles.main_isolate()->factory(); |
1454 Handle<i::String> name = factory->NewStringFromAsciiChecked("cons"); | 1459 Handle<i::String> name = factory->NewStringFromAsciiChecked("cons"); |
1455 Handle<i::JSFunction> func = factory->NewFunction(name); | 1460 Handle<i::JSFunction> func = factory->NewFunction(name); |
1456 Handle<i::JSObject> instance = factory->NewJSObject(func); | 1461 Handle<i::JSObject> instance = factory->NewJSObject(func); |
1457 Handle<i::Object> other = factory->NewNumber(3.3333); | 1462 Handle<i::Object> other = factory->NewNumber(3.3333); |
1458 Handle<i::Object> cases[] = {Handle<i::Object>::cast(instance), other}; | 1463 Handle<i::Object> cases[] = {Handle<i::Object>::cast(instance), other}; |
1459 for (size_t i = 0; i < arraysize(cases); i++) { | 1464 for (size_t i = 0; i < arraysize(cases); i++) { |
1460 bool expected_value = (i == 0); | 1465 bool expected_value = (i == 0); |
1461 BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 0, | 1466 BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone(), 0, |
1462 0, 1); | 1467 0, 1); |
(...skipping 2772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4235 Handle<i::Object> return_value = callable().ToHandleChecked(); | 4240 Handle<i::Object> return_value = callable().ToHandleChecked(); |
4236 CHECK(return_value->SameValue(*const_decl[i].second)); | 4241 CHECK(return_value->SameValue(*const_decl[i].second)); |
4237 } | 4242 } |
4238 | 4243 |
4239 FLAG_legacy_const = old_flag_legacy_const; | 4244 FLAG_legacy_const = old_flag_legacy_const; |
4240 } | 4245 } |
4241 | 4246 |
4242 } // namespace interpreter | 4247 } // namespace interpreter |
4243 } // namespace internal | 4248 } // namespace internal |
4244 } // namespace v8 | 4249 } // namespace v8 |
OLD | NEW |