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 3158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3169 v8::Local<v8::Value> v = CompileRun(src); | 3169 v8::Local<v8::Value> v = CompileRun(src); |
3170 i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); | 3170 i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); |
3171 i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); | 3171 i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); |
3172 i::Context* context = f->context(); | 3172 i::Context* context = f->context(); |
3173 i::AstValueFactory avf(&zone, isolate->heap()->HashSeed()); | 3173 i::AstValueFactory avf(&zone, isolate->heap()->HashSeed()); |
3174 avf.Internalize(isolate); | 3174 avf.Internalize(isolate); |
3175 const i::AstRawString* name = avf.GetOneByteString("result"); | 3175 const i::AstRawString* name = avf.GetOneByteString("result"); |
3176 i::Handle<i::String> str = name->string(); | 3176 i::Handle<i::String> str = name->string(); |
3177 CHECK(str->IsInternalizedString()); | 3177 CHECK(str->IsInternalizedString()); |
3178 i::Scope* script_scope = | 3178 i::Scope* script_scope = |
3179 new (&zone) i::Scope(isolate, &zone, NULL, i::SCRIPT_SCOPE, &avf); | 3179 new (&zone) i::Scope(&zone, NULL, i::SCRIPT_SCOPE, &avf); |
3180 script_scope->Initialize(); | 3180 script_scope->Initialize(); |
3181 i::Scope* s = | 3181 i::Scope* s = |
3182 i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope); | 3182 i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope); |
3183 DCHECK(s != script_scope); | 3183 DCHECK(s != script_scope); |
3184 DCHECK(name != NULL); | 3184 DCHECK(name != NULL); |
3185 | 3185 |
3186 // Get result from h's function context (that is f's context) | 3186 // Get result from h's function context (that is f's context) |
3187 i::Variable* var = s->Lookup(name); | 3187 i::Variable* var = s->Lookup(name); |
3188 | 3188 |
3189 CHECK(var != NULL); | 3189 CHECK(var != NULL); |
(...skipping 27 matching lines...) Expand all Loading... |
3217 printf("\n"); | 3217 printf("\n"); |
3218 i::Zone zone; | 3218 i::Zone zone; |
3219 v8::Local<v8::Value> v = CompileRun(src); | 3219 v8::Local<v8::Value> v = CompileRun(src); |
3220 i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); | 3220 i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); |
3221 i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); | 3221 i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); |
3222 i::Context* context = f->context(); | 3222 i::Context* context = f->context(); |
3223 i::AstValueFactory avf(&zone, isolate->heap()->HashSeed()); | 3223 i::AstValueFactory avf(&zone, isolate->heap()->HashSeed()); |
3224 avf.Internalize(isolate); | 3224 avf.Internalize(isolate); |
3225 | 3225 |
3226 i::Scope* script_scope = | 3226 i::Scope* script_scope = |
3227 new (&zone) i::Scope(isolate, &zone, NULL, i::SCRIPT_SCOPE, &avf); | 3227 new (&zone) i::Scope(&zone, NULL, i::SCRIPT_SCOPE, &avf); |
3228 script_scope->Initialize(); | 3228 script_scope->Initialize(); |
3229 i::Scope* s = | 3229 i::Scope* s = |
3230 i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope); | 3230 i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope); |
3231 DCHECK(s != script_scope); | 3231 DCHECK(s != script_scope); |
3232 const i::AstRawString* name_x = avf.GetOneByteString("x"); | 3232 const i::AstRawString* name_x = avf.GetOneByteString("x"); |
3233 | 3233 |
3234 // Get result from f's function context (that is g's outer context) | 3234 // Get result from f's function context (that is g's outer context) |
3235 i::Variable* var_x = s->Lookup(name_x); | 3235 i::Variable* var_x = s->Lookup(name_x); |
3236 CHECK(var_x != NULL); | 3236 CHECK(var_x != NULL); |
3237 CHECK(var_x->maybe_assigned() == i::kMaybeAssigned); | 3237 CHECK(var_x->maybe_assigned() == i::kMaybeAssigned); |
(...skipping 27 matching lines...) Expand all Loading... |
3265 printf("\n"); | 3265 printf("\n"); |
3266 i::Zone zone; | 3266 i::Zone zone; |
3267 v8::Local<v8::Value> v = CompileRun(src); | 3267 v8::Local<v8::Value> v = CompileRun(src); |
3268 i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); | 3268 i::Handle<i::Object> o = v8::Utils::OpenHandle(*v); |
3269 i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); | 3269 i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o); |
3270 i::Context* context = f->context(); | 3270 i::Context* context = f->context(); |
3271 i::AstValueFactory avf(&zone, isolate->heap()->HashSeed()); | 3271 i::AstValueFactory avf(&zone, isolate->heap()->HashSeed()); |
3272 avf.Internalize(isolate); | 3272 avf.Internalize(isolate); |
3273 | 3273 |
3274 i::Scope* script_scope = | 3274 i::Scope* script_scope = |
3275 new (&zone) i::Scope(isolate, &zone, NULL, i::SCRIPT_SCOPE, &avf); | 3275 new (&zone) i::Scope(&zone, NULL, i::SCRIPT_SCOPE, &avf); |
3276 script_scope->Initialize(); | 3276 script_scope->Initialize(); |
3277 i::Scope* s = | 3277 i::Scope* s = |
3278 i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope); | 3278 i::Scope::DeserializeScopeChain(isolate, &zone, context, script_scope); |
3279 DCHECK(s != script_scope); | 3279 DCHECK(s != script_scope); |
3280 const i::AstRawString* name_x = avf.GetOneByteString("x"); | 3280 const i::AstRawString* name_x = avf.GetOneByteString("x"); |
3281 const i::AstRawString* name_f = avf.GetOneByteString("f"); | 3281 const i::AstRawString* name_f = avf.GetOneByteString("f"); |
3282 const i::AstRawString* name_y = avf.GetOneByteString("y"); | 3282 const i::AstRawString* name_y = avf.GetOneByteString("y"); |
3283 const i::AstRawString* name_B = avf.GetOneByteString("B"); | 3283 const i::AstRawString* name_B = avf.GetOneByteString("B"); |
3284 const i::AstRawString* name_C = avf.GetOneByteString("C"); | 3284 const i::AstRawString* name_C = avf.GetOneByteString("C"); |
3285 | 3285 |
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 "class C {static set arguments(_) {}}", | 5142 "class C {static set arguments(_) {}}", |
5143 | 5143 |
5144 NULL}; | 5144 NULL}; |
5145 | 5145 |
5146 static const ParserFlag always_flags[] = { | 5146 static const ParserFlag always_flags[] = { |
5147 kAllowHarmonyClasses, kAllowHarmonyObjectLiterals, kAllowHarmonyScoping, | 5147 kAllowHarmonyClasses, kAllowHarmonyObjectLiterals, kAllowHarmonyScoping, |
5148 kAllowStrongMode}; | 5148 kAllowStrongMode}; |
5149 RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0, | 5149 RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0, |
5150 always_flags, arraysize(always_flags)); | 5150 always_flags, arraysize(always_flags)); |
5151 } | 5151 } |
OLD | NEW |