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

Side by Side Diff: src/assembler.cc

Issue 23548024: Introduce a RandonNumberGenerator class. Refactor the random/private_random uses in Isolate/Context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 3 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/api.cc ('k') | src/bootstrapper.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 25 matching lines...) Expand all
36 36
37 #include <cmath> 37 #include <cmath>
38 #include "api.h" 38 #include "api.h"
39 #include "builtins.h" 39 #include "builtins.h"
40 #include "counters.h" 40 #include "counters.h"
41 #include "cpu.h" 41 #include "cpu.h"
42 #include "debug.h" 42 #include "debug.h"
43 #include "deoptimizer.h" 43 #include "deoptimizer.h"
44 #include "execution.h" 44 #include "execution.h"
45 #include "ic.h" 45 #include "ic.h"
46 #include "isolate.h" 46 #include "isolate-inl.h"
47 #include "jsregexp.h" 47 #include "jsregexp.h"
48 #include "lazy-instance.h" 48 #include "lazy-instance.h"
49 #include "platform.h" 49 #include "platform.h"
50 #include "regexp-macro-assembler.h" 50 #include "regexp-macro-assembler.h"
51 #include "regexp-stack.h" 51 #include "regexp-stack.h"
52 #include "runtime.h" 52 #include "runtime.h"
53 #include "serialize.h" 53 #include "serialize.h"
54 #include "store-buffer-inl.h" 54 #include "store-buffer-inl.h"
55 #include "stub-cache.h" 55 #include "stub-cache.h"
56 #include "token.h" 56 #include "token.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // ----------------------------------------------------------------------------- 112 // -----------------------------------------------------------------------------
113 // Implementation of AssemblerBase 113 // Implementation of AssemblerBase
114 114
115 AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size) 115 AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size)
116 : isolate_(isolate), 116 : isolate_(isolate),
117 jit_cookie_(0), 117 jit_cookie_(0),
118 enabled_cpu_features_(0), 118 enabled_cpu_features_(0),
119 emit_debug_code_(FLAG_debug_code), 119 emit_debug_code_(FLAG_debug_code),
120 predictable_code_size_(false) { 120 predictable_code_size_(false) {
121 if (FLAG_mask_constants_with_cookie && isolate != NULL) { 121 if (FLAG_mask_constants_with_cookie && isolate != NULL) {
122 jit_cookie_ = V8::RandomPrivate(isolate); 122 jit_cookie_ = isolate->random_number_generator()->NextInt();
123 } 123 }
124 124
125 if (buffer == NULL) { 125 if (buffer == NULL) {
126 // Do our own buffer management. 126 // Do our own buffer management.
127 if (buffer_size <= kMinimalBufferSize) { 127 if (buffer_size <= kMinimalBufferSize) {
128 buffer_size = kMinimalBufferSize; 128 buffer_size = kMinimalBufferSize;
129 if (isolate->assembler_spare_buffer() != NULL) { 129 if (isolate->assembler_spare_buffer() != NULL) {
130 buffer = isolate->assembler_spare_buffer(); 130 buffer = isolate->assembler_spare_buffer();
131 isolate->set_assembler_spare_buffer(NULL); 131 isolate->set_assembler_spare_buffer(NULL);
132 } 132 }
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); 1676 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position);
1677 state_.written_position = state_.current_position; 1677 state_.written_position = state_.current_position;
1678 written = true; 1678 written = true;
1679 } 1679 }
1680 1680
1681 // Return whether something was written. 1681 // Return whether something was written.
1682 return written; 1682 return written;
1683 } 1683 }
1684 1684
1685 } } // namespace v8::internal 1685 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698