OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 15999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16010 "function outer() {\n" | 16010 "function outer() {\n" |
16011 "function bar() {\n" | 16011 "function bar() {\n" |
16012 " AnalyzeStackOfEvalWithSourceURL();\n" | 16012 " AnalyzeStackOfEvalWithSourceURL();\n" |
16013 "}\n" | 16013 "}\n" |
16014 "function foo() {\n" | 16014 "function foo() {\n" |
16015 "\n" | 16015 "\n" |
16016 " bar();\n" | 16016 " bar();\n" |
16017 "}\n" | 16017 "}\n" |
16018 "foo();\n" | 16018 "foo();\n" |
16019 "}\n" | 16019 "}\n" |
16020 "eval('(' + outer +')()//@ sourceURL=eval_url');"; | 16020 "eval('(' + outer +')()%s');"; |
16021 CHECK(CompileRun(source)->IsUndefined()); | 16021 |
| 16022 i::ScopedVector<char> code(1024); |
| 16023 i::OS::SNPrintF(code, source, "//# sourceURL=eval_url"); |
| 16024 CHECK(CompileRun(code.start())->IsUndefined()); |
| 16025 i::OS::SNPrintF(code, source, "//@ sourceURL=eval_url"); |
| 16026 CHECK(CompileRun(code.start())->IsUndefined()); |
16022 } | 16027 } |
16023 | 16028 |
16024 | 16029 |
16025 v8::Handle<Value> AnalyzeStackOfInlineScriptWithSourceURL( | 16030 v8::Handle<Value> AnalyzeStackOfInlineScriptWithSourceURL( |
16026 const v8::Arguments& args) { | 16031 const v8::Arguments& args) { |
16027 v8::HandleScope scope(args.GetIsolate()); | 16032 v8::HandleScope scope(args.GetIsolate()); |
16028 v8::Handle<v8::StackTrace> stackTrace = | 16033 v8::Handle<v8::StackTrace> stackTrace = |
16029 v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); | 16034 v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); |
16030 CHECK_EQ(4, stackTrace->GetFrameCount()); | 16035 CHECK_EQ(4, stackTrace->GetFrameCount()); |
16031 v8::Handle<v8::String> url = v8_str("url"); | 16036 v8::Handle<v8::String> url = v8_str("url"); |
(...skipping 19 matching lines...) Expand all Loading... |
16051 "function outer() {\n" | 16056 "function outer() {\n" |
16052 "function bar() {\n" | 16057 "function bar() {\n" |
16053 " AnalyzeStackOfInlineScriptWithSourceURL();\n" | 16058 " AnalyzeStackOfInlineScriptWithSourceURL();\n" |
16054 "}\n" | 16059 "}\n" |
16055 "function foo() {\n" | 16060 "function foo() {\n" |
16056 "\n" | 16061 "\n" |
16057 " bar();\n" | 16062 " bar();\n" |
16058 "}\n" | 16063 "}\n" |
16059 "foo();\n" | 16064 "foo();\n" |
16060 "}\n" | 16065 "}\n" |
16061 "outer()\n" | 16066 "outer()\n%s"; |
16062 "//@ sourceURL=source_url"; | 16067 |
16063 CHECK(CompileRunWithOrigin(source, "url", 0, 1)->IsUndefined()); | 16068 i::ScopedVector<char> code(1024); |
| 16069 i::OS::SNPrintF(code, source, "//# sourceURL=source_url"); |
| 16070 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined()); |
| 16071 i::OS::SNPrintF(code, source, "//@ sourceURL=source_url"); |
| 16072 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 1)->IsUndefined()); |
16064 } | 16073 } |
16065 | 16074 |
16066 | 16075 |
16067 v8::Handle<Value> AnalyzeStackOfDynamicScriptWithSourceURL( | 16076 v8::Handle<Value> AnalyzeStackOfDynamicScriptWithSourceURL( |
16068 const v8::Arguments& args) { | 16077 const v8::Arguments& args) { |
16069 v8::HandleScope scope(args.GetIsolate()); | 16078 v8::HandleScope scope(args.GetIsolate()); |
16070 v8::Handle<v8::StackTrace> stackTrace = | 16079 v8::Handle<v8::StackTrace> stackTrace = |
16071 v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); | 16080 v8::StackTrace::CurrentStackTrace(10, v8::StackTrace::kDetailed); |
16072 CHECK_EQ(4, stackTrace->GetFrameCount()); | 16081 CHECK_EQ(4, stackTrace->GetFrameCount()); |
16073 v8::Handle<v8::String> url = v8_str("source_url"); | 16082 v8::Handle<v8::String> url = v8_str("source_url"); |
(...skipping 19 matching lines...) Expand all Loading... |
16093 "function outer() {\n" | 16102 "function outer() {\n" |
16094 "function bar() {\n" | 16103 "function bar() {\n" |
16095 " AnalyzeStackOfDynamicScriptWithSourceURL();\n" | 16104 " AnalyzeStackOfDynamicScriptWithSourceURL();\n" |
16096 "}\n" | 16105 "}\n" |
16097 "function foo() {\n" | 16106 "function foo() {\n" |
16098 "\n" | 16107 "\n" |
16099 " bar();\n" | 16108 " bar();\n" |
16100 "}\n" | 16109 "}\n" |
16101 "foo();\n" | 16110 "foo();\n" |
16102 "}\n" | 16111 "}\n" |
16103 "outer()\n" | 16112 "outer()\n%s"; |
16104 "//@ sourceURL=source_url"; | 16113 |
16105 CHECK(CompileRunWithOrigin(source, "url", 0, 0)->IsUndefined()); | 16114 i::ScopedVector<char> code(1024); |
| 16115 i::OS::SNPrintF(code, source, "//# sourceURL=source_url"); |
| 16116 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
| 16117 i::OS::SNPrintF(code, source, "//@ sourceURL=source_url"); |
| 16118 CHECK(CompileRunWithOrigin(code.start(), "url", 0, 0)->IsUndefined()); |
16106 } | 16119 } |
16107 | 16120 |
16108 static void CreateGarbageInOldSpace() { | 16121 static void CreateGarbageInOldSpace() { |
16109 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 16122 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
16110 i::AlwaysAllocateScope always_allocate; | 16123 i::AlwaysAllocateScope always_allocate; |
16111 for (int i = 0; i < 1000; i++) { | 16124 for (int i = 0; i < 1000; i++) { |
16112 FACTORY->NewFixedArray(1000, i::TENURED); | 16125 FACTORY->NewFixedArray(1000, i::TENURED); |
16113 } | 16126 } |
16114 } | 16127 } |
16115 | 16128 |
(...skipping 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19342 i::Semaphore* sem_; | 19355 i::Semaphore* sem_; |
19343 volatile int sem_value_; | 19356 volatile int sem_value_; |
19344 }; | 19357 }; |
19345 | 19358 |
19346 | 19359 |
19347 THREADED_TEST(SemaphoreInterruption) { | 19360 THREADED_TEST(SemaphoreInterruption) { |
19348 ThreadInterruptTest().RunTest(); | 19361 ThreadInterruptTest().RunTest(); |
19349 } | 19362 } |
19350 | 19363 |
19351 #endif // WIN32 | 19364 #endif // WIN32 |
OLD | NEW |