Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
| 9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 default: | 811 default: |
| 812 CHECK_EQ(JSRegExp::NOT_COMPILED, TypeTag()); | 812 CHECK_EQ(JSRegExp::NOT_COMPILED, TypeTag()); |
| 813 CHECK(data()->IsUndefined()); | 813 CHECK(data()->IsUndefined()); |
| 814 break; | 814 break; |
| 815 } | 815 } |
| 816 } | 816 } |
| 817 | 817 |
| 818 | 818 |
| 819 void JSProxy::JSProxyVerify() { | 819 void JSProxy::JSProxyVerify() { |
| 820 CHECK(IsJSProxy()); | 820 CHECK(IsJSProxy()); |
| 821 VerifyPointer(target()); | |
| 821 VerifyPointer(handler()); | 822 VerifyPointer(handler()); |
| 823 if (target()->IsCallable()) { | |
|
Igor Sheludko
2015/12/23 17:04:52
You could probably rewrite these ifs like this:
Camillo Bruni
2015/12/23 19:07:01
Sometimes I really wonder how I got so far with pr
| |
| 824 CHECK(map()->is_callable()); | |
| 825 if (target()->IsConstructor()) { | |
| 826 CHECK(map()->is_constructor()); | |
| 827 } else { | |
| 828 CHECK(!map()->is_constructor()); | |
| 829 } | |
| 830 } else { | |
| 831 CHECK(!map()->is_callable()); | |
| 832 } | |
| 822 CHECK(hash()->IsSmi() || hash()->IsUndefined()); | 833 CHECK(hash()->IsSmi() || hash()->IsUndefined()); |
| 834 CHECK(map()->prototype()->IsNull()); | |
| 835 // There should be not properties on a Proxy. | |
|
Igor Sheludko
2015/12/23 17:04:52
s/not/no/
| |
| 836 CHECK_EQ(0, map()->NumberOfOwnDescriptors()); | |
| 823 } | 837 } |
| 824 | 838 |
| 825 | 839 |
| 826 void JSArrayBuffer::JSArrayBufferVerify() { | 840 void JSArrayBuffer::JSArrayBufferVerify() { |
| 827 CHECK(IsJSArrayBuffer()); | 841 CHECK(IsJSArrayBuffer()); |
| 828 JSObjectVerify(); | 842 JSObjectVerify(); |
| 829 VerifyPointer(byte_length()); | 843 VerifyPointer(byte_length()); |
| 830 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() | 844 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
| 831 || byte_length()->IsUndefined()); | 845 || byte_length()->IsUndefined()); |
| 832 } | 846 } |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 | 1324 |
| 1311 // Both are done at the same time. | 1325 // Both are done at the same time. |
| 1312 CHECK_EQ(new_it.done(), old_it.done()); | 1326 CHECK_EQ(new_it.done(), old_it.done()); |
| 1313 } | 1327 } |
| 1314 | 1328 |
| 1315 | 1329 |
| 1316 #endif // DEBUG | 1330 #endif // DEBUG |
| 1317 | 1331 |
| 1318 } // namespace internal | 1332 } // namespace internal |
| 1319 } // namespace v8 | 1333 } // namespace v8 |
| OLD | NEW |