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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "include/v8.h" | 7 #include "include/v8.h" |
8 #include "include/v8-experimental.h" | 8 #include "include/v8-experimental.h" |
9 | 9 |
10 #include "src/api.h" | 10 #include "src/api.h" |
| 11 #include "src/objects-inl.h" |
11 #include "test/cctest/cctest.h" | 12 #include "test/cctest/cctest.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 // These tests mean to exercise v8::FastAccessorBuilder. Since initially the | 16 // These tests mean to exercise v8::FastAccessorBuilder. Since initially the |
16 // "native" accessor will get called, we need to "warmup" any accessor first, | 17 // "native" accessor will get called, we need to "warmup" any accessor first, |
17 // to make sure we're actually testing the v8::FastAccessorBuilder result. | 18 // to make sure we're actually testing the v8::FastAccessorBuilder result. |
18 // To accomplish this, we will | 19 // To accomplish this, we will |
19 // - call each accesssor N times before the actual test. | 20 // - call each accesssor N times before the actual test. |
20 // - wrap that call in a function, so that all such calls will go | 21 // - wrap that call in a function, so that all such calls will go |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 // Create an instance. | 483 // Create an instance. |
483 v8::Local<v8::Object> obj = foo->NewInstance(env.local()).ToLocalChecked(); | 484 v8::Local<v8::Object> obj = foo->NewInstance(env.local()).ToLocalChecked(); |
484 | 485 |
485 CHECK(env->Global()->Set(env.local(), v8_str("obj"), obj).FromJust()); | 486 CHECK(env->Global()->Set(env.local(), v8_str("obj"), obj).FromJust()); |
486 | 487 |
487 // Access flags. | 488 // Access flags. |
488 CompileRun(FN_WARMUP("test", "return obj.goto_test")); | 489 CompileRun(FN_WARMUP("test", "return obj.goto_test")); |
489 | 490 |
490 ExpectInt32("test()", 60707357); | 491 ExpectInt32("test()", 60707357); |
491 } | 492 } |
OLD | NEW |