| OLD | NEW |
| 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/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = isolate->factory()->NewLiteralsArray( |
| 241 isolate->factory()->NewFixedArray(number_of_literals, TENURED); | 243 handle(target_shared->feedback_vector()), number_of_literals, TENURED); |
| 242 target->set_context(*context); | |
| 243 target->set_literals(*literals); | 244 target->set_literals(*literals); |
| 244 | 245 |
| 245 if (isolate->logger()->is_logging_code_events() || | 246 if (isolate->logger()->is_logging_code_events() || |
| 246 isolate->cpu_profiler()->is_profiling()) { | 247 isolate->cpu_profiler()->is_profiling()) { |
| 247 isolate->logger()->LogExistingFunction(source_shared, | 248 isolate->logger()->LogExistingFunction(source_shared, |
| 248 Handle<Code>(source_shared->code())); | 249 Handle<Code>(source_shared->code())); |
| 249 } | 250 } |
| 250 | 251 |
| 251 return *target; | 252 return *target; |
| 252 } | 253 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 603 |
| 603 | 604 |
| 604 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { | 605 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { |
| 605 HandleScope scope(isolate); | 606 HandleScope scope(isolate); |
| 606 DCHECK(args.length() == 0); | 607 DCHECK(args.length() == 0); |
| 607 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 608 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
| 608 NewTypeError(MessageTemplate::kStrongArity)); | 609 NewTypeError(MessageTemplate::kStrongArity)); |
| 609 } | 610 } |
| 610 } // namespace internal | 611 } // namespace internal |
| 611 } // namespace v8 | 612 } // namespace v8 |
| OLD | NEW |