OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 using ::v8::ObjectTemplate; | 65 using ::v8::ObjectTemplate; |
66 using ::v8::Persistent; | 66 using ::v8::Persistent; |
67 using ::v8::Script; | 67 using ::v8::Script; |
68 using ::v8::StackTrace; | 68 using ::v8::StackTrace; |
69 using ::v8::String; | 69 using ::v8::String; |
70 using ::v8::TryCatch; | 70 using ::v8::TryCatch; |
71 using ::v8::Undefined; | 71 using ::v8::Undefined; |
72 using ::v8::V8; | 72 using ::v8::V8; |
73 using ::v8::Value; | 73 using ::v8::Value; |
74 | 74 |
75 namespace i = ::i; | |
76 | |
77 | 75 |
78 static void ExpectString(const char* code, const char* expected) { | 76 static void ExpectString(const char* code, const char* expected) { |
79 Local<Value> result = CompileRun(code); | 77 Local<Value> result = CompileRun(code); |
80 CHECK(result->IsString()); | 78 CHECK(result->IsString()); |
81 String::AsciiValue ascii(result); | 79 String::AsciiValue ascii(result); |
82 CHECK_EQ(expected, *ascii); | 80 CHECK_EQ(expected, *ascii); |
83 } | 81 } |
84 | 82 |
85 | 83 |
86 static void ExpectBoolean(const char* code, bool expected) { | 84 static void ExpectBoolean(const char* code, bool expected) { |
(...skipping 14758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14845 } | 14843 } |
14846 | 14844 |
14847 i::Isolate::Current()->heap()->CollectAllGarbage(true); | 14845 i::Isolate::Current()->heap()->CollectAllGarbage(true); |
14848 { i::Object* raw_map_cache = i::Isolate::Current()->context()->map_cache(); | 14846 { i::Object* raw_map_cache = i::Isolate::Current()->context()->map_cache(); |
14849 if (raw_map_cache != i::Isolate::Current()->heap()->undefined_value()) { | 14847 if (raw_map_cache != i::Isolate::Current()->heap()->undefined_value()) { |
14850 i::MapCache* map_cache = i::MapCache::cast(raw_map_cache); | 14848 i::MapCache* map_cache = i::MapCache::cast(raw_map_cache); |
14851 CHECK_GT(elements, map_cache->NumberOfElements()); | 14849 CHECK_GT(elements, map_cache->NumberOfElements()); |
14852 } | 14850 } |
14853 } | 14851 } |
14854 } | 14852 } |
OLD | NEW |