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

Side by Side Diff: src/runtime/runtime-function.cc

Issue 1374723002: Introduce LiteralsArray to hide it's implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix build break. Created 5 years, 2 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/runtime/runtime.h ('k') | src/runtime/runtime-literals.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 SharedFunctionInfo::SetScript( 229 SharedFunctionInfo::SetScript(
230 target_shared, Handle<Object>(source_shared->script(), isolate)); 230 target_shared, Handle<Object>(source_shared->script(), isolate));
231 231
232 // Set the code of the target function. 232 // Set the code of the target function.
233 target->ReplaceCode(source_shared->code()); 233 target->ReplaceCode(source_shared->code());
234 DCHECK(target->next_function_link()->IsUndefined()); 234 DCHECK(target->next_function_link()->IsUndefined());
235 235
236 // Make sure we get a fresh copy of the literal vector to avoid cross 236 // Make sure we get a fresh copy of the literal vector to avoid cross
237 // context contamination. 237 // context contamination.
238 Handle<Context> context(source->context()); 238 Handle<Context> context(source->context());
239 target->set_context(*context);
240
239 int number_of_literals = source->NumberOfLiterals(); 241 int number_of_literals = source->NumberOfLiterals();
240 Handle<FixedArray> literals = 242 Handle<LiteralsArray> literals =
241 isolate->factory()->NewFixedArray(number_of_literals, TENURED); 243 LiteralsArray::New(isolate, handle(target_shared->feedback_vector()),
242 target->set_context(*context); 244 number_of_literals, TENURED);
243 target->set_literals(*literals); 245 target->set_literals(*literals);
244 246
245 if (isolate->logger()->is_logging_code_events() || 247 if (isolate->logger()->is_logging_code_events() ||
246 isolate->cpu_profiler()->is_profiling()) { 248 isolate->cpu_profiler()->is_profiling()) {
247 isolate->logger()->LogExistingFunction(source_shared, 249 isolate->logger()->LogExistingFunction(source_shared,
248 Handle<Code>(source_shared->code())); 250 Handle<Code>(source_shared->code()));
249 } 251 }
250 252
251 return *target; 253 return *target;
252 } 254 }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 604
603 605
604 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { 606 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) {
605 HandleScope scope(isolate); 607 HandleScope scope(isolate);
606 DCHECK(args.length() == 0); 608 DCHECK(args.length() == 0);
607 THROW_NEW_ERROR_RETURN_FAILURE(isolate, 609 THROW_NEW_ERROR_RETURN_FAILURE(isolate,
608 NewTypeError(MessageTemplate::kStrongArity)); 610 NewTypeError(MessageTemplate::kStrongArity));
609 } 611 }
610 } // namespace internal 612 } // namespace internal
611 } // namespace v8 613 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-literals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698