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

Side by Side Diff: src/code-stubs.cc

Issue 6723014: Avoid TLS access for counters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix lint 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 | « src/assembler.cc ('k') | src/codegen.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 30 matching lines...) Expand all
41 if (index != NumberDictionary::kNotFound) { 41 if (index != NumberDictionary::kNotFound) {
42 *code_out = Code::cast(HEAP->code_stubs()->ValueAt(index)); 42 *code_out = Code::cast(HEAP->code_stubs()->ValueAt(index));
43 return true; 43 return true;
44 } 44 }
45 return false; 45 return false;
46 } 46 }
47 47
48 48
49 void CodeStub::GenerateCode(MacroAssembler* masm) { 49 void CodeStub::GenerateCode(MacroAssembler* masm) {
50 // Update the static counter each time a new code stub is generated. 50 // Update the static counter each time a new code stub is generated.
51 COUNTERS->code_stubs()->Increment(); 51 masm->isolate()->counters()->code_stubs()->Increment();
52 52
53 // Nested stubs are not allowed for leafs. 53 // Nested stubs are not allowed for leafs.
54 AllowStubCallsScope allow_scope(masm, AllowsStubCalls()); 54 AllowStubCallsScope allow_scope(masm, AllowsStubCalls());
55 55
56 // Generate the code for the stub. 56 // Generate the code for the stub.
57 masm->set_generating_stub(true); 57 masm->set_generating_stub(true);
58 Generate(masm); 58 Generate(masm);
59 } 59 }
60 60
61 61
62 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) { 62 void CodeStub::RecordCodeGeneration(Code* code, MacroAssembler* masm) {
63 code->set_major_key(MajorKey()); 63 code->set_major_key(MajorKey());
64 64
65 PROFILE(ISOLATE, CodeCreateEvent(Logger::STUB_TAG, code, GetName())); 65 Isolate* isolate = masm->isolate();
66 PROFILE(isolate, CodeCreateEvent(Logger::STUB_TAG, code, GetName()));
66 GDBJIT(AddCode(GDBJITInterface::STUB, GetName(), code)); 67 GDBJIT(AddCode(GDBJITInterface::STUB, GetName(), code));
67 COUNTERS->total_stubs_code_size()->Increment(code->instruction_size()); 68 Counters* counters = isolate->counters();
69 counters->total_stubs_code_size()->Increment(code->instruction_size());
68 70
69 #ifdef ENABLE_DISASSEMBLER 71 #ifdef ENABLE_DISASSEMBLER
70 if (FLAG_print_code_stubs) { 72 if (FLAG_print_code_stubs) {
71 #ifdef DEBUG 73 #ifdef DEBUG
72 Print(); 74 Print();
73 #endif 75 #endif
74 code->Disassemble(GetName()); 76 code->Disassemble(GetName());
75 PrintF("\n"); 77 PrintF("\n");
76 } 78 }
77 #endif 79 #endif
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 OS::SNPrintF(Vector<char>(name_, kMaxNameLength), 226 OS::SNPrintF(Vector<char>(name_, kMaxNameLength),
225 "InstanceofStub%s%s%s", 227 "InstanceofStub%s%s%s",
226 args, 228 args,
227 inline_check, 229 inline_check,
228 return_true_false_object); 230 return_true_false_object);
229 return name_; 231 return name_;
230 } 232 }
231 233
232 234
233 } } // namespace v8::internal 235 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler.cc ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698