Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: test/cctest/test-compiler.cc

Issue 6614010: [Isolates] Merge 6700:7030 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 static MaybeObject* GetGlobalProperty(const char* name) { 100 static MaybeObject* GetGlobalProperty(const char* name) {
101 Handle<String> symbol = FACTORY->LookupAsciiSymbol(name); 101 Handle<String> symbol = FACTORY->LookupAsciiSymbol(name);
102 return Isolate::Current()->context()->global()->GetProperty(*symbol); 102 return Isolate::Current()->context()->global()->GetProperty(*symbol);
103 } 103 }
104 104
105 105
106 static void SetGlobalProperty(const char* name, Object* value) { 106 static void SetGlobalProperty(const char* name, Object* value) {
107 Handle<Object> object(value); 107 Handle<Object> object(value);
108 Handle<String> symbol = FACTORY->LookupAsciiSymbol(name); 108 Handle<String> symbol = FACTORY->LookupAsciiSymbol(name);
109 Handle<JSObject> global(Isolate::Current()->context()->global()); 109 Handle<JSObject> global(Isolate::Current()->context()->global());
110 SetProperty(global, symbol, object, NONE); 110 SetProperty(global, symbol, object, NONE, kNonStrictMode);
111 } 111 }
112 112
113 113
114 static Handle<JSFunction> Compile(const char* source) { 114 static Handle<JSFunction> Compile(const char* source) {
115 Handle<String> source_code(FACTORY->NewStringFromUtf8(CStrVector(source))); 115 Handle<String> source_code(FACTORY->NewStringFromUtf8(CStrVector(source)));
116 Handle<SharedFunctionInfo> shared_function = 116 Handle<SharedFunctionInfo> shared_function =
117 Compiler::Compile(source_code, 117 Compiler::Compile(source_code,
118 Handle<String>(), 118 Handle<String>(),
119 0, 119 0,
120 0, 120 0,
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (i > 0) 341 if (i > 0)
342 buffer[i - 1] = '\n'; 342 buffer[i - 1] = '\n';
343 memcpy(&buffer[i], function_f, sizeof(function_f) - 1); 343 memcpy(&buffer[i], function_f, sizeof(function_f) - 1);
344 v8::Handle<v8::String> script_body = v8::String::New(buffer.start()); 344 v8::Handle<v8::String> script_body = v8::String::New(buffer.start());
345 v8::Script::Compile(script_body, &origin)->Run(); 345 v8::Script::Compile(script_body, &origin)->Run();
346 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( 346 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast(
347 env->Global()->Get(v8::String::New("f"))); 347 env->Global()->Get(v8::String::New("f")));
348 CHECK_EQ(i, f->GetScriptLineNumber()); 348 CHECK_EQ(i, f->GetScriptLineNumber());
349 } 349 }
350 } 350 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698