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

Side by Side Diff: src/compilation-cache.cc

Issue 8879010: Increase eval compilation cache hits. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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 | « src/compilation-cache.h ('k') | src/objects.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 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 Handle<Context> context, 397 Handle<Context> context,
398 bool is_global, 398 bool is_global,
399 LanguageMode language_mode, 399 LanguageMode language_mode,
400 int scope_position) { 400 int scope_position) {
401 if (!IsEnabled()) { 401 if (!IsEnabled()) {
402 return Handle<SharedFunctionInfo>::null(); 402 return Handle<SharedFunctionInfo>::null();
403 } 403 }
404 404
405 Handle<SharedFunctionInfo> result; 405 Handle<SharedFunctionInfo> result;
406 if (is_global) { 406 if (is_global) {
407 ASSERT(context->IsGlobalContext());
407 result = eval_global_.Lookup( 408 result = eval_global_.Lookup(
408 source, context, language_mode, scope_position); 409 source, context, language_mode, RelocInfo::kNoPosition);
409 } else { 410 } else {
410 ASSERT(scope_position != RelocInfo::kNoPosition); 411 ASSERT(scope_position != RelocInfo::kNoPosition);
411 result = eval_contextual_.Lookup( 412 result = eval_contextual_.Lookup(
412 source, context, language_mode, scope_position); 413 source, context, language_mode, scope_position);
413 } 414 }
414 return result; 415 return result;
415 } 416 }
416 417
417 418
418 Handle<FixedArray> CompilationCache::LookupRegExp(Handle<String> source, 419 Handle<FixedArray> CompilationCache::LookupRegExp(Handle<String> source,
(...skipping 20 matching lines...) Expand all
439 Handle<Context> context, 440 Handle<Context> context,
440 bool is_global, 441 bool is_global,
441 Handle<SharedFunctionInfo> function_info, 442 Handle<SharedFunctionInfo> function_info,
442 int scope_position) { 443 int scope_position) {
443 if (!IsEnabled()) { 444 if (!IsEnabled()) {
444 return; 445 return;
445 } 446 }
446 447
447 HandleScope scope(isolate()); 448 HandleScope scope(isolate());
448 if (is_global) { 449 if (is_global) {
449 eval_global_.Put(source, context, function_info, scope_position); 450 ASSERT(context->IsGlobalContext());
451 eval_global_.Put(source, context, function_info, RelocInfo::kNoPosition);
450 } else { 452 } else {
451 ASSERT(scope_position != RelocInfo::kNoPosition); 453 ASSERT(scope_position != RelocInfo::kNoPosition);
452 eval_contextual_.Put(source, context, function_info, scope_position); 454 eval_contextual_.Put(source, context, function_info, scope_position);
453 } 455 }
454 } 456 }
455 457
456 458
457 459
458 void CompilationCache::PutRegExp(Handle<String> source, 460 void CompilationCache::PutRegExp(Handle<String> source,
459 JSRegExp::Flags flags, 461 JSRegExp::Flags flags,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 501 }
500 502
501 503
502 void CompilationCache::Disable() { 504 void CompilationCache::Disable() {
503 enabled_ = false; 505 enabled_ = false;
504 Clear(); 506 Clear();
505 } 507 }
506 508
507 509
508 } } // namespace v8::internal 510 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compilation-cache.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698