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

Side by Side Diff: src/snapshot-common.cc

Issue 990883002: Hide Math function implementations in a closure. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/math.js ('k') | src/third_party/fdlibm/fdlibm.js » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The common functionality when building with or without snapshots. 5 // The common functionality when building with or without snapshots.
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 int length = context_offset + context_length; 159 int length = context_offset + context_length;
160 char* data = new char[length]; 160 char* data = new char[length];
161 161
162 memcpy(data + kMetadataOffset, &metadata.RawValue(), kInt32Size); 162 memcpy(data + kMetadataOffset, &metadata.RawValue(), kInt32Size);
163 memcpy(data + kFirstPageSizesOffset, first_page_sizes, 163 memcpy(data + kFirstPageSizesOffset, first_page_sizes,
164 kNumPagedSpaces * kInt32Size); 164 kNumPagedSpaces * kInt32Size);
165 memcpy(data + kStartupLengthOffset, &startup_length, kInt32Size); 165 memcpy(data + kStartupLengthOffset, &startup_length, kInt32Size);
166 memcpy(data + kStartupDataOffset, startup_data.begin(), startup_length); 166 memcpy(data + kStartupDataOffset, startup_data.begin(), startup_length);
167 memcpy(data + context_offset, context_data.begin(), context_length); 167 memcpy(data + context_offset, context_data.begin(), context_length);
168 v8::StartupData result = {data, length}; 168 v8::StartupData result = {data, length};
169 printf("%d %d\n", startup_length, context_length);
Jakob Kummerow 2015/03/09 12:29:22 debugging leftover?
169 return result; 170 return result;
170 } 171 }
171 172
172 173
173 Snapshot::Metadata Snapshot::ExtractMetadata(const v8::StartupData* data) { 174 Snapshot::Metadata Snapshot::ExtractMetadata(const v8::StartupData* data) {
174 uint32_t raw; 175 uint32_t raw;
175 memcpy(&raw, data->data + kMetadataOffset, kInt32Size); 176 memcpy(&raw, data->data + kMetadataOffset, kInt32Size);
176 return Metadata(raw); 177 return Metadata(raw);
177 } 178 }
178 179
(...skipping 14 matching lines...) Expand all
193 int startup_length; 194 int startup_length;
194 memcpy(&startup_length, data->data + kStartupLengthOffset, kIntSize); 195 memcpy(&startup_length, data->data + kStartupLengthOffset, kIntSize);
195 int context_offset = ContextOffset(startup_length); 196 int context_offset = ContextOffset(startup_length);
196 const byte* context_data = 197 const byte* context_data =
197 reinterpret_cast<const byte*>(data->data + context_offset); 198 reinterpret_cast<const byte*>(data->data + context_offset);
198 DCHECK_LT(context_offset, data->raw_size); 199 DCHECK_LT(context_offset, data->raw_size);
199 int context_length = data->raw_size - context_offset; 200 int context_length = data->raw_size - context_offset;
200 return Vector<const byte>(context_data, context_length); 201 return Vector<const byte>(context_data, context_length);
201 } 202 }
202 } } // namespace v8::internal 203 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/math.js ('k') | src/third_party/fdlibm/fdlibm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698