OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 26 matching lines...) Expand all Loading... |
37 #include "runtime.h" | 37 #include "runtime.h" |
38 #include "serialize.h" | 38 #include "serialize.h" |
39 #include "scopeinfo.h" | 39 #include "scopeinfo.h" |
40 #include "snapshot.h" | 40 #include "snapshot.h" |
41 #include "cctest.h" | 41 #include "cctest.h" |
42 | 42 |
43 using namespace v8::internal; | 43 using namespace v8::internal; |
44 | 44 |
45 static int local_counters[256]; | 45 static int local_counters[256]; |
46 static int counter_count = 0; | 46 static int counter_count = 0; |
47 static std::map<std::wstring, int> counter_table; | 47 static std::map<std::string, int> counter_table; |
48 | 48 |
49 | 49 |
50 // Callback receiver to track counters in test. | 50 // Callback receiver to track counters in test. |
51 static int* counter_function(const wchar_t* name) { | 51 static int* counter_function(const char* name) { |
52 std::wstring counter(name); | 52 std::string counter(name); |
53 if (counter_table.find(counter) == counter_table.end()) { | 53 if (counter_table.find(counter) == counter_table.end()) { |
54 local_counters[counter_count] = 0; | 54 local_counters[counter_count] = 0; |
55 counter_table[counter] = counter_count++; | 55 counter_table[counter] = counter_count++; |
56 } | 56 } |
57 | 57 |
58 return &local_counters[counter_table[counter]]; | 58 return &local_counters[counter_table[counter]]; |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 template <class T> | 62 template <class T> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 TEST(DeserializeExtensions) { | 257 TEST(DeserializeExtensions) { |
258 v8::HandleScope scope; | 258 v8::HandleScope scope; |
259 | 259 |
260 Deserialize(); | 260 Deserialize(); |
261 const char* c_source = "gc();"; | 261 const char* c_source = "gc();"; |
262 v8::Local<v8::String> source = v8::String::New(c_source); | 262 v8::Local<v8::String> source = v8::String::New(c_source); |
263 v8::Local<v8::Script> script = v8::Script::Compile(source); | 263 v8::Local<v8::Script> script = v8::Script::Compile(source); |
264 v8::Local<v8::Value> value = script->Run(); | 264 v8::Local<v8::Value> value = script->Run(); |
265 CHECK(value->IsUndefined()); | 265 CHECK(value->IsUndefined()); |
266 } | 266 } |
OLD | NEW |